Prev: 29748 Up: Map Next: 29816
29759: Message: Choose A Class Token
Turns a class token into a dictionary word and prints it. Bit 7 of the token selects the class table; a zero neighbour ends the line.
Message_ChooseAClassToken 29759 BIT 7,D Jump to Message_ChooseAClassToken_ChooseTheTokenTable if the token is not a class token.
29761 JR Z,Message_ChooseAClassToken_ChooseTheTokenTable
29763 LD A,E Jump to Message_ChooseAClassToken_SetTheCapitaliseFlag if the low byte is not YOU.
29764 LD HL,1960
29767 CP L
29768 JR NZ,Message_ChooseAClassToken_SetTheCapitaliseFlag
29770 LD A,D Return if the high nibble matches YOU.
29771 AND 15
29773 CP H
29774 RET Z
Message_ChooseAClassToken_SetTheCapitaliseFlag 29775 LD A,1 Set the capitalise-the-next-letter flag.
29777 LD (46852),A
29780 RET Return.
Message_ChooseAClassToken_ChooseTheTokenTable 29781 LD HL,44333 Point HL at 44333.
29784 LD A,(46849) Read *WaitCountdown.
29787 LD E,A Jump to Message_ChooseAClassToken_ShiftTheClassToken if *WaitCountdown and *28895 are both zero.
29788 LD A,(28895)
29791 OR E
29792 JR Z,Message_ChooseAClassToken_ShiftTheClassToken
29794 LD HL,44341 Point HL at 44341.
Message_ChooseAClassToken_ShiftTheClassToken 29797 LD A,D Shift the class token two places.
29798 RRCA
29799 RRCA
29800 RRCA
29801 AND 30
29803 PUSH DE Save DE and keep A in E.
29804 LD E,A
29805 LD D,0 The class-token offset's high byte is zero.
29807 ADD HL,DE Add the class index to the token table.
29808 LD E,(HL) Read the low byte of 44341.
29809 INC HL Step to the high byte of the token entry.
29810 LD D,(HL) Read the high byte of 44341.
29811 CALL PrintToken Call PrintToken to print a dictionary token.
29814 POP DE Restore DE from the stack.
29815 RET Return.
View the equivalent code in;
Prev: 29748 Up: Map Next: 29816