2019-01-09 02:36:52 +00:00
|
|
|
|
|
|
|
.include "apple2.inc"
|
2021-03-07 23:29:51 +00:00
|
|
|
.include "more_apple2.inc"
|
2021-04-17 16:58:22 +00:00
|
|
|
.include "prodos.inc"
|
2019-01-09 02:36:52 +00:00
|
|
|
|
|
|
|
.org $4000
|
|
|
|
|
|
|
|
jsr CROUT
|
2019-01-10 00:09:58 +00:00
|
|
|
ldx #0
|
2019-01-09 02:36:52 +00:00
|
|
|
|
2021-04-17 16:58:22 +00:00
|
|
|
;; Skip command and any leading spaces
|
|
|
|
ldx XLEN
|
2019-01-10 00:09:58 +00:00
|
|
|
inx
|
2021-04-16 02:47:41 +00:00
|
|
|
jsr SkipSpaces
|
2019-01-09 06:55:06 +00:00
|
|
|
|
|
|
|
;; Echo string
|
2019-01-10 00:09:58 +00:00
|
|
|
: lda INBUF,x
|
2019-01-09 02:36:52 +00:00
|
|
|
jsr COUT
|
2019-01-09 06:55:06 +00:00
|
|
|
cmp #$D | $80
|
2019-01-10 00:09:58 +00:00
|
|
|
beq exit
|
|
|
|
inx
|
|
|
|
jmp :-
|
2019-01-09 02:36:52 +00:00
|
|
|
|
2021-03-07 23:29:51 +00:00
|
|
|
exit: clc
|
|
|
|
rts
|
2019-01-09 02:36:52 +00:00
|
|
|
|
2021-04-16 02:47:41 +00:00
|
|
|
.proc SkipSpaces
|
|
|
|
repeat: lda INBUF,x
|
2019-01-10 00:09:58 +00:00
|
|
|
cmp #' '|$80
|
|
|
|
beq :+
|
|
|
|
rts
|
|
|
|
: inx
|
2021-04-16 02:47:41 +00:00
|
|
|
jmp repeat
|
2019-01-10 00:09:58 +00:00
|
|
|
.endproc
|
2019-01-09 02:36:52 +00:00
|
|
|
|
|
|
|
cmd_length = .strlen("echo")
|