; ********** ACCESSING A SIMPLE TABLE ********** ; ALL SPACE CELLS OF THIS ENTRY ARE 0. ; REMOVE THIS ENTRY BY ZEROING PREVIOUS LINK AND CONCEDE. ; ************************************************************* .org 0000h LD SP, 00FEh ; ADDED FOR TESTING PURPOSES. CALL MOVE ; ADDED FOR TESTING PURPOSES. HALT ; ADDED FOR TESTING PURPOSES. MOVE: LD A, (MOVENUM) ; GET MOVE NUMBER. DEC A ; FIND LAST MOVE INDEX. RLCA ; INDEX NUMBER 2 (multiplied by 2). LD C, A ; NOW IN C. LD B, 0 ; NOW IN BC. LD IX, MOVETBL ; MOVE TABLE. ADD IX, BC ; POINT TO LINK ADDRESS. LD H, (IX +0) ; MOST SIGNIFICANT BYTE. LD L, (IX +1) ; LEAST SIGNIFICANT BYTE. XOR A ; ZERO. LD (HL), A ; ZERO LINK. .ORG 0050h MOVETBL: .DW 00 .DW 00 .DW 00 .DW 00 .DW 00 .ORG 0060h MOVENUM: .DW 02 .DW 03 .DW 04 .DW 05 .DW 06 .END