diff --git a/c64/basic/ab1e.print_string.s b/c64/basic/ab1e.print_string.s index 83f8d366..0ea252a3 100644 --- a/c64/basic/ab1e.print_string.s +++ b/c64/basic/ab1e.print_string.s @@ -20,7 +20,7 @@ print_string_loop: lda (temp_string_ptr),y beq print_string_end - jsr via_IBSOUT + jsr JCHROUT txa tay diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index 325bd1ed..341e0909 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -29,7 +29,7 @@ startup_banner: jsr print_integer lda #$20 - jsr via_IBSOUT + jsr JCHROUT ;; Print the rest of the start up message ldx #34 diff --git a/c64/basic/basic_do_error.s b/c64/basic/basic_do_error.s index 92d7e46d..731f99c2 100644 --- a/c64/basic/basic_do_error.s +++ b/c64/basic/basic_do_error.s @@ -7,9 +7,9 @@ basic_do_error: ;; Print ? at start lda #$0d - jsr via_IBSOUT + jsr JCHROUT lda #$3f - jsr via_IBSOUT + jsr JCHROUT ;; Print main part of error message pla @@ -18,7 +18,7 @@ basic_do_error: ;; Print ERROR at end lda #$20 - jsr via_IBSOUT + jsr JCHROUT ldx #33 jsr print_packed_message @@ -27,9 +27,9 @@ basic_do_error: ;; XXX print line number if not in direct mode lda #$0d - jsr via_IBSOUT + jsr JCHROUT lda #$0d - jsr via_IBSOUT + jsr JCHROUT ;; Reset stack, and go back to main loop ldx #$fe diff --git a/c64/basic/basic_main_loop.s b/c64/basic/basic_main_loop.s index 2d7afdd6..69e12c9d 100644 --- a/c64/basic/basic_main_loop.s +++ b/c64/basic/basic_main_loop.s @@ -52,7 +52,7 @@ rsl_l1: lda $0200,x * ;; Do printing of the new line lda #$0d - jsr via_IBSOUT + jsr JCHROUT ;; Ignore empty lines lda tokenise_work1 diff --git a/c64/basic/cmd_break.s b/c64/basic/cmd_break.s index 31194132..36128422 100644 --- a/c64/basic/cmd_break.s +++ b/c64/basic/cmd_break.s @@ -17,7 +17,7 @@ basic_do_break: * lda #$0d - jsr via_IBSOUT + jsr JCHROUT cmd_end: jmp basic_main_loop diff --git a/c64/basic/cmd_list.s b/c64/basic/cmd_list.s index a1be1724..72e9edd9 100644 --- a/c64/basic/cmd_list.s +++ b/c64/basic/cmd_list.s @@ -42,7 +42,7 @@ list_single_line: ; entry point needed by DOS wedge pla jsr print_integer lda #$20 - jsr via_IBSOUT + jsr JCHROUT ;; Iterate through printing out the line ;; contents @@ -111,16 +111,16 @@ list_not_rem: bne list_print_loop list_is_literal: - jsr via_IBSOUT + jsr JCHROUT iny bne list_print_loop list_end_of_line: ;; Clear reverse flag lda #$92 - jsr via_IBSOUT + jsr JCHROUT ;; Print end of line lda #$0d - jsr via_IBSOUT + jsr JCHROUT rts diff --git a/c64/basic/cmd_load.s b/c64/basic/cmd_load.s index dc900c54..ac286c6e 100644 --- a/c64/basic/cmd_load.s +++ b/c64/basic/cmd_load.s @@ -191,6 +191,7 @@ end_of_line_search: pla sta basic_current_line_ptr+0 - - jmp basic_relink_loop + +via_ILOAD: + jmp (ILOAD) diff --git a/c64/basic/print_integer.s b/c64/basic/print_integer.s index 7e897243..f5d93fa7 100644 --- a/c64/basic/print_integer.s +++ b/c64/basic/print_integer.s @@ -115,7 +115,7 @@ found_start_of_number: ;; Print digits * lda $0100,y ora #$30 - jsr via_IBSOUT + jsr JCHROUT iny cpy #5 bne - diff --git a/c64/basic/print_packed_message.s b/c64/basic/print_packed_message.s index 7aac0876..006bf70e 100644 --- a/c64/basic/print_packed_message.s +++ b/c64/basic/print_packed_message.s @@ -38,7 +38,7 @@ found_message_in_token_stream: beq + jsr print_packed_word lda #$20 - jsr via_IBSOUT + jsr JCHROUT pla tay iny @@ -47,7 +47,7 @@ found_message_in_token_stream: pla ;; Rub out space at the end lda #$14 - jsr via_IBSOUT + jsr JCHROUT rts print_packed_word: @@ -144,7 +144,7 @@ next_packed_word_char: ;; X=1-14 = first 14 chars, so subtract one lda packed_message_chars-1,x - jsr via_IBSOUT + jsr JCHROUT ;; See if there is a char in the low nybl to print pla @@ -171,7 +171,7 @@ has_nybl: ;; X=1-14 = first 14 chars, so subtract one lda packed_message_chars-1,x - jsr via_IBSOUT + jsr JCHROUT * pla tay @@ -207,7 +207,7 @@ unpack_literal_char: tya pha lda (temp_string_ptr),y - jsr via_IBSOUT + jsr JCHROUT pla tay rts diff --git a/c64/basic/printf.s b/c64/basic/printf.s index 85fa0cf8..ceb4337b 100644 --- a/c64/basic/printf.s +++ b/c64/basic/printf.s @@ -112,7 +112,7 @@ not_hexword: not_pointer: ;; Print character - jsr via_IBSOUT + jsr JCHROUT printf_nextchar: jsr printf_advance @@ -148,11 +148,11 @@ printf_printhexbyte: cmp #$3A bcc + adc #6 -* jsr via_IBSOUT +* jsr JCHROUT pla and #$0f ora #$30 cmp #$3A bcc + adc #6 -* jmp via_IBSOUT +* jmp JCHROUT diff --git a/c64/basic/via_vector.s b/c64/basic/via_vector.s deleted file mode 100644 index 3cfc7480..00000000 --- a/c64/basic/via_vector.s +++ /dev/null @@ -1,42 +0,0 @@ - -;; -;; Helper routines for jumping via vectors, to be used with JSR -;; -;; Note: they are not in the order of low memory vectors, to avoid -;; similarity with the original ROMs - -via_ISAVE: - jmp (ISAVE) - -via_ILOAD: - jmp (ILOAD) - -via_ICLOSE: - jmp (ICLOSE) - -via_IOPEN: - jmp (IOPEN) - -via_ICHKIN: - jmp (ICHKIN) - -via_IBASIN: - jmp (IBASIN) - -via_IGETIN: - jmp (IGETIN) - -via_ICKOUT: - jmp (ICKOUT) - -via_IBSOUT: - jmp (IBSOUT) - -via_ICLRCH: - jmp (ICLRCH) - -via_ICLALL: - jmp (ICLALL) - -via_ISTOP: - jmp (ISTOP) diff --git a/c64/basic/wedge_dos.s b/c64/basic/wedge_dos.s index e147e9fe..ccfffe4d 100644 --- a/c64/basic/wedge_dos.s +++ b/c64/basic/wedge_dos.s @@ -4,7 +4,7 @@ wedge_dos: ;; Close all the channels, so that wedge has full control - jsr via_ICLALL + jsr JCLALL ;; Set file parameters, channel 15 is a typical one for commands jsr select_device ; sets X register @@ -41,11 +41,11 @@ wedge_dos_command: jsr wedge_dos_setnam jsr JSETNAM - jsr via_IOPEN + jsr JOPEN bcs wedge_dos_basic_error ;; Retrieve status, print it if not OK - jsr via_ICLALL + jsr JCLALL jsr wedge_dos_status_get lda BUF+0 cmp #$30 ; '0' @@ -82,12 +82,12 @@ wedge_dos_status_get: ;; Set remaining file parameters, open the channel lda #$00 ; empty file name jsr JSETNAM - jsr via_IOPEN + jsr JOPEN bcs wedge_dos_basic_error ;; Set channel for input ldx #$0F - jsr via_ICHKIN + jsr JCHKIN bcs wedge_dos_basic_error ldy #$00 @@ -98,7 +98,7 @@ wedge_dos_status_get: ;; XXX error in case of status != EOF ;; Print out everything retrieved from the drive bne + - jsr via_IBASIN + jsr JCHRIN bcs wedge_dos_basic_error sta BUF, y iny @@ -118,7 +118,7 @@ wedge_dos_status_print: dey bmi + lda BUF, x - jsr via_IBSOUT + jsr JCHROUT inx bne - * @@ -139,18 +139,18 @@ wedge_dos_directory: jsr wedge_dos_setnam ;; Open the file - jsr via_IOPEN + jsr JOPEN bcs wedge_dos_basic_error ;; Set channel for file reading ldx #$00 - jsr via_ICHKIN + jsr JCHKIN bcs wedge_dos_basic_error ;; Ignore start address (2 first bytes) - XXX check for errors - jsr via_IBASIN + jsr JCHRIN bcs wedge_dos_basic_error - jsr via_IBASIN + jsr JCHRIN bcs wedge_dos_basic_error wedge_dos_directory_line: @@ -159,7 +159,7 @@ wedge_dos_directory_line: ldy #$FF * iny - jsr via_IBASIN + jsr JCHRIN bcs wedge_dos_basic_error sta BUF, y cpy #$50 @@ -199,15 +199,15 @@ wedge_dos_directory_display: ;; FALLTROUGH wedge_dos_clean_exit: - jsr via_ICLALL + jsr JCLALL ;; Print new line lda #$0D - jsr via_IBSOUT + jsr JCHROUT jmp basic_end_of_line wedge_dos_basic_error: pha - jsr via_ICLALL + jsr JCLALL pla tax dex diff --git a/c64/kernal/jumptable/ffc0.jopen.s b/c64/kernal/jumptable/ffc0.jopen.s index 58339e6b..7aafbb7e 100644 --- a/c64/kernal/jumptable/ffc0.jopen.s +++ b/c64/kernal/jumptable/ffc0.jopen.s @@ -1,3 +1,4 @@ ; open a logical file ; C64 Programmer's Reference Guide Page 272 - jmp open +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (IOPEN) diff --git a/c64/kernal/jumptable/ffc3.jclose.s b/c64/kernal/jumptable/ffc3.jclose.s index c4b44418..b59159d3 100644 --- a/c64/kernal/jumptable/ffc3.jclose.s +++ b/c64/kernal/jumptable/ffc3.jclose.s @@ -1,3 +1,4 @@ ; close a specified logical file ; C64 Programmer's Reference Guide Page 272 - jmp close +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ICLOSE) diff --git a/c64/kernal/jumptable/ffc6.jchkin.s b/c64/kernal/jumptable/ffc6.jchkin.s index 842faeb9..da8948c7 100644 --- a/c64/kernal/jumptable/ffc6.jchkin.s +++ b/c64/kernal/jumptable/ffc6.jchkin.s @@ -1,3 +1,4 @@ ; Open channel for input ; C64 Programmer's Reference Guide Page 272 - jmp chkin +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ICHKIN) diff --git a/c64/kernal/jumptable/ffc9.jckout.s b/c64/kernal/jumptable/ffc9.jckout.s index ccfe9a2f..f394d46d 100644 --- a/c64/kernal/jumptable/ffc9.jckout.s +++ b/c64/kernal/jumptable/ffc9.jckout.s @@ -1,3 +1,4 @@ ; Open channel for output ; C64 Programmer's Reference Guide Page 272 - jmp ckout +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ICKOUT) diff --git a/c64/kernal/jumptable/ffcc.jclrchn.s b/c64/kernal/jumptable/ffcc.jclrchn.s index 174f0557..9fb7697c 100644 --- a/c64/kernal/jumptable/ffcc.jclrchn.s +++ b/c64/kernal/jumptable/ffcc.jclrchn.s @@ -1,3 +1,4 @@ ; close input and output channels ; C64 Programmer's Reference Guide Page 272 - jmp clrchn +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ICLRCH) diff --git a/c64/kernal/jumptable/ffcf.jchrin.s b/c64/kernal/jumptable/ffcf.jchrin.s index d2952a23..465ac6b8 100644 --- a/c64/kernal/jumptable/ffcf.jchrin.s +++ b/c64/kernal/jumptable/ffcf.jchrin.s @@ -1,3 +1,4 @@ ; Input character from channel ; C64 Programmer's Reference Guide Page 272 - jmp chrin +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (IBASIN) diff --git a/c64/kernal/jumptable/ffd2.jchrout.s b/c64/kernal/jumptable/ffd2.jchrout.s index 816a6ece..318b26cf 100644 --- a/c64/kernal/jumptable/ffd2.jchrout.s +++ b/c64/kernal/jumptable/ffd2.jchrout.s @@ -1,3 +1,4 @@ ; Output character to channel ; C64 Programmer's Reference Guide Page 272 - jmp chrout +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (IBSOUT) diff --git a/c64/kernal/jumptable/ffe1.jstop.s b/c64/kernal/jumptable/ffe1.jstop.s index c9c13712..e5b6c4ec 100644 --- a/c64/kernal/jumptable/ffe1.jstop.s +++ b/c64/kernal/jumptable/ffe1.jstop.s @@ -1,3 +1,4 @@ ; Scan stop key ; C64 Programmer's Reference Guide Page 273 - jmp stop +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ISTOP) diff --git a/c64/kernal/jumptable/ffe4.jgetin.s b/c64/kernal/jumptable/ffe4.jgetin.s index c1b21dbe..c9f67cf4 100644 --- a/c64/kernal/jumptable/ffe4.jgetin.s +++ b/c64/kernal/jumptable/ffe4.jgetin.s @@ -1,3 +1,4 @@ ; Get character from keyboard queue (keyboard buffer) ; C64 Programmer's Reference Guide Page 272 - jmp getin +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (IGETIN) diff --git a/c64/kernal/jumptable/ffe7.jclall.s b/c64/kernal/jumptable/ffe7.jclall.s index 03e1725f..f5050a8a 100644 --- a/c64/kernal/jumptable/ffe7.jclall.s +++ b/c64/kernal/jumptable/ffe7.jclall.s @@ -1,3 +1,4 @@ ; $FFE7 - Close all files vector ; (http://codebase64.org/doku.php?id=base:kernalreference) - jmp clall +; According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect + jmp (ICLALL) diff --git a/c64/kernal/vector.s b/c64/kernal/vector.s index 5fb49426..9afc2ef8 100644 --- a/c64/kernal/vector.s +++ b/c64/kernal/vector.s @@ -65,24 +65,3 @@ vector_restore: rts .scend - - ;; XXX below we have quite a lot of data... should we decouple them? - -vector_defaults: - .word default_irq_handler ;; CINV - .word $0000 ;; CBINV XXX implement this - .word $0000 ;; NMINV XXX implement this - - .word open ;; IOPEN - .word close ;; ICLOSE - .word chkin ;; ICHKIN - .word ckout ;; ICKOUT - .word clrchn ;; ICLRCH - .word chrin ;; IBASIN - .word chrout ;; IBSOUT - .word stop ;; ISTOP - .word getin ;; IGETIN - .word clall ;; ICLALL - .word $0000 ;; USRCMD XXX implement this - .word load ;; ILOAD - .word save ;; ISAVE diff --git a/strings/036C1C036C b/strings/036C1C036C deleted file mode 100644 index ebb399e0..00000000 --- a/strings/036C1C036C +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($031C) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C1E036C b/strings/036C1E036C deleted file mode 100644 index e6f9e218..00000000 --- a/strings/036C1E036C +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($031E) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C20036C b/strings/036C20036C deleted file mode 100644 index ab5ed572..00000000 --- a/strings/036C20036C +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($0320) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C22036C b/strings/036C22036C deleted file mode 100644 index f05b4581..00000000 --- a/strings/036C22036C +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($0322) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C24036C b/strings/036C24036C deleted file mode 100644 index 4b11242c..00000000 --- a/strings/036C24036C +++ /dev/null @@ -1,3 +0,0 @@ -03 (most likely adddress higher byte) + JMP ($0324) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C2603 b/strings/036C2603 deleted file mode 100644 index 3271b1af..00000000 --- a/strings/036C2603 +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($0326) (via public, documented vector) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/036C2A036C b/strings/036C2A036C deleted file mode 100644 index 552a4b08..00000000 --- a/strings/036C2A036C +++ /dev/null @@ -1,4 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($032A) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. - diff --git a/strings/036C2C03 b/strings/036C2C03 deleted file mode 100644 index 3bf23438..00000000 --- a/strings/036C2C03 +++ /dev/null @@ -1,3 +0,0 @@ -$03 (most likely adddress higher byte) + JMP ($032C) (via public, documented vector) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way. diff --git a/strings/6C1A036C b/strings/6C1A036C deleted file mode 100644 index b2044ce0..00000000 --- a/strings/6C1A036C +++ /dev/null @@ -1,3 +0,0 @@ -JMP ($031A) (via public, documented vector) + JMP (address does not match) - -Code similarity due to Kernal API usage convention. Since 6510 CPU does not have indirect JSR, the only sane possibility to use Kernal API vectors in RAM ($0314-$0333) is to have JMP ($address) hardcoded somewhere. The jump table has intentionally strange order (to avoid code similarity as much as possible), but some small similarities can't be avoided in any reasonable way.