Prev: A880 Up: Map Next: A95B
A92F: Process Text Token Format
Used by the routine at ExtractTokenFromText.
Input
IX Buffer pointer (where to write format data)
HL Pointer to token format byte
Extract the format type and copy format data to the buffer.
ProcessTextTokenFormat A92F LD A,(HL) A=*HL (load the token format byte).
A930 AND %00001111 Extract the format type.
A932 CP $0F Return if the format type is 0F (the end marker).
A934 RET Z
Calculate the table offset for this format type (multiply by 4).
A935 RLCA Multiply by 04 to get the table offset.
A936 RLCA
A937 LD L,A Set HL to the offset value (L=A, H=00).
A938 LD H,$00
A93A LD BC,$A85C BC=Table_FormatData (load the address of the format data table).
A93D ADD HL,BC HL+=BC (add the table base to get the format data pointer).
A93E LD B,$04 B=04 (set the copy counter to 4 bytes).
ProcessTextTokenFormat_CopyLoop A940 LD A,(HL) A=*HL (load a byte from the format data).
A941 INC HL Increment HL by one (move to the next byte).
A942 LD (IX+$00),A Write A to *IX+00 (copy the byte to the buffer).
A945 INC IX Increment IX by one (move to the next buffer position).
A947 DJNZ ProcessTextTokenFormat_CopyLoop Decrease counter by one and loop back to ProcessTextTokenFormat_CopyLoop until counter is zero.
A949 LD (IX+$00),B Write B (04 the terminator) to *IX+00.
A94C RET Return.
Handle nested format processing (recursive call).
A94D PUSH IX Stash IX (the buffer pointer) on the stack.
A94F PUSH HL Stash HL (the text pointer) on the stack.
A950 CALL ProcessFormatDataByte Call ProcessFormatDataByte to process the nested format.
A953 EX (SP),HL Exchange the *SP with the HL register (restore the text pointer).
A954 CALL ProcessTextTokenFormat Call ProcessTextTokenFormat to recursively process the format.
A957 POP HL Restore HL from the stack.
A958 POP IX Restore IX from the stack.
A95A RET Return.
Prev: A880 Up: Map Next: A95B