added PRIMM implementation for easier debugging

This commit is contained in:
FeralChild64 committed 2020-11-30 17:53:25 +01:00
1 parent 17ecb018af
commit 94d0d2176f
6 files changed
+59 -2

No files matched your search

+1
View File
@@ -9,6 +9,7 @@
* enthusi/Onslaught - for his example Turbo Tape 64 compatible loader
* djmips - for fast 8x8 multiplication routine
* Verz - for the integer division routine
* Mike Barry - for his PRIMM implementation
## for documentation
+13
View File
@@ -397,3 +397,16 @@ Not all of them - only these we want to have implemented.
| `$FF80` | revision byte | DONE | |
<br />
### API extensions - MEGA65 build
Not all of them - only these we want to have implemented. Note: this is likely to change in the future!
<br />
| Address | Name | Status | Remarks |
| :-------: | :------- | :------: | :--------------------------------------------------------------------: |
| `$FF7D` | PRIMM | DONE | print immediate, address compatible with C128 and C65 ROMs |
| `$FFF8` | | DONE | reset vector for usage within hypervisor, starts in legacy mode |
<br />
+2 -2
View File
@@ -100,8 +100,8 @@
!addr COLSTORE = $9C ; [!] screen border storage for tape routines
}
!addr MSGFLG = $9D ; bit 6 = error messages, bit 7 = control message
!addr PTR1 = $9E ; for tape support, counter of errorneous bytes
!addr PTR2 = $9F ; for tape support, counter for errorneous bytes correction
!addr PTR1 = $9E ; for tape support, counter of errorneous bytes [!] also used by PRIMM
!addr PTR2 = $9F ; for tape support, counter for errorneous bytes correction [!] also used by PRIMM
!addr TIME = $A0 ; $A0-$A2 jiffy clock
!addr IECPROTO = $A3 ; [!] IEC or pseudo-IEC protocol, >= $80 for unknown; originally named TSFCNT
!addr TBTCNT = $A4 ; temporary variable for tape and IEC, [!] our usage probably differs in details
+1
View File
@@ -18,6 +18,7 @@
;; #ALIAS# clear_screen = KERNAL_0.clear_screen
;; #ALIAS# printf = KERNAL_0.printf
;; #ALIAS# PRIMM = KERNAL_0.PRIMM
;; #ALIAS# plot_set = KERNAL_0.plot_set
;; #ALIAS# print_hex_byte = KERNAL_0.print_hex_byte
+11
View File
@@ -0,0 +1,11 @@
;; #LAYOUT# M65 KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; 'Print immediate' - useful debug routine, present on many CBM machines
; see https://www.pagetable.com/?p=926
JPRIMM:
jmp PRIMM
+31
View File
@@ -0,0 +1,31 @@
;; #LAYOUT# M65 KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; 'Print immediate', original implementation by Mike Barry, adapted to 65CE02
; see http://www.6502.org/source/io/primm.htm
PRIMM:
pla ; get low part of (string address-1)
sta PTR1
pla ; get high part of (string address-1)
sta PTR2
+bra @2
@1:
jsr JCHROUT ; output a string char
@2:
inc PTR1 ; advance the string pointer
bne @3
inc PTR2
@3:
ldy #$00
lda (PTR1), y ; get string char
bne @1 ; output and continue if not NUL
lda PTR2
pha
lda PTR1
pha
rts