Prev: 36482 Up: Map Next: 36522
36498: Print Handler: Tab
TAB parameter handler. Called on the byte immediately following a 23 (TAB) control code. Sets the X position (32769) to the parameter value. If the parameter is less than the current X position (i.e., the cursor would move left), the Y position advances to the next row.
PrintHandler_Tab 36498 LD HL,36323 Reset PrintState_Handler to PrintHandler (default handler).
36501 LD (32778),HL
36504 LD C,A C=target X position (the TAB parameter).
36505 LD A,(32769) B=*PrintState_X (current X position).
36508 LD B,A
36509 LD A,C A=target X; write target X to *PrintState_X.
36510 LD (32769),A
36513 SUB B A=target X − current X.
36514 RET NC Return if the cursor moved right or stayed (no row advance needed).
36515 LD HL,32768 HL=32768 (Y position pointer).
36518 CALL PrintHandler_AdvanceRow Call PrintHandler_AdvanceRow to advance the Y position by one line.
36521 RET Return.
Prev: 36482 Up: Map Next: 36522