tests.tal (12703B)
1 ( Opcode Tester ) 2 3 ( Requirements: 4 EQU/EQU2 should put #00 or #01 on the stack 5 #18 DEO should output ascii character to console ) 6 7 %EMIT { #18 DEO } 8 %TEST-SHORT { EQU2 #30 ADD EMIT } 9 %TEST-BYTE { EQU #30 ADD EMIT } 10 %MODE { #20 EMIT } 11 %OPCODE { #0a EMIT } 12 %TYPE { OPCODE OPCODE } 13 14 |0000 15 16 @zeropage 17 &byte $1 &short $2 18 19 |0100 20 21 ( Logic ) 22 23 ( EQU ) 24 #f8 #f8 EQU [ #01 ] TEST-BYTE 25 #01 #01 EQU [ #01 ] TEST-BYTE 26 #f8 #01 EQU [ #00 ] TEST-BYTE 27 #01 #f8 EQU [ #00 ] TEST-BYTE 28 MODE 29 #f801 #f801 EQU2 [ #01 ] TEST-BYTE 30 #01f8 #01f8 EQU2 [ #01 ] TEST-BYTE 31 #f801 #01f8 EQU2 [ #00 ] TEST-BYTE 32 #01f8 #f801 EQU2 [ #00 ] TEST-BYTE 33 MODE 34 #f8 #f8 EQUk ADD ADD [ #f1 ] TEST-BYTE 35 #01 #01 EQUk ADD ADD [ #03 ] TEST-BYTE 36 #f8 #01 EQUk ADD ADD [ #f9 ] TEST-BYTE 37 #01 #f8 EQUk ADD ADD [ #f9 ] TEST-BYTE 38 MODE 39 #f801 #f801 EQU2k #00 ADD2 ADD2 [ #f102 ] TEST-SHORT 40 #01f8 #01f8 EQU2k #00 ADD2 ADD2 [ #04f0 ] TEST-SHORT 41 #f801 #01f8 EQU2k #00 ADD2 ADD2 [ #f9f9 ] TEST-SHORT 42 #01f8 #f801 EQU2k #00 ADD2 ADD2 [ #f9f9 ] TEST-SHORT 43 OPCODE 44 45 ( NEQ ) 46 #f8 #f8 NEQ [ #00 ] TEST-BYTE 47 #01 #01 NEQ [ #00 ] TEST-BYTE 48 #f8 #01 NEQ [ #01 ] TEST-BYTE 49 #01 #f8 NEQ [ #01 ] TEST-BYTE 50 MODE 51 #f801 #f801 NEQ2 [ #00 ] TEST-BYTE 52 #01f8 #01f8 NEQ2 [ #00 ] TEST-BYTE 53 #f801 #01f8 NEQ2 [ #01 ] TEST-BYTE 54 #01f8 #f801 NEQ2 [ #01 ] TEST-BYTE 55 MODE 56 #f8 #f8 NEQk ADD ADD [ #f0 ] TEST-BYTE 57 #01 #01 NEQk ADD ADD [ #02 ] TEST-BYTE 58 #f8 #01 NEQk ADD ADD [ #fa ] TEST-BYTE 59 #01 #f8 NEQk ADD ADD [ #fa ] TEST-BYTE 60 MODE 61 #f801 #f801 NEQ2k #00 ADD2 ADD2 [ #f002 ] TEST-SHORT 62 #01f8 #01f8 NEQ2k #00 ADD2 ADD2 [ #03f0 ] TEST-SHORT 63 #f801 #01f8 NEQ2k #00 ADD2 ADD2 [ #faf9 ] TEST-SHORT 64 #01f8 #f801 NEQ2k #00 ADD2 ADD2 [ #faf9 ] TEST-SHORT 65 OPCODE 66 67 ( GTH ) 68 #f8 #f8 GTH [ #00 ] TEST-BYTE 69 #01 #01 GTH [ #00 ] TEST-BYTE 70 #f8 #01 GTH [ #01 ] TEST-BYTE 71 #01 #f8 GTH [ #00 ] TEST-BYTE 72 MODE 73 #f801 #f801 GTH2 [ #00 ] TEST-BYTE 74 #01f8 #01f8 GTH2 [ #00 ] TEST-BYTE 75 #f801 #01f8 GTH2 [ #01 ] TEST-BYTE 76 #01f8 #f801 GTH2 [ #00 ] TEST-BYTE 77 MODE 78 #f8 #f8 GTHk ADD ADD [ #f0 ] TEST-BYTE 79 #01 #01 GTHk ADD ADD [ #02 ] TEST-BYTE 80 #f8 #01 GTHk ADD ADD [ #fa ] TEST-BYTE 81 #01 #f8 GTHk ADD ADD [ #f9 ] TEST-BYTE 82 MODE 83 #f801 #f801 GTH2k #00 ADD2 ADD2 [ #f002 ] TEST-SHORT 84 #01f8 #01f8 GTH2k #00 ADD2 ADD2 [ #03f0 ] TEST-SHORT 85 #f801 #01f8 GTH2k #00 ADD2 ADD2 [ #faf9 ] TEST-SHORT 86 #01f8 #f801 GTH2k #00 ADD2 ADD2 [ #f9f9 ] TEST-SHORT 87 OPCODE 88 89 ( LTH ) 90 #f8 #f8 LTH [ #00 ] TEST-BYTE 91 #01 #01 LTH [ #00 ] TEST-BYTE 92 #f8 #01 LTH [ #00 ] TEST-BYTE 93 #01 #f8 LTH [ #01 ] TEST-BYTE 94 MODE 95 #f801 #f801 LTH2 [ #00 ] TEST-BYTE 96 #01f8 #01f8 LTH2 [ #00 ] TEST-BYTE 97 #f801 #01f8 LTH2 [ #00 ] TEST-BYTE 98 #01f8 #f801 LTH2 [ #01 ] TEST-BYTE 99 MODE 100 #f8 #f8 LTHk ADD ADD [ #f0 ] TEST-BYTE 101 #01 #01 LTHk ADD ADD [ #02 ] TEST-BYTE 102 #f8 #01 LTHk ADD ADD [ #f9 ] TEST-BYTE 103 #01 #f8 LTHk ADD ADD [ #fa ] TEST-BYTE 104 MODE 105 #f801 #f801 LTH2k #00 ADD2 ADD2 [ #f002 ] TEST-SHORT 106 #01f8 #01f8 LTH2k #00 ADD2 ADD2 [ #03f0 ] TEST-SHORT 107 #f801 #01f8 LTH2k #00 ADD2 ADD2 [ #f9f9 ] TEST-SHORT 108 #01f8 #f801 LTH2k #00 ADD2 ADD2 [ #faf9 ] TEST-SHORT 109 TYPE 110 111 ( Arithmetic ) 112 113 ( ADD ) 114 #ff #00 ADD [ #ff ] TEST-BYTE 115 #01 #ff ADD [ #00 ] TEST-BYTE 116 #ff #ff ADD [ #fe ] TEST-BYTE 117 #fe #ff ADD [ #fd ] TEST-BYTE 118 MODE 119 #ffff #0000 ADD2 [ #ffff ] TEST-SHORT 120 #0001 #ffff ADD2 [ #0000 ] TEST-SHORT 121 #ffff #ffff ADD2 [ #fffe ] TEST-SHORT 122 #fffe #ffff ADD2 [ #fffd ] TEST-SHORT 123 MODE 124 #ff #00 ADDk ADD ADD [ #fe ] TEST-BYTE 125 #01 #ff ADDk ADD ADD [ #00 ] TEST-BYTE 126 #ff #ff ADDk ADD ADD [ #fc ] TEST-BYTE 127 #fe #ff ADDk ADD ADD [ #fa ] TEST-BYTE 128 MODE 129 #ffff #0000 ADD2k ADD2 ADD2 [ #fffe ] TEST-SHORT 130 #0001 #ffff ADD2k ADD2 ADD2 [ #0000 ] TEST-SHORT 131 #ffff #ffff ADD2k ADD2 ADD2 [ #fffc ] TEST-SHORT 132 #fffe #ffff ADD2k ADD2 ADD2 [ #fffa ] TEST-SHORT 133 OPCODE 134 135 ( SUB ) 136 #ff #00 SUB [ #ff ] TEST-BYTE 137 #01 #ff SUB [ #02 ] TEST-BYTE 138 #ff #ff SUB [ #00 ] TEST-BYTE 139 #fe #ff SUB [ #ff ] TEST-BYTE 140 MODE 141 #ffff #0000 SUB2 [ #ffff ] TEST-SHORT 142 #0001 #ffff SUB2 [ #0002 ] TEST-SHORT 143 #ffff #ffff SUB2 [ #0000 ] TEST-SHORT 144 #fffe #ffff SUB2 [ #ffff ] TEST-SHORT 145 MODE 146 #ff #00 SUBk ADD ADD [ #fe ] TEST-BYTE 147 #01 #ff SUBk ADD ADD [ #02 ] TEST-BYTE 148 #ff #ff SUBk ADD ADD [ #fe ] TEST-BYTE 149 #fe #ff SUBk ADD ADD [ #fc ] TEST-BYTE 150 MODE 151 #ffff #0000 SUB2k ADD2 ADD2 [ #fffe ] TEST-SHORT 152 #0001 #ffff SUB2k ADD2 ADD2 [ #0002 ] TEST-SHORT 153 #ffff #ffff SUB2k ADD2 ADD2 [ #fffe ] TEST-SHORT 154 #fffe #ffff SUB2k ADD2 ADD2 [ #fffc ] TEST-SHORT 155 OPCODE 156 157 ( MUL ) 158 #00 #01 MUL [ #00 ] TEST-BYTE 159 #3f #e7 MUL [ #d9 ] TEST-BYTE 160 #37 #3f MUL [ #89 ] TEST-BYTE 161 #10 #02 MUL [ #20 ] TEST-BYTE 162 MODE 163 #1000 #0003 MUL2 [ #3000 ] TEST-SHORT 164 #abcd #1234 MUL2 [ #4fa4 ] TEST-SHORT 165 #8000 #0200 MUL2 [ #0000 ] TEST-SHORT 166 #2222 #0003 MUL2 [ #6666 ] TEST-SHORT 167 MODE 168 #00 #01 MULk ADD ADD [ #01 ] TEST-BYTE 169 #3f #e7 MULk ADD ADD [ #ff ] TEST-BYTE 170 #37 #3f MULk ADD ADD [ #ff ] TEST-BYTE 171 #10 #02 MULk ADD ADD [ #32 ] TEST-BYTE 172 MODE 173 #1000 #0003 MUL2k ADD2 ADD2 [ #4003 ] TEST-SHORT 174 #abcd #1234 MUL2k ADD2 ADD2 [ #0da5 ] TEST-SHORT 175 #8000 #0200 MUL2k ADD2 ADD2 [ #8200 ] TEST-SHORT 176 #2222 #0003 MUL2k ADD2 ADD2 [ #888b ] TEST-SHORT 177 OPCODE 178 179 ( DIV ) 180 #10 #02 DIV [ #08 ] TEST-BYTE 181 #20 #20 DIV [ #01 ] TEST-BYTE 182 #34 #01 DIV [ #34 ] TEST-BYTE 183 #02 #ef DIV [ #00 ] TEST-BYTE 184 MODE 185 #1000 #0040 DIV2 [ #0040 ] TEST-SHORT 186 #abcd #1234 DIV2 [ #0009 ] TEST-SHORT 187 #8000 #0200 DIV2 [ #0040 ] TEST-SHORT 188 #2222 #0003 DIV2 [ #0b60 ] TEST-SHORT 189 MODE 190 #10 #02 DIVk ADD ADD [ #1a ] TEST-BYTE 191 #20 #20 DIVk ADD ADD [ #41 ] TEST-BYTE 192 #34 #01 DIVk ADD ADD [ #69 ] TEST-BYTE 193 #02 #ef DIVk ADD ADD [ #f1 ] TEST-BYTE 194 MODE 195 #1000 #0040 DIV2k ADD2 ADD2 [ #1080 ] TEST-SHORT 196 #abcd #1234 DIV2k ADD2 ADD2 [ #be0a ] TEST-SHORT 197 #8000 #0200 DIV2k ADD2 ADD2 [ #8240 ] TEST-SHORT 198 #2222 #0003 DIV2k ADD2 ADD2 [ #2d85 ] TEST-SHORT 199 TYPE 200 201 ( Stack ) 202 203 ( INC ) 204 #01 INC [ #02 ] TEST-BYTE 205 #ff INC [ #00 ] TEST-BYTE 206 #fe INC [ #ff ] TEST-BYTE 207 #00 INC [ #01 ] TEST-BYTE 208 MODE 209 #0001 INC2 [ #0002 ] TEST-SHORT 210 #ffff INC2 [ #0000 ] TEST-SHORT 211 #fffe INC2 [ #ffff ] TEST-SHORT 212 #0000 INC2 [ #0001 ] TEST-SHORT 213 MODE 214 #01 INCk ADD [ #03 ] TEST-BYTE 215 #ff INCk ADD [ #ff ] TEST-BYTE 216 #fe INCk ADD [ #fd ] TEST-BYTE 217 #00 INCk ADD [ #01 ] TEST-BYTE 218 MODE 219 #0001 INC2k ADD2 [ #0003 ] TEST-SHORT 220 #ffff INC2k ADD2 [ #ffff ] TEST-SHORT 221 #fffe INC2k ADD2 [ #fffd ] TEST-SHORT 222 #0000 INC2k ADD2 [ #0001 ] TEST-SHORT 223 OPCODE 224 225 ( POP ) 226 #0a #0b POP [ #0a ] TEST-BYTE 227 #0a #0b #0c POP POP [ #0a ] TEST-BYTE 228 #0a #0b #0c ADD POP [ #0a ] TEST-BYTE 229 #0a #0b #0c POP ADD [ #15 ] TEST-BYTE 230 MODE 231 #0a0b #0c0d POP2 [ #0a0b ] TEST-SHORT 232 #0a0b #0c0d #0e0f POP2 POP2 [ #0a0b ] TEST-SHORT 233 #0a0b #0c0d #0e0f ADD2 POP2 [ #0a0b ] TEST-SHORT 234 #0a0b #0c0d #0e0f POP2 ADD2 [ #1618 ] TEST-SHORT 235 MODE 236 #0a #0b POPk [ #0b ] TEST-BYTE POP 237 #0a #0b #0c POPk POP [ #0b ] TEST-BYTE POP 238 #0a #0b #0c ADD POPk [ #17 ] TEST-BYTE POP 239 #0a #0b #0c POPk ADD [ #17 ] TEST-BYTE POP 240 MODE 241 #0a0b #0c0d POP2k [ #0c0d ] TEST-SHORT POP2 242 #0a0b #0c0d #0e0f POP2k POP2 [ #0c0d ] TEST-SHORT POP2 243 #0a0b #0c0d #0e0f ADD2 POP2k [ #1a1c ] TEST-SHORT POP2 244 #0a0b #0c0d #0e0f POP2k ADD2 [ #1a1c ] TEST-SHORT POP2 245 OPCODE 246 247 ( DUP ) 248 #0a #0b DUP ADD ADD [ #20 ] TEST-BYTE 249 MODE 250 #0a0b DUP2 ADD2 [ #1416 ] TEST-SHORT 251 MODE 252 #0a #0b DUPk ADD ADD ADD [ #2b ] TEST-BYTE 253 MODE 254 #0a0b DUP2k ADD2 ADD2 [ #1e21 ] TEST-SHORT 255 OPCODE 256 257 ( NIP ) 258 #12 #34 #56 NIP ADD [ #68 ] TEST-BYTE 259 MODE 260 #1234 #5678 #9abc NIP2 ADD2 [ #acf0 ] TEST-SHORT 261 MODE 262 #12 #34 #56 NIPk ADD ADD [ #e0 ] TEST-BYTE POP 263 MODE 264 #1234 #5678 #9abc NIP2k ADD2 ADD2 [ #8bf0 ] TEST-SHORT POP2 265 OPCODE 266 267 ( SWP ) 268 #02 #10 SWP DIV [ #08 ] TEST-BYTE 269 MODE 270 #0a0b #0c0d SWP2 NIP2 [ #0a0b ] TEST-SHORT 271 MODE 272 #02 #10 SWPk DIV ADD ADD [ #1a ] TEST-BYTE 273 MODE 274 #0a0b #0c0d SWP2k POP2 POP2 POP2 [ #0a0b ] TEST-SHORT 275 OPCODE 276 277 ( OVR ) 278 #02 #10 OVR DIV ADD [ #0a ] TEST-BYTE 279 MODE 280 #0a0b #0c0d OVR2 NIP2 ADD2 [ #1416 ] TEST-SHORT 281 MODE 282 #02 #10 OVRk DIV ADD ADD ADD [ #1c ] TEST-BYTE 283 MODE 284 #0a0b #0c0d OVR2k NIP2 ADD2 ADD2 ADD2 [ #2a2e ] TEST-SHORT 285 OPCODE 286 287 ( ROT ) 288 #02 #04 #10 ROT DIV ADD [ #0c ] TEST-BYTE 289 MODE 290 #0a0b #0c0d #0c0f ROT2 ADD2 NIP2 [ #161a ] TEST-SHORT 291 MODE 292 #02 #04 #10 ROTk DIV ADD ADD ADD ADD [ #22 ] TEST-BYTE 293 MODE 294 #0a0b #0c0d #0c0f ROT2k ADD2 NIP2 ADD2 ADD2 ADD2 [ #3841 ] TEST-SHORT 295 TYPE 296 297 ( Bitwise ) 298 299 ( AND ) 300 #fc #3f AND [ #3c ] TEST-BYTE 301 #f0 #0f AND [ #00 ] TEST-BYTE 302 #ff #3c AND [ #3c ] TEST-BYTE 303 #02 #03 AND [ #02 ] TEST-BYTE 304 MODE 305 #f0f0 #00f0 AND2 [ #00f0 ] TEST-SHORT 306 #aaaa #5555 AND2 [ #0000 ] TEST-SHORT 307 #ffff #1234 AND2 [ #1234 ] TEST-SHORT 308 #abcd #0a0c AND2 [ #0a0c ] TEST-SHORT 309 MODE 310 #fc #3f ANDk ADD ADD [ #77 ] TEST-BYTE 311 #f0 #0f ANDk ADD ADD [ #ff ] TEST-BYTE 312 #ff #3c ANDk ADD ADD [ #77 ] TEST-BYTE 313 #02 #03 ANDk ADD ADD [ #07 ] TEST-BYTE 314 MODE 315 #f0f0 #00f0 AND2k ADD2 ADD2 [ #f2d0 ] TEST-SHORT 316 #aaaa #5555 AND2k ADD2 ADD2 [ #ffff ] TEST-SHORT 317 #ffff #1234 AND2k ADD2 ADD2 [ #2467 ] TEST-SHORT 318 #abcd #0a0c AND2k ADD2 ADD2 [ #bfe5 ] TEST-SHORT 319 OPCODE 320 321 ( ORA ) 322 #0f #f0 ORA [ #ff ] TEST-BYTE 323 #ab #cd ORA [ #ef ] TEST-BYTE 324 #12 #34 ORA [ #36 ] TEST-BYTE 325 #88 #10 ORA [ #98 ] TEST-BYTE 326 MODE 327 #0f0f #f0f0 ORA2 [ #ffff ] TEST-SHORT 328 #abab #cdcd ORA2 [ #efef ] TEST-SHORT 329 #1122 #1234 ORA2 [ #1336 ] TEST-SHORT 330 #8888 #1000 ORA2 [ #9888 ] TEST-SHORT 331 MODE 332 #0f #f0 ORAk ADD ADD [ #fe ] TEST-BYTE 333 #ab #cd ORAk ADD ADD [ #67 ] TEST-BYTE 334 #12 #34 ORAk ADD ADD [ #7c ] TEST-BYTE 335 #88 #10 ORAk ADD ADD [ #30 ] TEST-BYTE 336 MODE 337 #0f0f #f0f0 ORA2k ADD2 ADD2 [ #fffe ] TEST-SHORT 338 #abab #cdcd ORA2k ADD2 ADD2 [ #6967 ] TEST-SHORT 339 #1122 #1234 ORA2k ADD2 ADD2 [ #368c ] TEST-SHORT 340 #8888 #1000 ORA2k ADD2 ADD2 [ #3110 ] TEST-SHORT 341 OPCODE 342 343 ( EOR ) 344 #00 #00 EOR [ #00 ] TEST-BYTE 345 #ff #00 EOR [ #ff ] TEST-BYTE 346 #aa #55 EOR [ #ff ] TEST-BYTE 347 #ff #ff EOR [ #00 ] TEST-BYTE 348 MODE 349 #ffff #ff00 EOR2 [ #00ff ] TEST-SHORT 350 #aaaa #5555 EOR2 [ #ffff ] TEST-SHORT 351 #1122 #1234 EOR2 [ #0316 ] TEST-SHORT 352 #8888 #1000 EOR2 [ #9888 ] TEST-SHORT 353 MODE 354 #00 #00 EORk ADD ADD [ #00 ] TEST-BYTE 355 #ff #00 EORk ADD ADD [ #fe ] TEST-BYTE 356 #aa #55 EORk ADD ADD [ #fe ] TEST-BYTE 357 #ff #ff EORk ADD ADD [ #fe ] TEST-BYTE 358 MODE 359 #ffff #ff00 EOR2k ADD2 ADD2 [ #fffe ] TEST-SHORT 360 #aaaa #5555 EOR2k ADD2 ADD2 [ #fffe ] TEST-SHORT 361 #1122 #1234 EOR2k ADD2 ADD2 [ #266c ] TEST-SHORT 362 #8888 #1000 EOR2k ADD2 ADD2 [ #3110 ] TEST-SHORT 363 OPCODE 364 365 ( SFT ) 366 #ff #08 SFT [ #00 ] TEST-BYTE 367 #ff #e0 SFT [ #00 ] TEST-BYTE 368 #ff #11 SFT [ #fe ] TEST-BYTE 369 #ff #12 SFT [ #7e ] TEST-BYTE 370 MODE 371 #ffff #01 SFT2 [ #7fff ] TEST-SHORT 372 #ffff #70 SFT2 [ #ff80 ] TEST-SHORT 373 #ffff #7e SFT2 [ #0180 ] TEST-SHORT 374 #ffff #e3 SFT2 [ #c000 ] TEST-SHORT 375 MODE 376 #ff #08 SFTk ADD ADD [ #07 ] TEST-BYTE 377 #ff #e0 SFTk ADD ADD [ #df ] TEST-BYTE 378 #ff #11 SFTk ADD ADD [ #0e ] TEST-BYTE 379 #ff #12 SFTk ADD ADD [ #8f ] TEST-BYTE 380 MODE 381 #ffff #01 SFT2k ROT POP ADD2 [ #7ffe ] TEST-SHORT 382 #ffff #70 SFT2k ROT POP ADD2 [ #ff7f ] TEST-SHORT 383 #ffff #7e SFT2k ROT POP ADD2 [ #017f ] TEST-SHORT 384 #ffff #e3 SFT2k ROT POP ADD2 [ #bfff ] TEST-SHORT 385 TYPE 386 387 ( Memory ) 388 389 ( STZ/LDZ ) 390 #ab .zeropage/byte STZ .zeropage/byte LDZ [ #ab ] TEST-BYTE 391 #cd .zeropage/byte STZ .zeropage/byte LDZ [ #cd ] TEST-BYTE 392 MODE 393 #1234 .zeropage/short STZ2 .zeropage/short LDZ2 [ #1234 ] TEST-SHORT 394 #5678 .zeropage/short STZ2 .zeropage/short LDZ2 [ #5678 ] TEST-SHORT 395 OPCODE 396 397 ( STR/LDR ) 398 [ LIT &before1 $1 ] POP 399 [ LIT2 &before2 $2 ] POP2 400 #22 ,&before1 STR ,&before1 LDR [ #22 ] TEST-BYTE 401 #ef ,&after1 STR ,&after1 LDR [ #ef ] TEST-BYTE 402 MODE 403 #1234 ,&before2 STR2 ,&before2 LDR2 [ #1234 ] TEST-SHORT 404 #5678 ,&after2 STR2 ,&after2 LDR2 [ #5678 ] TEST-SHORT 405 [ LIT &after1 $1 ] POP 406 [ LIT2 &after2 $2 ] POP2 407 OPCODE 408 409 ( STA/LDA ) 410 #34 ;absolute/byte STA ;absolute/byte LDA [ #34 ] TEST-BYTE 411 #56 ;absolute/byte STA ;absolute/byte LDA [ #56 ] TEST-BYTE 412 MODE 413 #1234 ;absolute/short STA2 ;absolute/short LDA2 [ #1234 ] TEST-SHORT 414 #5678 ;absolute/short STA2 ;absolute/short LDA2 [ #5678 ] TEST-SHORT 415 OPCODE 416 417 ( DEI/DEO ) 418 LIT "1 EMIT 419 LIT "1 EMIT 420 TYPE 421 422 ( Branching ) 423 424 ( JMP ) 425 #12 #34 ,&reljmp JMP SWP &reljmp POP [ #12 ] TEST-BYTE 426 MODE 427 #56 #78 ;&absjmp JMP2 SWP &absjmp POP [ #56 ] TEST-BYTE 428 OPCODE 429 430 ( JCN ) 431 #23 #01 ,&reljcn-y JCN INC &reljcn-y [ #23 ] TEST-BYTE 432 #23 #00 ,&reljcn-n JCN INC &reljcn-n [ #24 ] TEST-BYTE 433 MODE 434 #23 #01 ;&absjcn-y JCN2 INC &absjcn-y [ #23 ] TEST-BYTE 435 #23 #00 ;&absjcn-n JCN2 INC &absjcn-n [ #24 ] TEST-BYTE 436 OPCODE 437 438 ( JSR - Requires return mode ) 439 #12 #34 ;routine JSR2 [ #46 ] TEST-BYTE 440 OPCODE 441 442 ( STH ) 443 #0a STH #0b STH ADDr STHr [ #15 ] TEST-BYTE 444 MODE 445 #000a STH2 #000b STH2 ADD2r STH2r [ #0015 ] TEST-SHORT 446 TYPE 447 448 ( Keep ) 449 #12 #34 ADDk ADD ADD [ #8c ] TEST-BYTE 450 OPCODE 451 452 #010e DEO 453 #010f DEO 454 455 BRK 456 457 @routine ( a b -- c ) 458 459 ADD 460 461 JMP2r 462 463 @absolute 464 &byte $1 &short $2