4 ; The getting of the next token from the input file
9 ;----- Standard Header ------------------------------------------------------
16 ;----- External dependencies ------------------------------------------------
20 ;----- Main code ------------------------------------------------------------
22 AREA |TermScript$$Code|,CODE,READONLY
26 ; On entry: R9 == previous token, or -1
27 ; R10 == pointer into the tokenised buffer
28 ; R12 == anchor block pointer
30 ; On exit: R7 == token class of token read
31 ; R8 == index of token in token class
32 ; R9 == new lookahead token
33 ; R10 == moved on to the first character after the rvalue
35 ; Use: Tries to read an token from the current input line
40 10getToken CMP R9,#10 ;Is it a newline?
41 BEQ %20getToken ;A newline -- bump line count
42 LDRB R9,[R10],#1 ;Load a byte
43 CMP R9,#31 ;Is it an implicit newline?
44 BEQ %20getToken ;Yes -- bump line counter
46 15getToken ADR R8,tokClasses ;Point to class table
51 MOVS PC,R14 ;Return to caller
53 20getToken LDR R7,sail_line ;Yes -- get current line
54 ADD R7,R7,#1 ;Increment line num
55 STR R7,sail_line ;And save new line number
56 LDRB R9,[R10],#1 ;Load a byte
57 CMP R9,#31 ;Should we ignore this char?
58 BEQ %20getToken ;Yes -- look for the next
65 ;----- That's all, folks ----------------------------------------------------