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