From 89c16d04d2b1729b98f2abeb868cbd90abb6b83d Mon Sep 17 00:00:00 2001 From: Terence Boldt Date: Tue, 23 Mar 2021 22:20:08 -0400 Subject: [PATCH] Add Rpi.Command for Apple II to execute Linux commands --- Apple2/Rpi.Command.asm | 63 +++++++++++++++++++++++++++++++++++++++++ Apple2/Rpi.Command.bin | Bin 0 -> 86 bytes Apple2/assemble.sh | 4 +++ 3 files changed, 67 insertions(+) create mode 100644 Apple2/Rpi.Command.asm create mode 100644 Apple2/Rpi.Command.bin diff --git a/Apple2/Rpi.Command.asm b/Apple2/Rpi.Command.asm new file mode 100644 index 0000000..3520a31 --- /dev/null +++ b/Apple2/Rpi.Command.asm @@ -0,0 +1,63 @@ +;Translation of code written in mini-assembler on Apple //e +;Currently only works if card is in slot 5 + + .org $1000 + lda $33 + pha + lda #$a4 + sta $33 +GetCommand: + jsr $fd6a + lda $0200 + cmp #$8d ;stop when return found + beq ExitApp + jsr DumpOutput + clc + bcc GetCommand +ExitApp: + pla + sta $33 + lda #$00 + sty $34 + rts + + brk + brk + brk + brk + brk + brk + brk + brk + brk + brk + brk + brk + +DumpOutput: + ldx #$50 + lda #$05 ;send command 5 = exec + jsr $c5aa + ldy #$00 +getInput: + lda $0200,y + cmp #$8d + beq sendNullTerminator + and #$7f + jsr $c5aa + iny + bne getInput +sendNullTerminator: + lda #$00 + jsr $c5aa ;send byte +getOutput: + jsr $c5c8 ;get byte + cmp #$00 + beq endOutput + jsr $fded + clc + bcc getOutput +endOutput: + rts + + diff --git a/Apple2/Rpi.Command.bin b/Apple2/Rpi.Command.bin new file mode 100644 index 0000000000000000000000000000000000000000..ee8f942af35f07e5f9d47ecfeda546627ac8c704 GIT binary patch literal 86 zcmZ2#?6Go5tFc1X-?a=(Cwo7zDQF8wO!$z|YP^!6#Uz0N2`ma&$*QpG=mLhFV3i!2 c^+4W<3m;c90BMC2M^7>Ub-(>9G2wFp06AtMy#N3J literal 0 HcmV?d00001 diff --git a/Apple2/assemble.sh b/Apple2/assemble.sh index 3e72ee2..3b2c383 100755 --- a/Apple2/assemble.sh +++ b/Apple2/assemble.sh @@ -16,3 +16,7 @@ DriveFirmware.bin DriveFirmware.bin DriveFirmware.bin DriveFirmware.bin \ > Firmware_27256_EPROM.bin rm Slot*.o rm DriveFirmware.bin + +ca65 Rpi.Command.asm -o Rpi.Command.o +ld65 Rpi.Command.o -o Rpi.Command.bin -t none +rm Rpi.Command.o