diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 0c63eaa0..4dfdefcd 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -193,12 +193,12 @@ // [!] XXX document $2A7-$2FF usage // BASIC vectors - .label IERROR = $300 // $300-$301 -- NOT IMPLEMENTED -- - .label IMAIN = $302 // $302-$303 -- NOT IMPLEMENTED -- - .label ICRNCH = $304 // $304-$305 -- NOT IMPLEMENTED -- - .label IQPLOP = $306 // $306-$307 -- NOT IMPLEMENTED -- - .label IGONE = $308 // $308-$309 -- NOT IMPLEMENTED -- - .label IEVAL = $30A // $30A-$30B -- NOT IMPLEMENTED -- + .label IERROR = $300 // $300-$301 + .label IMAIN = $302 // $302-$303 + .label ICRNCH = $304 // $304-$305 + .label IQPLOP = $306 // $306-$307 + .label IGONE = $308 // $308-$309 + .label IEVAL = $30A // $30A-$30B .label SAREG = $30C // .A storage, for SYS call .label SXREG = $30D // .X storage, for SYS call diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index 2107d6ca..38d9cefb 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -1,7 +1,15 @@ // BASIC Cold start entry point // Compute's Mapping the 64 p211 -basic_cold_start: +basic_cold_start: + + // Setup vectors at $300 + ldy #$0B +!: + lda basic_vector_defaults, y + sta IERROR, y + dey + bpl !- // Print startup banner jsr printf // XXX don't use printf, keep it for debug purposes only diff --git a/c64/basic/basic_vector_defaults.s b/c64/basic/basic_vector_defaults.s new file mode 100644 index 00000000..5f2f5943 --- /dev/null +++ b/c64/basic/basic_vector_defaults.s @@ -0,0 +1,16 @@ + +// +// Default values for BASIC vectors - described in: +// +// - [RG64] C64 Programmer's Reference Guide - pages 68-70 +// - [CM64] Compute's Mapping the Commodore 64 - page 318 +// + +basic_vector_defaults: + + .word ERROR // IERROR + .word MAIN // IMAIN + .word CHRNCH // ICHRNCH + .word QPLOP // IQPLOP + .word GONE // IGONE + .word EVAL // IEVAL diff --git a/c64/basic/cmd_unimplemented.s b/c64/basic/cmd_unimplemented.s index 67ec4811..ffdffd96 100644 --- a/c64/basic/cmd_unimplemented.s +++ b/c64/basic/cmd_unimplemented.s @@ -1,82 +1,156 @@ +// // Default handler for all not-yet-implemented commands +// +// Note: NOPs are here just to make debugging easier! +// cmd_for: + nop cmd_next: + nop cmd_data: + nop cmd_inputhash: + nop cmd_input: + nop cmd_dim: + nop cmd_read: + nop cmd_let: + nop cmd_if: + nop cmd_restore: + nop cmd_gosub: + nop cmd_return: + nop // $90-$9F + cmd_on: + nop cmd_wait: + nop cmd_save: + nop cmd_verify: + nop cmd_def: + nop cmd_poke: + nop cmd_printhash: + nop cmd_print: + nop cmd_cont: + nop cmd_cmd: + nop cmd_open: - + nop + // $A0-$AF + cmd_close: + nop cmd_get: + nop cmd_tab: + nop cmd_to: + nop cmd_fn: + nop cmd_spc: + nop cmd_then: + nop cmd_not: + nop cmd_step: + nop cmd_plus: + nop cmd_minus: + nop cmd_mult: + nop cmd_div: + nop cmd_exponent: + nop cmd_and: - + nop + // $B0-$BF + cmd_or: + nop cmd_greater: + nop cmd_equal: + nop cmd_less: + nop cmd_sgn: + nop cmd_int: + nop cmd_abs: + nop cmd_usr: + nop cmd_fre: + nop cmd_pos: + nop cmd_sqr: + nop cmd_rnd: + nop cmd_log: + nop cmd_exp: + nop cmd_cos: + nop cmd_sin: - + nop + // $C0-$CF + cmd_tan: + nop cmd_atn: + nop cmd_peek: + nop cmd_len: + nop cmd_str: + nop cmd_val: + nop cmd_asc: + nop cmd_chr: + nop cmd_left: + nop cmd_right: + nop cmd_mid: + nop cmd_go: - + nop + // Undefined tokens + cmd_unimplemented: - jmp do_NOT_IMPLEMENTED_error