aliases for Kernal jump table entries

This commit is contained in:
FeralChild64 committed 2019-07-12 20:08:40 +02:00
1 parent ee6e7bc9d5
commit a846d74895
56 files changed
+120 -38

No files matched your search

+41
View File
@@ -168,6 +168,47 @@
.alias ILOAD $0330 .alias ILOAD $0330
.alias ISAVE $0331 .alias ISAVE $0331
;; Kernal jump table
.alias JCINT $FF81
.alias JIOINIT $FF84
.alias JRAMTAS $FF87
.alias JRESTOR $FF8A
.alias JVECTOR $FF8D
.alias JSETMSG $FF90
.alias JSECOND $FF93
.alias JTKSA $FF96
.alias JMEMTOP $FF99
.alias JMEMBOT $FF9C
.alias JSCNKEY $FF9F
.alias JSETTMO $FFA2
.alias JACPTR $FFA5
.alias JCIOUT $FFA8
.alias JUNTLK $FFAB
.alias JUNLSN $FFAE
.alias JLISTEN $FFB1
.alias JTALK $FFB4
.alias JREADST $FFB7
.alias JSETFLS $FFBA
.alias JSETNAM $FFBD
.alias JOPEN $FFC0
.alias JCLOSE $FFC3
.alias JCHKIN $FFC6
.alias JCHKOUT $FFC9
.alias JCLRCHN $FFCC
.alias JCHRIN $FFCF
.alias JCHROUT $FFD2
.alias JLOAD $FFD5
.alias JSAVE $FFD8
.alias JSETTIM $FFDB
.alias JRDTIM $FFDE
.alias JSTOP $FFE1
.alias JGETIN $FFE4
.alias JCLALL $FFE7
.alias JUDTIM $FFEA
.alias JSCREEN $FFED
.alias JPLOT $FFF0
.alias JIOBASE $FFF3
;; BASIC uses some extra bytes for memory access under ROMs located at $2A7 onwards ;; BASIC uses some extra bytes for memory access under ROMs located at $2A7 onwards
;; IRQs are disabled when doing such accesses, and a default NMI handler only increments ;; IRQs are disabled when doing such accesses, and a default NMI handler only increments
;; a counter, so that if an NMI occurs, it doesn't crash the machine, but can be captured. ;; a counter, so that if an NMI occurs, it doesn't crash the machine, but can be captured.
+1 -1
View File
@@ -20,7 +20,7 @@ print_string_loop:
lda (temp_string_ptr),y lda (temp_string_ptr),y
beq print_string_end beq print_string_end
jsr $FFD2 ; KERNAL CHROUT jsr JCHROUT
txa txa
tay tay
+1 -1
View File
@@ -64,7 +64,7 @@ startup_banner:
jsr print_integer jsr print_integer
lda #$20 lda #$20
jsr $ffd2 jsr JCHROUT
;; Print the rest of the start up message ;; Print the rest of the start up message
ldx #34 ldx #34
+5 -5
View File
@@ -7,9 +7,9 @@ basic_do_error:
;; Print ? at start ;; Print ? at start
lda #$0d lda #$0d
jsr $ffd2 jsr JCHROUT
lda #$3f lda #$3f
jsr $ffd2 jsr JCHROUT
;; Print main part of error message ;; Print main part of error message
pla pla
@@ -18,7 +18,7 @@ basic_do_error:
;; Print ERROR at end ;; Print ERROR at end
lda #$20 lda #$20
jsr $ffd2 jsr JCHROUT
ldx #33 ldx #33
jsr print_packed_message jsr print_packed_message
@@ -27,9 +27,9 @@ basic_do_error:
;; XXX print line number if not in direct mode ;; XXX print line number if not in direct mode
lda #$0d lda #$0d
jsr $ffd2 jsr JCHROUT
lda #$0d lda #$0d
jsr $ffd2 jsr JCHROUT
;; Reset stack, and go back to main loop ;; Reset stack, and go back to main loop
ldx #$fe ldx #$fe
+1 -1
View File
@@ -52,7 +52,7 @@ rsl_l1: lda $0200,x
* *
;; Do printing of the new line ;; Do printing of the new line
lda #$0d lda #$0d
jsr $ffd2 jsr JCHROUT
;; Ignore empty lines ;; Ignore empty lines
lda tokenise_work1 lda tokenise_work1
+1 -1
View File
@@ -17,7 +17,7 @@ basic_do_break:
* *
lda #$0d lda #$0d
jsr $ffd2 jsr JCHROUT
cmd_end: cmd_end:
jmp basic_main_loop jmp basic_main_loop
+4 -4
View File
@@ -36,7 +36,7 @@ list_more_lines:
pla pla
jsr print_integer jsr print_integer
lda #$20 lda #$20
jsr $ffd2 jsr JCHROUT
;; Iterate through printing out the line ;; Iterate through printing out the line
;; contents ;; contents
@@ -105,17 +105,17 @@ list_not_rem:
bne list_print_loop bne list_print_loop
list_is_literal: list_is_literal:
jsr $ffd2 jsr JCHROUT
iny iny
bne list_print_loop bne list_print_loop
list_end_of_line: list_end_of_line:
;; Clear reverse flag ;; Clear reverse flag
lda #$92 lda #$92
jsr $ffd2 jsr JCHROUT
;; Print end of line ;; Print end of line
lda #$0d lda #$0d
jsr $ffd2 jsr JCHROUT
;; Now link to the next line ;; Now link to the next line
jsr basic_find_next_line jsr basic_find_next_line
+2 -2
View File
@@ -18,7 +18,7 @@ cmd_load:
beq + beq +
lda #$00 ; direct mode - don't display anything lda #$00 ; direct mode - don't display anything
* *
jsr $FF90 ; SETMSG jsr JSETMSG
;; XXX temporary, to set valid device number ;; XXX temporary, to set valid device number
lda #$08 lda #$08
@@ -69,7 +69,7 @@ got_filename:
ldx #<$0801 ; LOAD address = $0801 ldx #<$0801 ; LOAD address = $0801
ldy #>$0801 ldy #>$0801
jsr $ffd5 jsr JLOAD
bcc + bcc +
;; A = KERNAL error code, which also almost match ;; A = KERNAL error code, which also almost match
+1 -1
View File
@@ -41,7 +41,7 @@ basic_do_new:
;; (same story), expression value cache? ;; (same story), expression value cache?
sec ; Read, not write value sec ; Read, not write value
jsr $ff99 ; KERNAL MEMTOP routine jsr JMEMTOP
cpx #$80 cpx #$80
beq + beq +
lda #>$f7ff lda #>$f7ff
+2 -2
View File
@@ -58,7 +58,7 @@ hi_loop:
pha pha
ldx #4 ldx #4
clc clc
hi_add_loop: hi_add_loop:
lda $0100,x lda $0100,x
adc number_table_hi,y adc number_table_hi,y
sta $0100,x sta $0100,x
@@ -115,7 +115,7 @@ found_start_of_number:
;; Print digits ;; Print digits
* lda $0100,y * lda $0100,y
ora #$30 ora #$30
jsr $ffd2 jsr JCHROUT
iny iny
cpy #5 cpy #5
bne - bne -
+6 -6
View File
@@ -38,7 +38,7 @@ found_message_in_token_stream:
beq + beq +
jsr print_packed_word jsr print_packed_word
lda #$20 lda #$20
jsr $ffd2 jsr JCHROUT
pla pla
tay tay
iny iny
@@ -47,7 +47,7 @@ found_message_in_token_stream:
pla pla
;; Rub out space at the end ;; Rub out space at the end
lda #$14 lda #$14
jsr $ffd2 jsr JCHROUT
rts rts
print_packed_word: print_packed_word:
@@ -138,13 +138,13 @@ next_packed_word_char:
lsr lsr
tax tax
;; Save Y so it doesn't get clobbered by $FFD2 ;; Save Y so it doesn't get clobbered by CHROUT
tya tya
pha pha
;; X=1-14 = first 14 chars, so subtract one ;; X=1-14 = first 14 chars, so subtract one
lda packed_message_chars-1,x lda packed_message_chars-1,x
jsr $FFD2 jsr JCHROUT
;; See if there is a char in the low nybl to print ;; See if there is a char in the low nybl to print
pla pla
@@ -171,7 +171,7 @@ has_nybl:
;; X=1-14 = first 14 chars, so subtract one ;; X=1-14 = first 14 chars, so subtract one
lda packed_message_chars-1,x lda packed_message_chars-1,x
jsr $FFD2 jsr JCHROUT
* *
pla pla
tay tay
@@ -207,7 +207,7 @@ unpack_literal_char:
tya tya
pha pha
lda (temp_string_ptr),y lda (temp_string_ptr),y
jsr $ffd2 jsr JCHROUT
pla pla
tay tay
rts rts
+3 -3
View File
@@ -112,7 +112,7 @@ not_hexword:
not_pointer: not_pointer:
;; Print character ;; Print character
jsr $ffd2 jsr JCHROUT
printf_nextchar: printf_nextchar:
jsr printf_advance jsr printf_advance
@@ -148,11 +148,11 @@ printf_printhexbyte:
cmp #$3A cmp #$3A
bcc + bcc +
adc #6 adc #6
* jsr $ffd2 * jsr JCHROUT
pla pla
and #$0f and #$0f
ora #$30 ora #$30
cmp #$3A cmp #$3A
bcc + bcc +
adc #6 adc #6
* jmp $ffd2 * jmp JCHROUT
+1 -1
View File
@@ -17,7 +17,7 @@ wedge_dos:
;; Set remaining file parameters; channel 15 is a typical one for commands ;; Set remaining file parameters; channel 15 is a typical one for commands
lda #$0F lda #$0F
ldy #$0F ldy #$0F
jsr $FFBA ; SETLFS jsr JSETFLS
;; Now we have to check what the user wants us to do ;; Now we have to check what the user wants us to do
+41
View File
@@ -108,6 +108,47 @@
.alias ILOAD $0330 .alias ILOAD $0330
.alias ISAVE $0331 .alias ISAVE $0331
;; Kernal jump table
.alias JCINT $FF81
.alias JIOINIT $FF84
.alias JRAMTAS $FF87
.alias JRESTOR $FF8A
.alias JVECTOR $FF8D
.alias JSETMSG $FF90
.alias JSECOND $FF93
.alias JTKSA $FF96
.alias JMEMTOP $FF99
.alias JMEMBOT $FF9C
.alias JSCNKEY $FF9F
.alias JSETTMO $FFA2
.alias JACPTR $FFA5
.alias JCIOUT $FFA8
.alias JUNTLK $FFAB
.alias JUNLSN $FFAE
.alias JLISTEN $FFB1
.alias JTALK $FFB4
.alias JREADST $FFB7
.alias JSETFLS $FFBA
.alias JSETNAM $FFBD
.alias JOPEN $FFC0
.alias JCLOSE $FFC3
.alias JCHKIN $FFC6
.alias JCHKOUT $FFC9
.alias JCLRCHN $FFCC
.alias JCHRIN $FFCF
.alias JCHROUT $FFD2
.alias JLOAD $FFD5
.alias JSAVE $FFD8
.alias JSETTIM $FFDB
.alias JRDTIM $FFDE
.alias JSTOP $FFE1
.alias JGETIN $FFE4
.alias JCLALL $FFE7
.alias JUDTIM $FFEA
.alias JSCREEN $FFED
.alias JPLOT $FFF0
.alias JIOBASE $FFF3
;; Under-ROM routines ;; Under-ROM routines
;; (BASIC also includes them. XXX - We should de-duplicate them in a safe manner) ;; (BASIC also includes them. XXX - We should de-duplicate them in a safe manner)
.alias missed_nmi_flag $2A7 .alias missed_nmi_flag $2A7
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,3 @@
; Set logical, first and second addresses ; Set logical, first and second addresses
; C64 Programmer's Reference Guide Page 273 ; C64 Programmer's Reference Guide Page 273
jmp setlfs jmp setfls
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -3,7 +3,7 @@
; (http://codebase64.org/doku.php?id=base:kernalreference) ; (http://codebase64.org/doku.php?id=base:kernalreference)
; ;
; As there is nothing between here and $FFFA, we can just hard code this in place. ; As there is nothing between here and $FFFA, we can just hard code this in place.
LDY #$DC ldy #$DC
LDX #$00 ldx #$00
RTS rts
+2 -2
View File
@@ -44,12 +44,12 @@ print_filename_loop:
beq + beq +
ldx #<current_filename_ptr ldx #<current_filename_ptr
jsr peek_under_roms jsr peek_under_roms
jsr $ffd2 jsr JCHROUT
iny iny
jmp print_filename_loop jmp print_filename_loop
* *
lda #$0d lda #$0d
jsr $ffd2 jsr JCHROUT
;; XXX - Use default device number ;; XXX - Use default device number
;; http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf ;; http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
+3 -3
View File
@@ -112,7 +112,7 @@ not_hexword:
not_pointer: not_pointer:
;; Print character ;; Print character
jsr $ffd2 jsr JCHROUT
printf_nextchar: printf_nextchar:
jsr printf_advance jsr printf_advance
@@ -148,11 +148,11 @@ printf_printhexbyte:
cmp #$3A cmp #$3A
bcc + bcc +
adc #6 adc #6
* jsr $ffd2 * jsr JCHROUT
pla pla
and #$0f and #$0f
ora #$30 ora #$30
cmp #$3A cmp #$3A
bcc + bcc +
adc #6 adc #6
* jmp $ffd2 * jmp JCHROUT
+1 -1
View File
@@ -1,6 +1,6 @@
; Function defined on pp272-273 of C64 Programmers Reference Guide ; Function defined on pp272-273 of C64 Programmers Reference Guide
setlfs: setfls:
;; There are 6 sane ways to implement this routine, ;; There are 6 sane ways to implement this routine,
;; I hope this one won't cause similarity to CBM code ;; I hope this one won't cause similarity to CBM code