mirror of
https://github.com/a2geek/basic-system-cmd.git
synced 2025-01-14 23:30:18 +00:00
Setting high bit from name, fixed D1/D2, corrected fake move code to move before storing vector.
This commit is contained in:
parent
47b373cb0b
commit
6bc64408d9
42
main.asm
42
main.asm
@ -49,10 +49,21 @@ crout = $fd8e
|
|||||||
prbyte = $fdda
|
prbyte = $fdda
|
||||||
cout = $fded
|
cout = $fded
|
||||||
|
|
||||||
|
; Application stuff:
|
||||||
|
|
||||||
|
buffer = $6800
|
||||||
|
|
||||||
|
|
||||||
.org $2000
|
.org $2000
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
ldy #0
|
||||||
|
: lda _CodeStartAddress,y
|
||||||
|
sta _CodeBeginAddress,y
|
||||||
|
iny
|
||||||
|
cpy #(_CodeEndAddress-_CodeBeginAddress)
|
||||||
|
bne :-
|
||||||
|
|
||||||
lda extrncmd+1
|
lda extrncmd+1
|
||||||
sta nextcmd+1
|
sta nextcmd+1
|
||||||
lda extrncmd
|
lda extrncmd
|
||||||
@ -62,10 +73,13 @@ install:
|
|||||||
sta extrncmd
|
sta extrncmd
|
||||||
lda #<entry
|
lda #<entry
|
||||||
sta extrncmd
|
sta extrncmd
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
_CodeStartAddress:
|
||||||
.org $6000
|
.org $6000
|
||||||
|
|
||||||
|
_CodeBeginAddress:
|
||||||
entry:
|
entry:
|
||||||
ldx #0
|
ldx #0
|
||||||
@again:
|
@again:
|
||||||
@ -138,7 +152,7 @@ cd:
|
|||||||
online:
|
online:
|
||||||
stz sunitnum
|
stz sunitnum
|
||||||
stz sbufadr
|
stz sbufadr
|
||||||
lda #>inbuf
|
lda #>buffer
|
||||||
sta sbufadr+1
|
sta sbufadr+1
|
||||||
lda #$C5 ; ONLINE system command
|
lda #$C5 ; ONLINE system command
|
||||||
jsr gosystem
|
jsr gosystem
|
||||||
@ -150,40 +164,37 @@ online:
|
|||||||
@continue:
|
@continue:
|
||||||
ldx #0
|
ldx #0
|
||||||
@loop:
|
@loop:
|
||||||
lda inbuf,x
|
ldy buffer,x
|
||||||
beq @exit
|
beq @exit
|
||||||
jsr printsd ; Side-effect is to move Acc. to Y-Reg.
|
jsr printsd
|
||||||
tya
|
tya
|
||||||
and #$0f
|
and #$0f
|
||||||
beq @deverr
|
beq @deverr
|
||||||
; pha
|
|
||||||
tay
|
tay
|
||||||
: inx
|
: inx
|
||||||
lda inbuf,x
|
lda buffer,x
|
||||||
|
ora #$80
|
||||||
jsr cout
|
jsr cout
|
||||||
dey
|
dey
|
||||||
bne :-
|
bne :-
|
||||||
; pla
|
|
||||||
; cmp #$0f ; If string length was 15, already at next entry
|
|
||||||
; beq @loop
|
|
||||||
@adjust:
|
@adjust:
|
||||||
jsr crout
|
jsr crout
|
||||||
txa
|
txa
|
||||||
clc
|
clc
|
||||||
adc #$10
|
adc #$0f
|
||||||
and #$f0
|
and #$f0
|
||||||
bra @loop
|
bra @loop
|
||||||
; A device error message
|
; A device error message
|
||||||
@deverr:
|
@deverr:
|
||||||
lda #'E'|$80
|
lda #'E'|$80
|
||||||
jsr cout
|
jsr cout
|
||||||
lda #'r'|$80
|
lda #'R'|$80
|
||||||
jsr cout
|
jsr cout
|
||||||
jsr cout
|
jsr cout
|
||||||
lda #'='|$80
|
lda #'='|$80
|
||||||
jsr cout
|
jsr cout
|
||||||
inx
|
inx
|
||||||
lda inbuf,x
|
lda buffer,x
|
||||||
tay ; short-term save
|
tay ; short-term save
|
||||||
jsr prbyte
|
jsr prbyte
|
||||||
tya
|
tya
|
||||||
@ -194,14 +205,13 @@ online:
|
|||||||
lda #'('|$80
|
lda #'('|$80
|
||||||
jsr cout
|
jsr cout
|
||||||
inx
|
inx
|
||||||
lda inbuf,x
|
ldy buffer,x
|
||||||
jsr printsd
|
jsr printsd
|
||||||
lda #')'|$80
|
lda #')'|$80
|
||||||
jsr cout
|
jsr cout
|
||||||
bra @adjust
|
bra @adjust
|
||||||
|
|
||||||
printsd:
|
printsd:
|
||||||
tay
|
|
||||||
lda #'S'|$80
|
lda #'S'|$80
|
||||||
jsr cout
|
jsr cout
|
||||||
tya
|
tya
|
||||||
@ -218,9 +228,9 @@ printsd:
|
|||||||
jsr cout
|
jsr cout
|
||||||
tya
|
tya
|
||||||
and #$80
|
and #$80
|
||||||
asl
|
asl ; Drive 2 will set carry...
|
||||||
rol
|
adc #'1'|$80 ; ... making the '1' a '2'
|
||||||
ora #'0'|$80
|
|
||||||
jmp cout
|
jmp cout
|
||||||
|
|
||||||
|
_CodeEndAddress:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user