Announcement

Collapse

Forum etiquette

Our mission ...

This forum is part of our mission to promote the preservation of vintage computers through education and outreach. (In real life we also run events and have a museum.) We encourage you to join us, participate, share your knowledge, and enjoy.

This forum has been around in this format for over 15 years. These rules and guidelines help us maintain a healthy and active community, and we moderate the forum to keep things on track. Please familiarize yourself with these rules and guidelines.


Remain civil and respectful

There are several hundred people who actively participate here. People come from all different backgrounds and will have different ways of seeing things. You will not agree with everything you read here. Back-and-forth discussions are fine but do not cross the line into rude or disrespectful behavior.

Conduct yourself as you would at any other place where people come together in person to discuss their hobby. If you wouldn't say something to somebody in person, then you probably should not be writing it here.

This should be obvious but, just in case: profanity, threats, slurs against any group (sexual, racial, gender, etc.) will not be tolerated.


Stay close to the original topic being discussed
  • If you are starting a new thread choose a reasonable sub-forum to start your thread. (If you choose incorrectly don't worry, we can fix that.)
  • If you are responding to a thread, stay on topic - the original poster was trying to achieve something. You can always start a new thread instead of potentially "hijacking" an existing thread.



Contribute something meaningful

To put things in engineering terms, we value a high signal to noise ratio. Coming here should not be a waste of time.
  • This is not a chat room. If you are taking less than 30 seconds to make a post then you are probably doing something wrong. A post should be on topic, clear, and contribute something meaningful to the discussion. If people read your posts and feel that their time as been wasted, they will stop reading your posts. Worse yet, they will stop visiting and we'll lose their experience and contributions.
  • Do not bump threads.
  • Do not "necro-post" unless you are following up to a specific person on a specific thread. And even then, that person may have moved on. Just start a new thread for your related topic.
  • Use the Private Message system for posts that are targeted at a specific person.


"PM Sent!" messages (or, how to use the Private Message system)

This forum has a private message feature that we want people to use for messages that are not of general interest to other members.

In short, if you are going to reply to a thread and that reply is targeted to a specific individual and not of interest to anybody else (either now or in the future) then send a private message instead.

Here are some obvious examples of when you should not reply to a thread and use the PM system instead:
  • "PM Sent!": Do not tell the rest of us that you sent a PM ... the forum software will tell the other person that they have a PM waiting.
  • "How much is shipping to ....": This is a very specific and directed question that is not of interest to anybody else.


Why do we have this policy? Sending a "PM Sent!" type message basically wastes everybody else's time by making them having to scroll past a post in a thread that looks to be updated, when the update is not meaningful. And the person you are sending the PM to will be notified by the forum software that they have a message waiting for them. Look up at the top near the right edge where it says 'Notifications' ... if you have a PM waiting, it will tell you there.

Copyright and other legal issues

We are here to discuss vintage computing, so discussing software, books, and other intellectual property that is on-topic is fine. We don't want people using these forums to discuss or enable copyright violations or other things that are against the law; whether you agree with the law or not is irrelevant. Do not use our resources for something that is legally or morally questionable.

Our discussions here generally fall under "fair use." Telling people how to pirate a software title is an example of something that is not allowable here.


Reporting problematic posts

If you see spam, a wildly off-topic post, or something abusive or illegal please report the thread by clicking on the "Report Post" icon. (It looks like an exclamation point in a triangle and it is available under every post.) This send a notification to all of the moderators, so somebody will see it and deal with it.

If you are unsure you may consider sending a private message to a moderator instead.


New user moderation

New users are directly moderated so that we can weed spammers out early. This means that for your first 10 posts you will have some delay before they are seen. We understand this can be disruptive to the flow of conversation and we try to keep up with our new user moderation duties to avoid undue inconvenience. Please do not make duplicate posts, extra posts to bump your post count, or ask the moderators to expedite this process; 10 moderated posts will go by quickly.

New users also have a smaller personal message inbox limit and are rate limited when sending PMs to other users.


Other suggestions
  • Use Google, books, or other definitive sources. There is a lot of information out there.
  • Don't make people guess at what you are trying to say; we are not mind readers. Be clear and concise.
  • Spelling and grammar are not rated, but they do make a post easier to read.
See more
See less

A new article about x86 processors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by Chuck(G) View Post
    I'm a little confused here--exactly what is the purpose of the code?
    Move a block in memory using the stack - not for any practical purpose, just to see how fast it can run.
    I'm using the A register as a loop counter (16 bytes copied per iteration on Z80, 6 on 8080/85), and HL/DE are assumed to hold the initial source and destination pointers.

    The 8080 version is just the inner loop, because the setup part is pretty much identical. The code to restore SP could also be moved into the loop to allow interrupts.

    Comment


      Ah okay. Interesting exercise. Other than push and pop, the only other two-byte options are LHLD and SHLD on an 8080, but the address arithmetic needed kills that one. Maybe the 8085-specific LHLX and SHLX might work. (10 clocks each).

      Since I wasn't aware of the 8085-specific instructions when I wrote my move code back in the dark ages, my approach was to do the traditional MOV M,H/STAX D,INX, INX for a 16-byte unroll, followed by a 1-byte per iteration cleanup.

      Too bad that the 8080 didn't have auto-increment as on option for HL and DE indirect addressing.
      Last edited by Chuck(G); February 27, 2019, 04:34 PM.

      Comment


        Originally posted by dreNorteR View Post
        I'm counting 283 cycles / 16 bytes = 17.69 per byte
        18.81 if modified to accept interrupts once every loop

        Anyway, LDIR is fast enough in most cases, simpler to use, and can be interrupted at any time.

        Does anyone know the best 6502 cycle count for self-modifying memcpy?
        Thanks! However just 16 LDI's with DEC A and JP NZ gives you code lesser in size and 270 cycles only, 270/16 = 16.875 cycles/byte, and that code is interruptible and preserves register values. So PUSH/POP has no use for fast copying with the Z80.

        The 6502 code is easy but not very fast.
        Code:
            ;XR - size/256, YR = 0
        l1: lda from,Y
        l2: sta to,Y
            iny
            bne l1
            inc l1+2
            inc l2+2
            dex
            bne l1
        It is about 14 cycles per byte. The 65816 can do it only for 7 cycles using its block instructions.

        The division by 6 is a very slow thing for 8-bit chips...
        Last edited by vol.litwr; February 28, 2019, 12:13 AM.

        Comment


          IMHO the 8085 block copying may be much faster and easier for example,
          Code:
          ; DE - to, SP - from, BC - 16-bit word count
          l1: pop hl
              ld (de),hl
              inc de
              inc de
              dec c
              jp nz,l1
              dec b
              jp nz,l1
          It is 46 cycles, 46/2 = 23 cycles/byte. I used mnemonics close to the z80's. We can double the inner loop contents, this gives 78 cycles for 4 bytes or 19.5 cycles/byte. If we use the quadruple inner loop, it will give us 142 cycles for 8 bytes or 17.75 cycles/byte. So the 8085 definitely beats the Z80 if we use a larger inner loop! The inner loop needs only 13 cycles per byte, it is almost the same as 11 cycles of the 6502!
          Last edited by vol.litwr; February 28, 2019, 12:41 AM.

          Comment


            if we know that DE is even or odd we can replace one INC DE with INC E and get 2 more cycles and get the 6502's cycles count! I am really impressed by the 8085, it could beat the Z80 in the 70's.

            Comment


              I hadn't even thought of combining POP with 16 bit store!

              Unless the count is a multiple of 256, you need to increment B before the loop. Best way to do this:
              Code:
              	xor a
              	cp c	;set carry if C > 0
              	adc a,b
              	;ld b,a -- not needed, high byte can be kept in A

              Comment


                RM Nimbus had an 80186 CPU. Yes it ran a modified MSDOS and Windows. However, there were 2 versions of an IBM emulator with it:

                1) Software IBM Emulator - which was good enough to run a number of IBM PC software programs
                2) Hardware Emulator - this was a piggy back board that plugged into the 8087 Floating point processor socket and extended the emulation. It was sufficient to run many IBM PC games including Flight simulator together with the IBM parallel printer interface. which provided a standard IBM LPT port. You could even peek and poke port addresses to control hardware on the port using the same code as on a genuine IBM PC.


                Peter

                Comment


                  I never knew that (the hardware emulator)! I guess my school was too cheap. We had loads of these machines, they were still selling them with the '186 probably until about 1990.

                  Comment

                  Working...
                  X