Sherlock: annotated disassembly

Routines

Prev: ACA6 Up: Map Next: ACFB
ACCC: Note where this sentence started, so it can be read again
Skips commas ($A0), then keeps the token position ($A029, also in $A02B), E, IY and A012 at AAA1-$AAA6; when A01A is 2 it marks the node with bit 6 of +1.
Input
E Flags
IY The sentence node
Output
The start of the sentence saved at $AAA1 to $AAA6
ACCC RES 3,E Clear bit 3 of E - E bit 3 clear: no clause finished yet
ACCE PUSH DE Save DE on the stack
ACCF CALL $AE7F Call the routine "Read the next token of the typed line" (AE7F) - Skip commas (class $A0)
ACD2 CP $A0 Compare A with $A0
ACD4 JR Z,$ACCF If A equals $A0, go back to ACCF
ACD6 LD HL,($A029) Read $A029 in "Game variables" into HL - Remember where this sentence starts: the token position ($A029)...
ACD9 LD ($AAA1),HL Store HL in AAA1
ACDC LD ($A02B),HL Store HL in $A02B in "Game variables"
ACDF POP DE Restore DE from the stack
ACE0 LD A,E Copy E into A - ...the flags in E, the node (IY) and the sentence count (A012)
ACE1 LD ($AAA3),A Store A in AAA3
ACE4 LD ($AAA4),IY Store IY in $AAA4
ACE8 LD A,($A012) Read A012 in "Game variables" into A
ACEB LD ($AAA6),A Store A in $AAA6
ACEE LD A,($A01A) Read A01A in "Game variables" into A - 'All but' (A01A = 2): mark the node with bit 6 of +1
ACF1 CP $02 Compare A with $02
ACF3 JR NZ,$AD57 If A differs from $02, jump on to the routine "Count the sentence, then on to the next or finish" (AD57)
ACF5 SET 6,(IY+$01) Set bit 6 of byte +1 of the record at IY
ACF9 JR $AD57 Jump on to the routine "Count the sentence, then on to the next or finish" (AD57)
Prev: ACA6 Up: Map Next: ACFB