Two Stop Bitsnew | comments | tags | ask | submitlogin
Intel 8080 Emulator in 6502 Assembly (8080 6502 emulation) (github.com)
10 points by chris8080 620 days ago | 5 comments
  • geiagal 620 days ago
    It would probably be easier to do the reverse, since there are more registers on the 8080. Could assign a register per 6502 register even.
  • ddingus 620 days ago
    Interesting. What is the 8080 speed?
    • chris8080 620 days ago
      Unless my calculations are wrong, executing a NOP (opcode $00) would take 39 cycles (instead of 4 cycles on a 8080).

      Here is a simulation of an execution of NOP from the label run_emulator in 8080.s with STACK_BASED_DISPATCHER=false (it's 6 cycles faster)

        (cycles, instruction)
        3 lda (PCL),y
        2 tax
        2 asl
        3 bcc do_tab1
        4 sta _jmp2+1
        4 lda instruction_length,x
        3 beq length1
        5 inc PCL
        3 bne no_inch_pch
        5 jmp (tab2)
        3 jmp run_emulator
        =39
      
      And that's in the best case with no page crossing.
      • chris8080 620 days ago
        errata: replace _jmp2 by _jmp1 and tab2 by tab1
        • ddingus 620 days ago
          Nice! I am looking at my Apple 2e with 16Mhz 6502 (actually '802) with 1Mb of fast RAM on the CPU card thinking it may run at useful speeds.

          S1

lists | rss | source
Search:
Two Stop Bits is a discussion web site about retro computing and gaming.