Submitted by Steve Fewell
Description:
Get the Integer result of the expression after the 'TAB(' keyword.
If the result is a Float then convert it to an Integer, if the result is a string then generate 'Type mismatch' error.
922A | L | 076 246 142 | 4C F6 8E | JMP &8EF6 'Missing ,' error |
922D | * | 165 042 | A5 2A | LDA &2A |
922F | H | 072 | 48 | PHA |
9230 | 032 167 150 | 20 A7 96 | JSR &96A7 Extract Integer result of expression and check for closing bracket | |
9233 | 169 031 | A9 1F | LDA#&1F | |
9235 | 032 238 255 | 20 EE FF | JSR &FFEE OSWRCH (Write character) | |
9238 | h | 104 | 68 | PLA |
9239 | 032 238 255 | 20 EE FF | JSR &FFEE OSWRCH (Write character) | |
923C | @ | 032 064 152 | 20 40 98 | JSR &9840 Send ?&2A to the OS output vector |
923F | ) | 128 041 | 80 29 | BRA 41 --> &926A Clear carry flag, Set PTR A offset = PTR B offset and exit |
9241 | 032 175 150 | 20 AF 96 | JSR &96AF Get Integer result of expression | |
9244 | 032 235 142 | 20 EB 8E | JSR &8EEB Get next non-space character (PTR B) and compare with ',' | |
9247 | 240 228 | F0 E4 | BEQ -28 --> &922D | |
9249 | ) | 201 041 | C9 29 | CMP#&29 ')' |
924B | 208 221 | D0 DD | BNE -35 --> &922A | |
924D | * | 165 042 | A5 2A | LDA &2A |
924F | 229 030 | E5 1E | SBC &1E (COUNT) | |
9251 | 240 023 | F0 17 | BEQ 23 --> &926A Clear carry flag, Set PTR A offset = PTR B offset and exit | |
9253 | 170 | AA | TAX | |
9254 | 176 012 | B0 0C | BCS 12 --> &9262 Output X number of spaces, clr carry, PTR A=PTR B & exit | |
9256 | 032 146 186 | 20 92 BA | JSR &BA92 Start new output line | |
9259 | 128 003 | 80 03 | BRA 3 --> &925E Output ?&2A number of spaces, clr carry, PTR A=PTR B & exit |
9840 | * | 165 042 | A5 2A | LDA &2A |
9842 | l | 108 014 002 | 6C 0E 02 | JMP (&020E) OS Output character vector (WRCHV) |