attempted ca65 conversion
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*.prg
|
||||
obj/
|
||||
*.o
|
||||
24
jca65/Makefile
Normal file
24
jca65/Makefile
Normal file
@@ -0,0 +1,24 @@
|
||||
TARGET := jimmy.prg
|
||||
SOURCE := jimmy.S
|
||||
OBJDIR := obj
|
||||
|
||||
CC := cl65
|
||||
AS := ca65
|
||||
|
||||
OFILES := $(patsubst %.S, ${OBJDIR}/%.o, ${SOURCE})
|
||||
|
||||
default: all ${TARGET}
|
||||
all: ${TARGET}
|
||||
|
||||
${OBJDIR}:
|
||||
mkdir -p $@
|
||||
|
||||
${OBJDIR}/%.o: %.S | ${OBJDIR}
|
||||
${AS} $< -o $@
|
||||
|
||||
${TARGET}: ${OFILES}
|
||||
${CC} -t none $< -o $@
|
||||
|
||||
clean:
|
||||
rm -rf ${OBJDIR}
|
||||
rm -f ${TARGET}
|
||||
42
jca65/jimmy.S
Normal file
42
jca65/jimmy.S
Normal file
@@ -0,0 +1,42 @@
|
||||
.word $0801 ; prg untz untz
|
||||
|
||||
.org $801 ; basic bootstrap
|
||||
.byte $0c, $08, $0a, $00, $9e, $20
|
||||
.byte $34, $30, $39, $36, $00, $00
|
||||
.byte $00
|
||||
|
||||
.res $1000-*
|
||||
.org $1000 ; actual progrem startshere
|
||||
|
||||
ldx #$08 ; Screen colours
|
||||
stx $d020
|
||||
ldx #$00
|
||||
stx $d021
|
||||
|
||||
jsr $e544 ; clear screen
|
||||
jsr print_string
|
||||
|
||||
loop:
|
||||
lda $dc01 ; Scans the keyboard buffer
|
||||
cmp #$ef ; If user presses Space ($ef) then quit
|
||||
bne loop
|
||||
|
||||
rts
|
||||
|
||||
.proc print_string
|
||||
ldx #$00
|
||||
|
||||
loop:
|
||||
lda message, x
|
||||
|
||||
cmp #$0 ; return on null terminator
|
||||
beq :+
|
||||
|
||||
sta $0428, x
|
||||
inx
|
||||
jmp loop
|
||||
|
||||
: rts
|
||||
.endproc
|
||||
|
||||
message: .byte "welcome to scat os", $00
|
||||
Reference in New Issue
Block a user