Author Topic: Z80 vs 6502  (Read 5486 times)

0 Members and 1 Guest are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Z80 vs 6502
« on: July 06, 2011, 12:41:19 am »
I've been starting a port of Commando, a game which uses the Motorola 6502 processor.  (By the way, Ti-83+ ASM is NOTHING compared to programming for the Atari 7800...I'm glad I'm only making a port!!)  Both the Motorola 6502 processor and the Z80 processor came not far from each other, and both were used for video game systems.

Each processor has its advantages and disadvantages.  While I prefer the Z80, there are some things about the Motorola 6502 that I wish the z80 had.

First, here's some things the Z80 has that the 6502 doesn't have, making the Z80 a dang fine processor indeed

The Z80 processor has more registers--many more
The Z80 has instructions that can compare and copy many values at once  (Like LDIR and CPIR)
The Z80's stack is much more flexible than the 6502's stack
You can work with 2-byte values on the z80, but not on the 6502
The 6502 has no register that can hold a direct address to work with  (The Z80 has HL, plus to a certain point DE, BC and SP)
The 6502 requires the carry flag for all math.  On the z80, it's optional.
On the 6502, you can only use conditions with a relative jump.  You can use conditions with calls, returns and longer jumps on the Z80
You can compare any register with register A.  On the 6502, registers cannot be compared with each other

And now, stuff the 6502 does that I wish the Z80 did:

Indexing is much easier and flexible on the 6502.  For instance, you can use a register to store an offset.
You can save one byte and several T-States on the 6502 by storing and retriving values from $0000 to $00FF.  This is not possible on the z80
On the 6520, you can use CP with almost all 1-byte registers
You can use almost all 1-byte registers to store directly to an address, as well as retrieve a value from it
One can increase or decrease the value in a direct address on the 6502

« Last Edit: July 06, 2011, 12:48:18 am by Hot_Dog »

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Z80 vs 6502
« Reply #1 on: July 06, 2011, 01:01:23 am »
Sounds like an interesting but difficult proc. That gives me an idea to compare the RISC vs CISC architecture philosophy. Personally I prefer RISC which the ARM and SuperH use but many also like CISC which is what the z80 along with x86 use.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)