8 lines
509 B
Z80 Assembly
8 lines
509 B
Z80 Assembly
EndianTest:
|
|
ld hl,&8000
|
|
ld (&C000),hl ;store &8000 into memory.
|
|
ld a,(&C000) ;loads the byte at &C000 into A. If the Z80 were big-endian, A would equal &80. But it equals zero.
|
|
or a ;still, we need to pretend we don't already know the result and compare A to zero.
|
|
jr z,LittleEndian ;handle the case where Z80 is little-endian (which it is, so this branch is always taken.)
|
|
|
|
;else, do whatever you would do to show that the Z80 is big-endian (it isn't, so execution never reaches here.)
|