2011-08-28 19:35:31 +00:00
|
|
|
; trivial demo program: read input, swap case and write out
|
|
|
|
|
|
|
|
; assemble using Anton Treuenfels' HXA assembler
|
|
|
|
; with I6502.A macro file
|
|
|
|
; HXA_TW.EXE swapcase.asm
|
|
|
|
; (runs on Linux if you have WINE installed)
|
|
|
|
; which will make
|
|
|
|
; SWAPCASE.HEX
|
|
|
|
; where the first line should not be input to the hexloader
|
|
|
|
|
2014-01-31 23:07:27 +00:00
|
|
|
.hexfile
|
2011-08-28 19:35:31 +00:00
|
|
|
|
2014-01-31 23:07:27 +00:00
|
|
|
.cpu T_32_M16
|
|
|
|
.assume BIT32=1032, BIT32R=3210
|
|
|
|
.include "i6502.a"
|
2011-08-28 19:35:31 +00:00
|
|
|
|
2014-01-31 23:07:27 +00:00
|
|
|
; I/O is memory-mapped in py65:
|
|
|
|
PUTC = $f001
|
|
|
|
GETC = $f004
|
2011-08-28 19:35:31 +00:00
|
|
|
|
|
|
|
; the py65 hexload boot ROM will only load to $0200
|
2014-01-31 23:07:27 +00:00
|
|
|
.ORG $200
|
2011-08-28 19:35:31 +00:00
|
|
|
|
2014-01-31 23:07:27 +00:00
|
|
|
another
|
|
|
|
lda GETC
|
|
|
|
beq another
|
|
|
|
eor #$20 ; swap upper and lower case as a demo
|
|
|
|
sta PUTC
|
|
|
|
jmp another
|