Prev: 43136 Up: Map Next: 43355
43311: 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 43311 LD A,(HL) A=*HL (load the token format byte).
43312 AND %00001111 Extract the format type.
43314 CP 15 Return if the format type is 15 (the end marker).
43316 RET Z
Calculate the table offset for this format type (multiply by 4).
43317 RLCA Multiply by 4 to get the table offset.
43318 RLCA
43319 LD L,A Set HL to the offset value (L=A, H=0).
43320 LD H,0
43322 LD BC,43100 BC=Table_FormatData (load the address of the format data table).
43325 ADD HL,BC HL+=BC (add the table base to get the format data pointer).
43326 LD B,4 B=4 (set the copy counter to 4 bytes).
ProcessTextTokenFormat_CopyLoop 43328 LD A,(HL) A=*HL (load a byte from the format data).
43329 INC HL Increment HL by one (move to the next byte).
43330 LD (IX+0),A Write A to *IX+0 (copy the byte to the buffer).
43333 INC IX Increment IX by one (move to the next buffer position).
43335 DJNZ ProcessTextTokenFormat_CopyLoop Decrease counter by one and loop back to ProcessTextTokenFormat_CopyLoop until counter is zero.
43337 LD (IX+0),B Write B (4 the terminator) to *IX+0.
43340 RET Return.
Handle nested format processing (recursive call).
43341 PUSH IX Stash IX (the buffer pointer) on the stack.
43343 PUSH HL Stash HL (the text pointer) on the stack.
43344 CALL ProcessFormatDataByte Call ProcessFormatDataByte to process the nested format.
43347 EX (SP),HL Exchange the *SP with the HL register (restore the text pointer).
43348 CALL ProcessTextTokenFormat Call ProcessTextTokenFormat to recursively process the format.
43351 POP HL Restore HL from the stack.
43352 POP IX Restore IX from the stack.
43354 RET Return.
Prev: 43136 Up: Map Next: 43355