RosettaCodeData/Task/Conditional-structures/Z80-Assembly/conditional-structures-5.z80

15 lines
292 B
Z80 Assembly

ld a,(HL) ;switch (HL)
cp 1 ;case (1)
jr nz,+ ;branch to next colon (note: not all assemblers support this syntax)
call HL_EQUALS_1
:
cp 2 ;case (2)
jr nz,+ ;branch to next colon
call HL_EQUALS_2
:
cp 50
jr nz,+
call HL_EQUALS_50
:
;rest of program