mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-10 22:54:59 +00:00
135 lines
2.2 KiB
Plaintext
135 lines
2.2 KiB
Plaintext
NEW
|
||
PREFIX /A2OSX.BUILD
|
||
AUTO 4,1
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
IO.Reset jsr IO.Reset.In
|
||
jsr IO.Reset.Out
|
||
jsr IO.Reset.Err
|
||
rts
|
||
*--------------------------------------
|
||
IO.Set.In pha
|
||
jsr IO.Reset.In
|
||
ldy #S.PS.hStdIn
|
||
lda (pPS),y
|
||
>STA.G IO.hIn
|
||
pla
|
||
ldy #S.PS.hStdIn
|
||
sta (pPS),y
|
||
rts
|
||
*--------------------------------------
|
||
IO.Reset.In >LDA.G IO.hIn
|
||
beq .8
|
||
|
||
pha
|
||
|
||
ldy #S.PS.hStdIn
|
||
lda (pPS),y
|
||
>SYSCALL fclose
|
||
|
||
pla
|
||
ldy #S.PS.hStdIn
|
||
sta (pPS),y
|
||
|
||
>STZ.G IO.hIn
|
||
.8 rts
|
||
*--------------------------------------
|
||
IO.Set.Out pha
|
||
jsr IO.Reset.Out
|
||
ldy #S.PS.hStdOut
|
||
lda (pPS),y
|
||
>STA.G IO.hOut
|
||
pla
|
||
ldy #S.PS.hStdOut
|
||
sta (pPS),y
|
||
rts
|
||
*--------------------------------------
|
||
IO.Reset.Out >LDA.G IO.hOut
|
||
beq .8
|
||
|
||
pha
|
||
|
||
ldy #S.PS.hStdOut
|
||
lda (pPS),y
|
||
>SYSCALL fclose
|
||
|
||
pla
|
||
ldy #S.PS.hStdOut
|
||
sta (pPS),y
|
||
|
||
>STZ.G IO.hOut
|
||
.8 rts
|
||
*--------------------------------------
|
||
IO.Set.Err pha
|
||
jsr IO.Reset.Err
|
||
ldy #S.PS.hStdErr
|
||
lda (pPS),y
|
||
>STA.G IO.hErr
|
||
pla
|
||
ldy #S.PS.hStdErr
|
||
sta (pPS),y
|
||
rts
|
||
*--------------------------------------
|
||
IO.Reset.Err >LDA.G IO.hErr
|
||
beq .8
|
||
|
||
pha
|
||
|
||
ldy #S.PS.hStdErr
|
||
lda (pPS),y
|
||
>SYSCALL fclose
|
||
|
||
pla
|
||
ldy #S.PS.hStdErr
|
||
sta (pPS),y
|
||
|
||
>STZ.G IO.hErr
|
||
.8 rts
|
||
*--------------------------------------
|
||
IO.PrintErrMsg pha Save EC for PrintF
|
||
|
||
ldx L.ERR.Codes
|
||
stx ZPPTR1
|
||
ldx L.ERR.Codes+1
|
||
stx ZPPTR1+1
|
||
|
||
ldy #0
|
||
|
||
.1 cmp (ZPPTR1),y
|
||
beq .2
|
||
iny
|
||
cpy #ERR.Count
|
||
bne .1
|
||
|
||
.2 lda L.ERR.Messages
|
||
sta ZPPTR1
|
||
lda L.ERR.Messages+1
|
||
sta ZPPTR1+1
|
||
|
||
.3 dey
|
||
bmi .8
|
||
|
||
lda (ZPPTR1)
|
||
sec
|
||
adc ZPPTR1
|
||
sta ZPPTR1
|
||
bcc .3
|
||
inc ZPPTR1+1
|
||
bra .3
|
||
|
||
.8
|
||
>PUSHW ZPPTR1
|
||
pla
|
||
>PUSHA
|
||
>PUSHBI 3
|
||
>PUSHW L.MSG.ERROR
|
||
ldy #S.PS.hStdErr
|
||
lda (pPS),y
|
||
>SYSCALL fprintf
|
||
rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.SRC/SBIN/SHELL.S.IO
|
||
LOAD /A2OSX.SRC/SBIN/SHELL.S
|
||
ASM
|