From f796d233938bb16d136842aa10c92c300a66ebea Mon Sep 17 00:00:00 2001 From: a dinosaur Date: Mon, 1 Apr 2019 16:16:55 +1100 Subject: [PATCH] attempted ca65 conversion --- .gitignore | 3 +++ jca65/Makefile | 24 ++++++++++++++++++++++++ jca65/jimmy.S | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 .gitignore create mode 100644 jca65/Makefile create mode 100644 jca65/jimmy.S diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bf38227 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.prg +obj/ +*.o diff --git a/jca65/Makefile b/jca65/Makefile new file mode 100644 index 0000000..2881ef1 --- /dev/null +++ b/jca65/Makefile @@ -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} diff --git a/jca65/jimmy.S b/jca65/jimmy.S new file mode 100644 index 0000000..843eb76 --- /dev/null +++ b/jca65/jimmy.S @@ -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