Add Rpi.Command for Apple II to execute Linux commands

This commit is contained in:
Terence Boldt 2021-03-23 22:20:08 -04:00
parent d0355f627a
commit 89c16d04d2
3 changed files with 67 additions and 0 deletions

63
Apple2/Rpi.Command.asm Normal file
View File

@ -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

BIN
Apple2/Rpi.Command.bin Normal file

Binary file not shown.

View File

@ -16,3 +16,7 @@ DriveFirmware.bin DriveFirmware.bin DriveFirmware.bin DriveFirmware.bin \
> Firmware_27256_EPROM.bin > Firmware_27256_EPROM.bin
rm Slot*.o rm Slot*.o
rm DriveFirmware.bin 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