49 lines
706 B
Plaintext
49 lines
706 B
Plaintext
.ifndef __MACROS_H__
|
|
__MACROS_H__ = 1
|
|
|
|
.macro puts string
|
|
.scope
|
|
.pushseg
|
|
.rodata
|
|
text: .asciiz string
|
|
.popseg
|
|
pha
|
|
phy
|
|
lda #>text
|
|
ldy #<text
|
|
jsr write_buffer
|
|
ply
|
|
pla
|
|
.endscope
|
|
.endmacro
|
|
|
|
.macro putsln string
|
|
.scope
|
|
.pushseg
|
|
.rodata
|
|
text: .asciiz string
|
|
.popseg
|
|
pha
|
|
phy
|
|
lda #>text
|
|
ldy #<text
|
|
jsr write_bufferln
|
|
ply
|
|
pla
|
|
.endscope
|
|
.endmacro
|
|
|
|
|
|
;;;;;;;; stolen from
|
|
;;;;;;;; http://www.grappendorf.net/projects/6502-home-computer/
|
|
;;;;;;;;
|
|
|
|
; Load zero page register reg/reg+1 with the 16-bit value, destroys A
|
|
.macro ld16 reg, value
|
|
lda #<(value)
|
|
sta reg
|
|
lda #>(value)
|
|
sta reg + 1
|
|
.endmacro
|
|
|
|
.endif |