Prev: 965F Up: Map Next: 96E8
9688: Routine at 9688
Used by the routines at RedefineKey and 965F.
9688 PUSH BC Stash BC and HL on the stack.
9689 PUSH HL
968A LD HL,$F800 HL=F800.
968D LD E,$FE E=FE.
968F LD A,E A=E.
9690 IN A,($FE) A=byte from port FE.
9692 OR %11100000 Set bits 5-7.
9694 CPL Invert the bits in A.
9695 LD (HL),A Write A to *HL.
9696 INC HL Increment HL by one.
9697 RLC E Rotate E left (with carry).
9699 JR C,$968F Jump to 968F if HL is less than A.
969B LD (IY+$64),$00 Write 00 to *IY+64.
969F LD HL,$F800 HL=F800.
96A2 BIT 0,(HL) Test bit 0 of *HL.
96A4 JR Z,$96B0 Jump to 96B0 if HL is equal to A.
96A6 SET 0,(IY+$64) Set bit 0 of *IX+64.
96AA RES 0,(HL) Reset bit 0 of *HL.
96AC LD E,$FE E=FE.
96AE LD D,$01 D=01.
96B0 LD HL,$F807 HL=F807.
96B3 BIT 1,(HL) Test bit 1 of *HL.
96B5 JR Z,$96C1 Jump to 96C1 if HL is equal to A.
96B7 SET 1,(IY+$64) Set bit 1 of *IX+64.
96BB RES 1,(HL) Reset bit 1 of *HL.
96BD LD E,$7F E=7F.
96BF LD D,$02 D=02.
96C1 PUSH IX Stash IX on the stack.
96C3 LD IX,$F800 IX=F800.
96C7 LD HL,$970D HL=970D.
96CA LD B,$FE B=FE.
96CC LD A,(IX+$00) A=*IX+00.
96CF OR A Set the bits from A.
96D0 JR NZ,$96F0 Jump to 96F0 if HL is not equal to A.
96D2 INC IX Increment IX by one.
96D4 LD A,$05 L+=05.
96D6 ADD A,L
96D7 LD L,A
96D8 JR NC,$96DB Jump to 96DB if HL is greater than or equal to A.
96DA INC H Increment H by one.
96DB RLC B Rotate B left (with carry).
96DD JR C,$96CC Jump to 96CC if H is less than A.
96DF LD A,($F864) Compare *F864 with itself for the return.
96E2 CP A
96E3 POP IX Restore IX, HL and BC from the stack.
96E5 POP HL
96E6 POP BC
96E7 RET Return.
Prev: 965F Up: Map Next: 96E8