| ▲ | blywi 5 hours ago | |
XOR A absolutely works on Z80 and it's of course faster and shorter than loading a zero value with LD A,0. LD A,0 is encoded to 2 bytes while XOR A is encoded as a single opcode. XOR A has the additional benefit to also clear all the flags to 0. Sub A will clear the accumulator, but it will always set the N flag on Z80. | ||
| ▲ | eichin 11 minutes ago | parent | next [-] | |
Yeah, the article seems to have missed the likely biggest reason that this is the popular x86 idiom - that it was already the popular 8080/Z80 idiom from the CP/M era, and there's a direct line (and a bunch of early 8086 DOS applications were mechanically translated assembly code, so while they are "different" architectures they're still solidly related.) | ||
| ▲ | classichasclass 4 hours ago | parent | prev [-] | |
Ah, thanks, I couldn't recall off the top of my head. | ||