value db 0h, 10h
value dw 10h
Are they the same? What is the difference?
If I used, for example,
ld A, (value)
What would happen in both cases?
value db 0h, 10h
value dw 10h
Are they the same? What is the difference?
If I used, for example,
ld A, (value)
What would happen in both cases?
value db 0h, 10h
the machine code produced is (hexa bytes): 00 10
value dw 10h
the machine code produced is (hexa bytes): 10 00
(because Z80 is little-endian CPU)
ld A, (value)
will load A
with value: in first case 0
, and second 16
.
db = data byte = 1 byte
dw = data word = 2 bytes, which are in the little endian order