o debug printf is working in asm
This commit is contained in:
parent
ef69ab4ab3
commit
aa649c89ee
@ -27,7 +27,7 @@ optixx.inc: optixx.pcx
|
||||
$(AS) -o $? $@
|
||||
|
||||
$(APP): linkfile $(GFX) $(OBJS) $(GFX)
|
||||
$(LD) -vr linkerfile.prj $@
|
||||
$(LD) -vri linkerfile.prj $@
|
||||
|
||||
clean:
|
||||
rm -vf $(APP) *.prj *.o
|
||||
|
||||
@ -1,30 +1,22 @@
|
||||
.define debug_pointer $0080
|
||||
|
||||
.MACRO printf
|
||||
REP #$38 ; mem/A = 16 bit, X/Y = 16 bit
|
||||
SEP #$20
|
||||
lda.w str_NMI
|
||||
sta.w debug_pointer
|
||||
ldy #0
|
||||
ldy.w #\1 ; load add of the string
|
||||
sty.w debug_pointer ; store address in defined mem area
|
||||
ldy #0 ; zero y
|
||||
jsr do_printf
|
||||
REP #$30 ; mem/A = 16 bit, X/Y = 16 bit
|
||||
SEP #$20
|
||||
|
||||
.ENDM
|
||||
|
||||
|
||||
.define debug_pointer $0000
|
||||
|
||||
|
||||
.BANK 0
|
||||
.ORG 0
|
||||
.SECTION "debug" SEMIFREE
|
||||
|
||||
|
||||
do_printf:
|
||||
lda (debug_pointer),y ; get ascii text data
|
||||
sta $3000
|
||||
lda (debug_pointer),y ; get address of string
|
||||
sta $3000 ; write to MMIO debug reg
|
||||
iny
|
||||
cpy #5
|
||||
cmp #0 ; len 5
|
||||
bne do_printf
|
||||
rts
|
||||
.ENDs
|
||||
|
||||
@ -53,7 +53,14 @@ Start_do:
|
||||
lda #67
|
||||
sta $3000
|
||||
|
||||
printf
|
||||
printf str_COP
|
||||
|
||||
lda #65
|
||||
sta $3000
|
||||
lda #66
|
||||
sta $3000
|
||||
lda #67
|
||||
sta $3000
|
||||
|
||||
Infinity:
|
||||
jmp Infinity ; bwa hahahahaha
|
||||
@ -93,15 +100,15 @@ SetupVideo:
|
||||
|
||||
|
||||
str_COP:
|
||||
.db "COP\n"
|
||||
.db "COP",10,0
|
||||
str_ABORT:
|
||||
.db "ABORT\n"
|
||||
.db "ABORT",10,0
|
||||
str_NMI:
|
||||
.db "NMI\n"
|
||||
.db "NMI",10,0
|
||||
str_RESET:
|
||||
.db "RESET\n"
|
||||
.db "RESET",10,0
|
||||
str_IRQBRK:
|
||||
.db "IRQBRK\n"
|
||||
.db "IRQBRK",10,0
|
||||
|
||||
|
||||
;============================================================================
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user