TERMIBAL, PRINTF, SH, Piping....

This commit is contained in:
burniouf 2023-05-16 18:53:52 +02:00
parent 0ea8d62a96
commit 87b9078877
25 changed files with 907 additions and 776 deletions

View File

@ -1195,16 +1195,6 @@ Specifiers :
+ %L : pull 4 bytes signed DEC -2147483648..2147483647 + %L : pull 4 bytes signed DEC -2147483648..2147483647
+ %s : pull 2 bytes ptr to C-Style String + %s : pull 2 bytes ptr to C-Style String
+ %S : pull 2 bytes ptr to P-Style String + %S : pull 2 bytes ptr to P-Style String
+ \b : Print 'BS' (08)
+ \e : Print 'ESC' ($1B,27)
+ \f : Print 'FF' ($0C,12)
+ \n : Print 'LF' ($0A,10)
+ \r : Print 'CR' ($0D,13)
+ \t : Print 'TAB' ($09,09)
+ \v : Print 'VT' ($0B,11)
+ \xHH : Print byte with hexadecimal value HH (1 to 2 digits)
+ \\\\ : Print \
+ \\% : Print %
Modifiers for len and padding : Modifiers for len and padding :
+ %d : '9' '12' + %d : '9' '12'

View File

@ -182,7 +182,7 @@ CS: A = EC
CC: Y,A = bytes written CC: Y,A = bytes written
CS: A = EC CS: A = EC
# RecvFrom (RAW,DGRAM,SEQPKT) # RecvFrom (RAW,DGRAM)
## C ## C
`hMem recvfrom(hFD fd, struct sockaddr *addr);` `hMem recvfrom(hFD fd, struct sockaddr *addr);`

View File

@ -301,13 +301,15 @@ The **default** commands is used to select the block of commands to execute for
### ECHO ### ECHO
echo [-n] <value>... echo [-e] [-n] <value>...
The **echo** command optional switch **-e** causes **echo** to process escape **\\** caracters.
The **echo** command is used to print <values> to an output device, by default the screen. The **echo** command optional switch **-n** causes **echo** to suppress output of the carriage return that normally occurs. Technically the format of the **echo** command is **echo [-n] [\<value\> ...]**. This means that the **echo** command can be followed by the optional switch **-n** and one or more optional \<values\>. In the case of **echo**, it is these \<values\> that are output by the command. Here, values are separated by spaces, so you can do ECHO $A HELLO $B and echo will output the value stored in the variable A and then the world HELLO and then the value stored in B. Please see \<values> for more information on how values are processed, especially in the handling of variables ($VAR) contained in a \<value>. The **echo** command is used to print <values> to an output device, by default the screen. The **echo** command optional switch **-n** causes **echo** to suppress output of the carriage return that normally occurs. Technically the format of the **echo** command is **echo [-n] [\<value\> ...]**. This means that the **echo** command can be followed by the optional switch **-n** and one or more optional \<values\>. In the case of **echo**, it is these \<values\> that are output by the command. Here, values are separated by spaces, so you can do ECHO $A HELLO $B and echo will output the value stored in the variable A and then the world HELLO and then the value stored in B. Please see \<values> for more information on how values are processed, especially in the handling of variables ($VAR) contained in a \<value>.
A word about values, command lines and spaces: **echo Hello World** is not the same as **echo "Hello World"**. In the first case **echo** treats Hello and World as separate values and in the second, "Hello World" as one value. Since **echo** takes multiple values, you might not notice the difference, but in the case of **if [ $A = "Hello World" ]** if you omitted the quotes you would get a syntax error because the = operator only accepts one value on each side. In addition, when not enclosed in quotes, extra spaces are removed so **echo Hello&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;World** would be output as **Hello World** as **echo** would treat Hello and World as values and output value space value. A word about values, command lines and spaces: **echo Hello World** is not the same as **echo "Hello World"**. In the first case **echo** treats Hello and World as separate values and in the second, "Hello World" as one value. Since **echo** takes multiple values, you might not notice the difference, but in the case of **if [ $A = "Hello World" ]** if you omitted the quotes you would get a syntax error because the = operator only accepts one value on each side. In addition, when not enclosed in quotes, extra spaces are removed so **echo Hello&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;World** would be output as **Hello World** as **echo** would treat Hello and World as values and output value space value.
In addition to the usual variable substitution that occurs with \<values> (see \<value> above), the **echo** command performs some special character substitutions while sending output to the screen or terminal. If placed inside a value like a string, **echo** will automatically substitute a backspace for the sequence **\b**, substitute an escape for **\e**, clear the screen for **\f**, send a newline for **\n**, send a \ for **\\\\** and send a % for **\\%**. The **\e** (escape) code is useful for sending VT100 escape sequences to the screen/terminal (see the VT100 example script). The **\\\\** and **\\%** are necessary to send those chars to the screen since normally those characters are interpreted as special command line arguments. There is also a special **\xHH** option, that will send explicitly the char represented by the HEX value HH to the output device (screen or file). supported escaped chars : **\\a**,**\\b**,**\\e**,**\\f**,**\\n**,**\\r**,**\\t**,**\\v**,**\\\\**,**\\'**,**\\"**,**\\?**
In addition to the usual variable substitution that occurs with \<values> (see \<value> above), the **echo** command performs some special character substitutions while sending output to the screen or terminal. If placed inside a value like a string, **echo** will automatically substitute a backspace for the sequence **\b**, substitute an escape for **\e**, clear the screen for **\f**, send a newline for **\n**, send a \ for **\\\\** and send a % for **\\%**. The **\e** (escape) code is useful for sending VT100 escape sequences to the screen/terminal (see the VT100 example script). The **\\\\** and **\\%** are necessary to send those chars to the screen since normally those characters are interpreted as special command line arguments. There is also special **\xHH** and **\OOO** options, that will send explicitly the char represented by the HEX value HH or OCT value OOO to the output device (screen or file).
#!/bin/sh #!/bin/sh
# #

View File

@ -1,6 +1,6 @@
# A2osX Terminal Codes Guide # A2osX Terminal Codes Guide
### Updated Apr. 15, 2023 ### Updated May. 14, 2023
A2osX terminal capabilities are based off of the standard VT-100 Terminal. This applies to users connected via Super Serial Cards, Telnet (via TelnetD server daemon) and the Apple console (physical keyboard/screen). All programs can use this facility to create rich interactive text mode applications. This includes both programs written in Assembly or Scripts written for the Shell (SH). The table below lists the codes you can use in your applications and their function. Consult the A2osX Shell Developers Guide for information on using these codes in scripts. Note, the Apple Console implementation only supports a subset of the VT-100 codes, these are noted in the last column as OK. A2osX terminal capabilities are based off of the standard VT-100 Terminal. This applies to users connected via Super Serial Cards, Telnet (via TelnetD server daemon) and the Apple console (physical keyboard/screen). All programs can use this facility to create rich interactive text mode applications. This includes both programs written in Assembly or Scripts written for the Shell (SH). The table below lists the codes you can use in your applications and their function. Consult the A2osX Shell Developers Guide for information on using these codes in scripts. Note, the Apple Console implementation only supports a subset of the VT-100 codes, these are noted in the last column as OK.
@ -15,6 +15,7 @@ A2osX terminal capabilities are based off of the standard VT-100 Terminal. This
|Esc[?7h |Set auto-wrap mode|DECAWM|OK| | |Esc[?7h |Set auto-wrap mode|DECAWM|OK| |
|Esc[?8h |Set auto-repeat mode|DECARM|| | |Esc[?8h |Set auto-repeat mode|DECARM|| |
|Esc[?9h |Set interlacing mode|DECINLM|| | |Esc[?9h |Set interlacing mode|DECINLM|| |
|Esc[?25h |Show cursor| DECTCEM |OK||
|Esc[20l |Reset line feed mode|LMN|OK| | |Esc[20l |Reset line feed mode|LMN|OK| |
|Esc[?1l |Reset cursor key to cursor|DECCKM|| | |Esc[?1l |Reset cursor key to cursor|DECCKM|| |
|Esc[?2l |Reset VT52 (versus ANSI) |DECANM|| | |Esc[?2l |Reset VT52 (versus ANSI) |DECANM|| |
@ -25,6 +26,7 @@ A2osX terminal capabilities are based off of the standard VT-100 Terminal. This
|Esc[?7l |Reset auto-wrap mode| DECAWM |OK|| |Esc[?7l |Reset auto-wrap mode| DECAWM |OK||
|Esc[?8l |Reset auto-repeat mode| DECARM || | |Esc[?8l |Reset auto-repeat mode| DECARM || |
|Esc[?9l |Reset interlacing mode| DECINLM ||| |Esc[?9l |Reset interlacing mode| DECINLM |||
|Esc[?25l |Hide cursor| DECTCEM |OK||
|Esc= |Set alternate keypad mode| DECKPAM ||| |Esc= |Set alternate keypad mode| DECKPAM |||
|Esc> |Set numeric keypad mode| DECKPNM ||| |Esc> |Set numeric keypad mode| DECKPNM |||
|Esc(A |Set United Kingdom G0 character set| setukg0 |OK|| |Esc(A |Set United Kingdom G0 character set| setukg0 |OK||

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -117,17 +117,23 @@ BSX.MoveHead sta BSX.TargetQTrack
cmp BSX.TargetQTrack cmp BSX.TargetQTrack
bne .3 bne .3
lsr CS if X,Y on * lsr CS if X,Y on
jsr BSX.Wait25600usec jsr BSX.Wait25600usec
ldy BSX.Slotn0
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+6,y
lda IO.D2.Ph0Off,y lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+4,y
bcc .10 * lda IO.D2.Ph0Off,y
clc * bcc .10
lda IO.D2.Ph0Off,x * lda IO.D2.Ph0Off,x
* clc
* lda IO.D2.Ph0Off,y
.10 rts .10 rts
*-------------------------------------- *--------------------------------------

View File

@ -364,25 +364,17 @@ SCRN.UpdateLineAtBufPtr
jsr SCRN.ToggleSel jsr SCRN.ToggleSel
.5 lda (BufPtr) .5 lda (BufPtr)
cmp #'\'
beq .50
cmp #'%'
bne .51
.50 pha
lda #'\'
jsr SCRN.ToLineBuf jsr SCRN.ToLineBuf
pla
.51 jsr SCRN.ToLineBuf
inc BufPtr inc BufPtr
bne .6 bne .6
inc BufPtr+1 inc BufPtr+1
.6 inc BUF.COffset .6 inc BUF.COffset
bne .7 bne .7
inc BUF.COffset+1 inc BUF.COffset+1
.7 dex .7 dex
bne .2 bne .2

View File

@ -215,7 +215,7 @@ DumpFD.PIPE >PUSHW L.MSG.PIPE
jsr DumpFD.Name jsr DumpFD.Name
>PUSHBI 5 >PUSHBI 6
>SYSCALL PrintF >SYSCALL PrintF
clc clc
rts rts
@ -263,7 +263,7 @@ MSG.DEV.ERR .CZ "[%h] Device Error.\r\n"
MSG.DEV.DIB .CZ "%s %h.%h %16S %3d.%3d " MSG.DEV.DIB .CZ "%s %h.%h %16S %3d.%3d "
MSG.DEV.B .CZ "%10u\r\n" MSG.DEV.B .CZ "%10u\r\n"
MSG.DEV.C .CZ "n/a\r\n" MSG.DEV.C .CZ "n/a\r\n"
MSG.PIPE .CZ "%3d %5s %s\r\n" MSG.PIPE .CZ "%3d %h %4s %s\r\n"
*-------------------------------------- *--------------------------------------
MSG.SFLAGS .AS "bwrlneio" MSG.SFLAGS .AS "bwrlneio"
NO.PATH .AZ "(no path)" NO.PATH .AZ "(no path)"

View File

@ -36,9 +36,9 @@ CS.START cld
.DA CS.RUN .DA CS.RUN
.DA CS.EVENT .DA CS.EVENT
.DA CS.QUIT .DA CS.QUIT
L.MSG0 .DA MSG0 L.MSG.HEADER .DA MSG.HEADER
L.MSG1 .DA MSG1 L.MSG.BODY .DA MSG.REGDIR
L.MSG.NA .DA MSG.NA .DA MSG.SPECIAL
L.FD.T .DA FD.T.REG L.FD.T .DA FD.T.REG
.DA FD.T.DIR .DA FD.T.DIR
.DA FD.T.CDEV .DA FD.T.CDEV
@ -52,7 +52,7 @@ L.FD.T .DA FD.T.REG
CS.INIT clc CS.INIT clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN >LDYA L.MSG0 CS.RUN >LDYA L.MSG.HEADER
>SYSCALL PutS >SYSCALL PutS
ldx #1 ldx #1
@ -62,7 +62,23 @@ CS.RUN >LDYA L.MSG0
lda hFDs-1,x lda hFDs-1,x
beq .7 beq .7
>PUSHW L.MSG1 >SYSCALL GetMemPtr
>STYA ZPFDPtr
ldx FILE.ID
lda hFDs.oCnt-1,x
beq .7
ldy #0
lda (ZPFDPtr)
cmp #S.FD.T.DIR+1
bcc .2
iny
iny
.2 >PUSHW L.MSG.BODY,y
txa txa
>PUSHA >PUSHA
@ -70,27 +86,16 @@ CS.RUN >LDYA L.MSG0
lda hFDs-1,x lda hFDs-1,x
>PUSHA >PUSHA
>SYSCALL GetMemPtr
>STYA ZPFDPtr
ldx FILE.ID
lda hFDs.oCnt-1,x lda hFDs.oCnt-1,x
>PUSHA >PUSHA
lda (ZPFDPtr) lda (ZPFDPtr)
tax tay
>PUSHW L.FD.T,x >PUSHW L.FD.T,y
ldx FILE.ID jsr CS.RUN.GetName
lda hFDs.hName-1,x
bne .5
>LDYA L.MSG.NA >PUSHYA
bra .6
.5 >SYSCALL GetMemPtr
.6 >PUSHYA
>PUSHBI 7 >PUSHBI 7
@ -105,6 +110,22 @@ CS.RUN >LDYA L.MSG0
sec sec
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CS.RUN.GetName lda hFDs.hName-1,x
bne .1
lda ZPFDPtr
clc
adc #S.FD.DEV
tay
lda ZPFDPtr+1
adc /S.FD.DEV
rts
.1 >SYSCALL GetMemPtr
rts
*--------------------------------------
CS.EVENT sec CS.EVENT sec
rts rts
*-------------------------------------- *--------------------------------------
@ -112,9 +133,9 @@ CS.QUIT clc
rts rts
*-------------------------------------- *--------------------------------------
CS.END CS.END
MSG0 .CZ "hFILE hFD Cnt Type Filepath" MSG.HEADER .CZ "hFILE hFD Cnt Type Filepath"
MSG1 .CZ "%3d %3d %3d %4s %s\r\n" MSG.REGDIR .CZ "%3d %3d %3d %4s %s\r\n"
MSG.NA .CZ "n/a" MSG.SPECIAL .CZ "%3d %3d %3d %4s /dev/%s\r\n"
FD.T.REG .CZ "REG" FD.T.REG .CZ "REG"
FD.T.DIR .CZ "DIR" FD.T.DIR .CZ "DIR"
FD.T.CDEV .CZ "CDEV" FD.T.CDEV .CZ "CDEV"

View File

@ -128,16 +128,23 @@ CS.RUN inc ArgCount
ldy #S.PS.hStdIn ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
pha
tax tax
lda hFDs-1,x lda hFDs-1,x
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA ZPPtr1 >STYA ZPPtr1
plx
lda (ZPPtr1) lda (ZPPtr1)
cmp #S.FD.T.PIPE cmp #S.FD.T.PIPE
bne .71 bne .71
stx hFile
.80 >LDYAI 256 .80 >LDYAI 256
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
@ -203,7 +210,9 @@ CS.RUN.PAUSE ldy #S.PS.hStdErr
>PUSHW L.MSG.Pause >PUSHW L.MSG.Pause
>SYSCALL FPutS >SYSCALL FPutS
.10 jsr CS.RUN.GETC .10 ldy #S.PS.hStdErr
lda (pPS),y
>SYSCALL GetC
bcs .99 bcs .99
cmp #'Q' cmp #'Q'
@ -251,24 +260,7 @@ CS.RUN.ERASE ldy #S.PS.hStdErr
>SYSCALL FPutS >SYSCALL FPutS
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.GETC lda hFile CS.RUN.GETLINE >PUSHB hFile
bne .1
ldy #S.PS.hStdErr
lda (pPS),y
>SYSCALL GetC
rts
.1 >SYSCALL GetChar
rts
*--------------------------------------
CS.RUN.GETLINE lda hFile
bne .1
ldy #S.PS.hStdIn
lda (pPS),y
.1 >PUSHA
>PUSHW ZPBufPtr >PUSHW ZPBufPtr
>PUSHWI 256 >PUSHWI 256

View File

@ -114,7 +114,8 @@ CS.RUN.LOOP lda bPipe If reading from pipe
.9 sec .9 sec
CS.RUN.LOOP.RTS rts CS.RUN.LOOP.RTS rts
*-------------------------------------- *--------------------------------------
CS.RUN.CheckArgs jsr CS.RUN.NextArg CS.RUN.CheckArgs
jsr CS.RUN.NextArg
bcs .4 bcs .4
lda (ZPPtr1) lda (ZPPtr1)
@ -333,10 +334,10 @@ CS.END
OptionList .AS "x" OptionList .AS "x"
OptionList.Cnt .EQ *-OptionList OptionList.Cnt .EQ *-OptionList
*-------------------------------------- *--------------------------------------
MSG.USAGE .AS "Usage : OD <File> or CMD|OD" MSG.USAGE .CS "Usage : OD <File> or CMD|OD"
MSG.CRLF .AZ "\r\n" MSG.CRLF .CZ "\r\n"
MSG.OFFSET .AZ "%h%h%h " MSG.OFFSET .CZ "%h%h%h "
MSG.HEXBYTE .AZ "%h " MSG.HEXBYTE .CZ "%h "
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR 0 .OR 0

View File

@ -188,13 +188,13 @@ CS.RUN.NextArg inc ArgIndex
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CS.RUN.SEDParser
* On entry, the expression is in ZPPatternPtr * On entry, the expression is in ZPPatternPtr
* We are looking for "s/search string/replace string/" * We are looking for "s/search string/replace string/"
* The '/' delimiter can be any char * The '/' delimiter can be any char
* On exit. ZPPatternPtr points to delimiter-terminated search string, * On exit. ZPPatternPtr points to delimiter-terminated search string,
* replaceidx contains the offset to the start of replacement str * replace idx contains the offset to the start of replacement str
CS.RUN.SEDParser
stz LineNum Reusing this as cntr stz LineNum Reusing this as cntr
lda (ZPPatternPtr) lda (ZPPatternPtr)
@ -368,10 +368,10 @@ CS.END
OptionList .AS "HhIi" OptionList .AS "HhIi"
OptionList.Cnt .EQ *-OptionList OptionList.Cnt .EQ *-OptionList
*-------------------------------------- *--------------------------------------
MSG.USAGE .AS "Usage : SED [-I] s/pattern/replacement/ <File>\r\n" MSG.USAGE .CS "Usage : SED [-I] s/pattern/replacement/ <File>\r\n"
.AS " or : CMD|SED [-I] s/pattern/replacement/\r\n" .CS " or : CMD|SED [-I] s/pattern/replacement/\r\n"
.AS " -I : Ignore Case" .CS " -I : Ignore Case"
MSG.CRLF .AZ "\r\n" MSG.CRLF .CZ "\r\n"
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR 0 .OR 0
@ -379,5 +379,5 @@ DS.START
DS.END .ED DS.END .ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/bin/od.s SAVE usr/src/bin/sed.s
ASM ASM

View File

@ -12,19 +12,18 @@ CL.Init >LDYAI 256
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CL.PrintPrompt >PUSHW L.PS1 CL.PrintPrompt >PUSHW L.PS1
>PUSHWZ >PUSHW ZPCLBuf
>SYSCALL Expand >SYSCALL Expand
bcs .9 bcs .9
phx >LDYA ZPCLBuf
jsr IO.EscOutYA
jsr PrintYANoCR lda #0
sta (ZPCLBuf)
pla
>SYSCALL FreeMem
.1 >LDYA L.MSG.PROMPT .1 >LDYA L.MSG.PROMPT
jsr PrintYANoCR jsr IO.OutYA
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CL.READN0A tax CL.READN0A tax
@ -281,7 +280,7 @@ CL.FS >LDA.G CL.Ptr
bmi CL.BS.8 bmi CL.BS.8
CL.FS.OUT >LDYA L.MSG.FS CL.FS.OUT >LDYA L.MSG.FS
jmp PrintYANoCR jmp IO.OutYA
*-------------------------------------- *--------------------------------------
CL.CLR >STZ.G HIS.Ptr CL.CLR >STZ.G HIS.Ptr
@ -311,7 +310,7 @@ CL.CLR.1 lda (ZPCLBuf)
bne .3 bne .3
>LDYA ZPCLBuf >LDYA ZPCLBuf
jsr PrintYANoCR jsr IO.OutYA
*-------------------------------------- *--------------------------------------
CL.Reset lda #0 CL.Reset lda #0
sta (ZPCLBuf) sta (ZPCLBuf)
@ -336,6 +335,7 @@ CL.ReadReset lda #$ff
iny CL.bSilent iny CL.bSilent
sta (pData),y sta (pData),y
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN

View File

@ -368,45 +368,75 @@ CMD.DATE.PRINT >LDYA ZPCLBuf
>SYSCALL PutS >SYSCALL PutS
rts rts
*-------------------------------------- *--------------------------------------
CMD.ECHO stz ZPPtr1 echo -N CMD.ECHO stz ZPPtr1 echo -E
stz ZPPtr1+1 Token Cnt stz ZPPtr1+1 echo -N
stz ZPPtr2 index in buffer
lda (ZPArgVBufPtr) lda (ZPArgVBufPtr)
beq .7 beq .7
.1 jsr CMD.IsSwitch .1 jsr CMD.IsSwitch
bcs .2 bcs .3
ldx #0
cmp #'E'
beq .2
inx
cmp #'N' cmp #'N'
bne CMD.ECHO.CSYN bne CMD.ECHO.CSYN
lda #$ff .2 ror ZPPtr1,x
eor ZPPtr1 bra .6
sta ZPPtr1
bra .4
.2 lda ZPPtr1+1 .3 ldy ZPPtr2
beq .3 beq .4
lda #C.SPACE lda #C.SPACE
>SYSCALL PutChar sta (ZPCLBuf),y
inc ZPPtr2
.3 >LDYA ZPArgVBufPtr .4 ldy #$ff
jsr PrintYANoCR
bcs .9
inc ZPPtr1+1 .5 iny
lda (ZPArgVBufPtr),y
beq .6
.4 jsr CORE.ArgV.Next phy
ldy ZPPtr2
sta (ZPCLBuf),y
inc ZPPtr2
ply
bra .5
.6 jsr CORE.ArgV.Next
bne .1 bne .1
.7 bit ZPPtr1 .7 ldy ZPPtr2
bit ZPPtr1+1 -N
bmi .8 bmi .8
>LDYA L.MSG.ECHOCRLF lda #C.CR
jmp PrintYANoCR sta (ZPCLBuf),y
iny
lda #C.LF
sta (ZPCLBuf),y
iny
.8 lda #0
sta (ZPCLBuf),y
>LDYA ZPCLBuf
bit ZPPtr1
bmi .80
jmp IO.OutYA
.80 jmp IO.EscOutYA
.8 clc
.9 rts .9 rts
CMD.ECHO.CSYN lda #E.CSYN CMD.ECHO.CSYN lda #E.CSYN
@ -438,7 +468,7 @@ CMD.READ lda (ZPArgVBufPtr)
beq CMD.ECHO.CSYN beq CMD.ECHO.CSYN
>LDYA ZPArgVBufPtr >LDYA ZPArgVBufPtr
jsr PrintYANoCR jsr IO.OutYA
bcs CMD.ECHO.RTS bcs CMD.ECHO.RTS
bra .5 bra .5
@ -573,6 +603,7 @@ CMD.REN lda (ZPArgVBufPtr)
.4 iny .4 iny
lda (ZPPtr1),y lda (ZPPtr1),y
beq .5 beq .5
sta (ZPPtr2),y sta (ZPPtr2),y
cmp #'/' cmp #'/'
bne .4 bne .4

View File

@ -130,9 +130,9 @@ CORE.Run jsr IO.Reset
txa txa
>STA.G CORE.hArgVBuf >STA.G CORE.hArgVBuf
lda #bState.PipeIn lda #bState.PipeIn+bState.PipeOut
trb bState trb bState
*--------------------------------------
CORE.Run.1 >LDYA ZPInputBufPtr Save Actual ptr for looping CORE.Run.1 >LDYA ZPInputBufPtr Save Actual ptr for looping
>STYA ZPInputCmdPtr >STYA ZPInputCmdPtr
@ -232,7 +232,7 @@ CORE.Run.4 >LDYA L.CMD internal command ?
jmp CORE.Run.Exit jmp CORE.Run.Exit
*-------------------------------------- *--------------------------------------
CORE.Run.5 jsr CORE.GetCharNB CORE.Run.5 jsr CORE.GetCharNB
bcs .8 Nothing to skip bcs CORE.Run.6 Nothing to skip
jsr CORE.IsEndCmd jsr CORE.IsEndCmd
bcc .3 bcc .3
@ -254,7 +254,7 @@ CORE.Run.5 jsr CORE.GetCharNB
.9 lda #E.SYN .9 lda #E.SYN
sec sec
jmp CORE.Run.Exit jmp CORE.Run.Exit
*--------------------------------------
.3 cmp #C.CR .3 cmp #C.CR
beq .7 beq .7
@ -281,7 +281,7 @@ CORE.Run.5 jsr CORE.GetCharNB
.50 lda #S.PS.F.HOLD Run in the background... .50 lda #S.PS.F.HOLD Run in the background...
trb CORE.PSFlags trb CORE.PSFlags
bra .8 bra CORE.Run.6
.6 jsr CORE.GetNextChar Skip '&&' .6 jsr CORE.GetNextChar Skip '&&'
@ -296,21 +296,10 @@ CORE.Run.5 jsr CORE.GetCharNB
.60 jmp CORE.Run.1 .60 jmp CORE.Run.1
.7 jsr CORE.GetNextCharNB Skip EoL char .7 jsr CORE.GetNextCharNB Skip EoL char
.8 lda #bState.PipeOut
trb bState
*-------------------------------------- *--------------------------------------
CORE.Run.6 lda bState CORE.Run.6 lda bState
bit #bState.PipeIn bit #bState.PipeOut
beq .1 beq .3
jsr IO.Pipe.In
bcs CORE.Run.Exit
lda bState
.1 bit #bState.PipeOut
beq .7
jsr IO.Pipe.Out jsr IO.Pipe.Out
bcs CORE.Run.Exit bcs CORE.Run.Exit
@ -318,36 +307,46 @@ CORE.Run.6 lda bState
lda #S.PS.F.HOLD Run in the background... lda #S.PS.F.HOLD Run in the background...
trb CORE.PSFlags trb CORE.PSFlags
lda #S.PS.F.CLOSEONX ...and close PIPE OUT on exit lda #S.PS.F.CLOSEONX ...and child PS must close StdOut on exit
tsb CORE.PSFlags tsb CORE.PSFlags
jsr CORE.ExecCmd .3 jsr CORE.ExecCmd
php bcs CORE.Run.Exit
pha
lda CORE.IntCmd $ff if external
eor #$80
asl if cc Was external...
jsr IO.Reset.OutC restore Output, NO close if EXTERNAL
lda bState lda bState
and #bState.PipeIn
.5 bit #bState.PipeIn
beq .6 beq .6
jsr IO.Pop.In restore Input jsr IO.Pop.In restore Input piping app must close it
.6 pla lda #bState.PipeIn
plp trb bState
lda bState
.6 bit #bState.PipeOut
beq .7
jsr IO.Pipe.In Set previous Pipe Out to StdIn for next CMD
bcs CORE.Run.Exit bcs CORE.Run.Exit
lda #bState.PipeIn lda #bState.PipeIn
tsb bState tsb bState
jmp CORE.Run.1 Loop with Pipe IN bit CORE.IntCmd
bmi .60
.7 jsr CORE.ExecCmd jsr IO.Reset.Out Internal : CLOSE output
bra .61
.60 jsr IO.Pop.Out External : DONT Close Output, child process will close it
.61 lda #bState.PipeOut
trb bState
.7 jmp CORE.Run.1 Loop with Pipe IN
*-------------------------------------- *--------------------------------------
CORE.Run.Exit php CORE.Run.Exit php
pha pha
@ -403,6 +402,7 @@ CORE.ExecExtCmd >PUSHW ZPArgVBuf
rts rts
.4 >SLEEP Suspend this PID .4 >SLEEP Suspend this PID
sec sec
ldy #S.PS.RC CPID will update S.PS.RC ldy #S.PS.RC CPID will update S.PS.RC
lda (pPS),y lda (pPS),y
@ -584,6 +584,7 @@ CORE.ArgV.Next lda (ZPArgVBufPtr)
CORE.ArgV.NextChar CORE.ArgV.NextChar
inc ZPArgVBufPtr inc ZPArgVBufPtr
bne .8 bne .8
inc ZPArgVBufPtr+1 inc ZPArgVBufPtr+1
.8 rts .8 rts
*-------------------------------------- *--------------------------------------

View File

@ -74,7 +74,7 @@ HIS.Select >LDA.G HIS.Count
bne .1 bne .1
>LDYA L.MSG.HISPROMPT >LDYA L.MSG.HISPROMPT
jsr PrintYANoCR jsr IO.OutYA
bcs .9 bcs .9
lda #0 lda #0
@ -97,7 +97,7 @@ HIS.Select >LDA.G HIS.Count
>STA.G HIS.Ptr >STA.G HIS.Ptr
.7 >LDYA L.MSG.HISROMPTCLR .7 >LDYA L.MSG.HISROMPTCLR
jsr PrintYANoCR jsr IO.OutYA
bcs .9 bcs .9
jsr CL.PrintPrompt jsr CL.PrintPrompt
@ -154,7 +154,7 @@ HIS.GetToCL1 >LDA.G HIS.Ptr
>STA.G CL.Len >STA.G CL.Len
>LDYA ZPCLBuf >LDYA ZPCLBuf
jmp PrintYANoCR jmp IO.OutYA
.9 rts .9 rts
*-------------------------------------- *--------------------------------------

View File

@ -38,6 +38,7 @@ IO.Pop.In clc
IO.Reset.In sec IO.Reset.In sec
>LDA.G IO.hIn >LDA.G IO.hIn
beq .8 beq .8
bcc .1 bcc .1
ldy #S.PS.hStdIn ldy #S.PS.hStdIn
@ -83,7 +84,7 @@ IO.Pop.Out clc
.HS B0 BCS .HS B0 BCS
*-------------------------------------- *--------------------------------------
IO.Reset.Out sec IO.Reset.Out sec
IO.Reset.OutC >LDA.G IO.hOut >LDA.G IO.hOut
beq .8 beq .8
bcc .1 bcc .1
@ -124,11 +125,11 @@ IO.Close.Y pha
rts rts
*-------------------------------------- *--------------------------------------
IO.Pipe.OpenR ldx #O.RDONLY+O.TEXT IO.Pipe.OpenR ldx #O.RDONLY+O.TEXT
.HS 2C BIT ABS bra IO.Pipe.Open
IO.Pipe.OpenW ldx #O.WRONLY+O.TEXT IO.Pipe.OpenW ldx #O.WRONLY+O.TEXT
>LEA.G IO.DEVFIFO IO.Pipe.Open >LEA.G IO.DEVFIFO
*-------------------------------------- *--------------------------------------
IO.FOpenYAX >PUSHYA IO.FOpenYAX >PUSHYA
txa txa
@ -151,50 +152,10 @@ IO.StatYA >PUSHYA
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
* set A = `sh -C ls|grep test`
IO.Exec >PUSHW ZPArgVBufPtr IO.Exec >PUSHW ZPArgVBufPtr
>PUSHBI S.PS.F.CLOSEONX >PUSHBI S.PS.F.CLOSEONX
>SYSCALL ExecL >SYSCALL ExecL
rts rts
* >LDYAI 256
* >SYSCALL GetMem
* bcs .99
* >STYA ZPPtr1
* phx
* >PUSHYA
* >PUSHW L.EXECC
* >PUSHW.G SH
* >PUSHW ZPArgVBufPtr
* >PUSHBI 4
* >SYSCALL sprintf
* bcs .98
* ldy #S.PS.hStdErr
* lda (pPS),y
* >PUSHA
* >PUSHW ZPPtr1
* >SYSCALL fputs
* >DEBUG
* >PUSHW ZPPtr1
* >PUSHBI S.PS.F.CLOSEONX
* >SYSCALL ExecL
*.98 plx
* php
* pha
* txa
* >SYSCALL freemem
* pla
* plp
*.99 rts
*-------------------------------------- *--------------------------------------
IO.PrintBatchErrMsg IO.PrintBatchErrMsg
>LDYA ZPInputBuf >LDYA ZPInputBuf
@ -319,6 +280,144 @@ IO.PrintErrMsg ldy #S.PS.RC
rts rts
*-------------------------------------- *--------------------------------------
IO.EscOutYA >STYA ZPPtr1 In
>STYA ZPPtr2 Out
ldy #0
.1 jsr GetPtr1NextChar
beq .8
cmp #'\'
bne .6
lda (ZPPtr1)
beq .7
ldx #OUT.EscCharsCnt-1
.2 cmp OUT.EscChars,x
beq .5
dex
bpl .2
stz ZPTmpW
jsr ToUpperCase
cmp #'X'
bne .3
.20 jsr IncPtr1
lda (ZPPtr1)
beq .40
jsr IO.IsHexDigit
bcs .40
asl ZPTmpW
asl ZPTmpW
asl ZPTmpW
asl ZPTmpW
ora ZPTmpW
sta ZPTmpW
bra .20
.3 jsr IO.IsOctDigit
bcs .40
jsr IncPtr1
asl ZPTmpW
asl ZPTmpW
asl ZPTmpW
ora ZPTmpW
sta ZPTmpW
lda (ZPPtr1)
bne .3
.40 lda ZPTmpW
bra .6
.4 tax
lda #'\'
sta (ZPPtr2),y
iny
txa
bra .6
.5 lda OUT.EscCodes,x
jsr IncPtr1
.6 sta (ZPPtr2),y
iny
bra .1
.7 lda #'\'
sta (ZPPtr2),y
iny
lda #0
.8 sta (ZPPtr2),y
>LDYA ZPPtr2
*--------------------------------------
IO.OutYA >PUSHYA
>PUSHBI 0
>SYSCALL PrintF
rts
*--------------------------------------
IO.IsOctDigit cmp #'0'
bcc .9
cmp #'7'+1
bcs .9
and #%00000111
clc
rts
.9 sec
rts
*--------------------------------------
IO.IsHexDigit cmp #'0'
bcc .9
cmp #'9'+1
bcc .8
cmp #'A'
bcc .9
cmp #'Z'+1
bcc .7
cmp #'a'
bcc .9
cmp #'z'+1
bcc .9
* sec
sbc #$20
.7 sec
sbc #'A'-10
.8 and #$0F
clc
rts
.9 sec
rts
*--------------------------------------
MAN MAN
SAVE usr/src/bin/sh.s.io SAVE usr/src/bin/sh.s.io
LOAD usr/src/bin/sh.s LOAD usr/src/bin/sh.s

View File

@ -89,7 +89,7 @@ bState.ExitOnEOF .EQ %10000000
bState.Pause .EQ %01000000 bState.Pause .EQ %01000000
bState.PipeIn .EQ %00100000 bState.PipeIn .EQ %00100000
bState.PipeOut .EQ %00010000 bState.PipeOut .EQ %00010000
bState.PipeOutInt .EQ %00001000
bState.SET.C .EQ %00000100 bState.SET.C .EQ %00000100
bState.SET.E .EQ %00000010 bState.SET.E .EQ %00000010
bState.SET.X .EQ %00000001 bState.SET.X .EQ %00000001
@ -357,11 +357,10 @@ CS.RUN.LOOP >SLEEP
CS.RUN.INTERACTIVE CS.RUN.INTERACTIVE
jsr IO.Reset jsr IO.Reset
jsr CL.Reset jsr CL.Reset
jsr CL.ReadResetV
>STZ.G HIS.Ptr >STZ.G HIS.Ptr
jsr CL.ReadResetV
jsr CL.PrintPrompt jsr CL.PrintPrompt
bcs CS.RUN.CMDLINE.9 bcs CS.RUN.CMDLINE.9
@ -377,7 +376,7 @@ CS.RUN.INTERACTIVE
bpl .1 bpl .1
>LDYA L.MSG.PROMPTCRLF >LDYA L.MSG.PROMPTCRLF
jsr PrintYANoCR jsr IO.OutYA
bcs CS.RUN.CMDLINE.9 bcs CS.RUN.CMDLINE.9
lda (ZPCLBuf) lda (ZPCLBuf)
@ -539,6 +538,7 @@ CheckLFAfterCR ldy #S.PS.hStdIn Check for any extra LF
tay tay
bne .9 bne .9
>SYSCALL GetChar >SYSCALL GetChar
.9 rts .9 rts
@ -558,13 +558,17 @@ GetPtr1NextChar lda (ZPPtr1)
IncPtr1 inc ZPPtr1 IncPtr1 inc ZPPtr1
bne IncPtr1.8 bne IncPtr1.8
inc ZPPtr1+1 inc ZPPtr1+1
IncPtr1.8 rts IncPtr1.8 rts
*-------------------------------------- *--------------------------------------
GetPtr1LenY ldy #$ff GetPtr1LenY ldy #$ff
.1 iny .1 iny
lda (ZPPtr1),y lda (ZPPtr1),y
bne .1 bne .1
rts rts
*-------------------------------------- *--------------------------------------
GetPtr1NextString GetPtr1NextString
@ -576,6 +580,7 @@ AddAp1Ptr1 sec
adc ZPPtr1 adc ZPPtr1
sta ZPPtr1 sta ZPPtr1
bcc .8 bcc .8
inc ZPPtr1+1 inc ZPPtr1+1
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
@ -595,11 +600,6 @@ IncPStack3 inc pStack
inc pStack inc pStack
inc pStack inc pStack
rts rts
*--------------------------------------
PrintYANoCR >PUSHYA
>PUSHBI 0
>SYSCALL PrintF
rts
*-------------------------------------- *--------------------------------------
.INB usr/src/bin/sh.s.cl .INB usr/src/bin/sh.s.cl
.INB usr/src/bin/sh.s.cmd .INB usr/src/bin/sh.s.cmd
@ -637,7 +637,7 @@ HOME .AZ "${HOME}"
EXECC .AZ "%s -C %s" EXECC .AZ "%s -C %s"
*-------------------------------------- *--------------------------------------
IN.EscChars .AS "DABC" IN.EscChars .AS "DABC"
IN.EscCharsCnt .EQ *-EscChars IN.EscCharsCnt .EQ *-IN.EscChars
IN.EscCodes .DA #C.BS,#C.VT,#C.LF,#21 IN.EscCodes .DA #C.BS,#C.VT,#C.LF,#21
*-------------------------------------- *--------------------------------------
* \e[1~ - Home * \e[1~ - Home

View File

@ -162,19 +162,25 @@ D2.MoveHead >PULLB D2.TargetQTrack
cmp D2.TargetQTrack cmp D2.TargetQTrack
bne .3 bne .3
lsr CS if X,Y on * lsr CS if X,Y on
jsr D2.Wait25600usec jsr D2.Wait25600usec
ldy D2.Slotn0
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+6,y
lda IO.D2.Ph0Off,y lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+4,y
bcc .10 * lda IO.D2.Ph0Off,y
clc * bcc .10
lda IO.D2.Ph0Off,x * lda IO.D2.Ph0Off,x
* clc
* lda IO.D2.Ph0Off,y
.10 jsr D2.Wait25600usec *.10 jsr D2.Wait25600usec
plp plp
clc clc

View File

@ -716,13 +716,19 @@ XRW.TrackSelect lda #2
ora A2L ora A2L
tay y = n0/n2 tay y = n0/n2
lda IO.D2.Ph0On,y iny
lda IO.D2.Ph0On+4,y jsr XRW.Ph04Off
* lda IO.D2.Ph0On,y
* lda IO.D2.Ph0On+4,y
jsr XRW.Wait100usec jsr XRW.Wait100usec
lda IO.D2.Ph0Off,y dey
lda IO.D2.Ph0Off+4,y jsr XRW.Ph04Off
*
* lda IO.D2.Ph0Off,y
* lda IO.D2.Ph0Off+4,y
lda XRW.AddrField.T lda XRW.AddrField.T
sta XRW.D2Trk-1,x sta XRW.D2Trk-1,x
@ -834,17 +840,24 @@ XRW.SeekYA sta XRW.D2Trk-1,x will be current track at the end
cmp XRW.TargetQTrack cmp XRW.TargetQTrack
bne .3 bne .3
lsr CS if X,Y on * lsr CS if X,Y on
jsr XRW.Wait25600usec jsr XRW.Wait25600usec
lda IO.D2.Ph0Off,y ldy A2L
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+6,y
XRW.Ph04Off lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+4,y
bcc .10
* lda IO.D2.Ph0Off,y
* bcc .10
* lda IO.D2.Ph0Off,x
clc Exit wit CC (recalibrate) clc Exit wit CC (recalibrate)
* lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off,x
.10 rts .10 rts
*-------------------------------------- *--------------------------------------

View File

@ -319,20 +319,26 @@ BB.FX2.SeekReadD2
cmp BB.TargetQTrack cmp BB.TargetQTrack
bne .3 bne .3
lsr CS if X,Y on * lsr CS if X,Y on
lda #0 lda #0
jsr BB.Wait100usecA jsr BB.Wait100usecA
ldy ROM.D2.Slotn0
lda IO.D2.Ph0Off+2,y
lda IO.D2.Ph0Off+6,y
lda IO.D2.Ph0Off,y lda IO.D2.Ph0Off,y
lda IO.D2.Ph0Off+4,y
bcc .10 * lda IO.D2.Ph0Off,y
clc * bcc .10
lda IO.D2.Ph0Off,x * clc
.10 * lda IO.D2.Ph0Off,x
*.10
*-------------------------------------- *--------------------------------------
BB.FX2.ReadSectD2 BB.FX2.ReadSectD2
ldx ROM.D2.Slotn0 ldx ROM.D2.Slotn0

View File

@ -763,16 +763,6 @@ K.Rename jsr PFT.CheckPath2
* + %L : pull 4 bytes signed DEC -2147483648..2147483647 * + %L : pull 4 bytes signed DEC -2147483648..2147483647
* + %s : pull 2 bytes ptr to C-Style String * + %s : pull 2 bytes ptr to C-Style String
* + %S : pull 2 bytes ptr to P-Style String * + %S : pull 2 bytes ptr to P-Style String
* + \b : Print 'BS' (08)
* + \e : Print 'ESC' ($1B,27)
* + \f : Print 'FF' ($0C,12)
* + \n : Print 'LF' ($0A,10)
* + \r : Print 'CR' ($0D,13)
* + \t : Print 'TAB' ($09,09)
* + \v : Print 'VT' ($0B,11)
* + \xHH : Print byte with hexadecimal value HH (1 to 2 digits)
* + \\\\ : Print \
* + \\% : Print %
* Modifiers for len and padding : * Modifiers for len and padding :
* + %d : '9' '12' * + %d : '9' '12'
* + %2d : ' 9' '12' * + %2d : ' 9' '12'
@ -818,7 +808,8 @@ K.PrintF.1 sec format string->ptr2
jmp .8 end of format.. jmp .8 end of format..
.22 cmp #'%' .22 cmp #'%'
bne .10 bne .20
stz K.PrintF.PadL stz K.PrintF.PadL
stz K.PrintF.PadC stz K.PrintF.PadC
lda (ZPPtr2) lda (ZPPtr2)
@ -851,10 +842,13 @@ K.PrintF.1 sec format string->ptr2
beq .7 beq .7
.6 ldx #PrintFTBL1.Cnt-1 do we have a %x command? .6 ldx #PrintFTBL1.Cnt-1 do we have a %x command?
.61 cmp PrintFTBL1,x .61 cmp PrintFTBL1,x
beq .62 beq .62
dex dex
bpl .61 bpl .61
bra .20 unknown ... bra .20 unknown ...
.62 jsr SHARED.NextCP2 .62 jsr SHARED.NextCP2
@ -862,35 +856,16 @@ K.PrintF.1 sec format string->ptr2
asl asl
tax tax
jsr PrintF.ESC jsr PrintF.ESC
.11 bcc .1 bcc .1
bra .99 bra .99
.7 lda #'%' .7 lda #'%'
bra .20
*--------------------------------------
.10 cmp #'\'
bne .20
jsr SHARED.GetCP2
beq .99
ldx #PrintFTBL2.Cnt-1
.12 cmp PrintFTBL2,x
beq .19
dex
bpl .12
cmp #'x' \xHH
bne .1
jsr MATH.Hex2ACC32
bcs .99
jsr SHARED.AddY2P2
.14 lda ACC32
bra .20
.19 lda PrintFTBL2.OUT,x
.20 jsr PrintF.PutC .20 jsr PrintF.PutC
bcc .11 bcc .1
jmp STDIO.Exit
*-------------------------------------- *--------------------------------------
.99 lda #E.BADARG .99 lda #E.BADARG
sec sec
@ -921,11 +896,6 @@ K.PrintF.1 sec format string->ptr2
*-------------------------------------- *--------------------------------------
PrintFTBL1 .AS "bdDuefhHiILsS" PrintFTBL1 .AS "bdDuefhHiILsS"
PrintFTBL1.Cnt .EQ *-PrintFTBL1 PrintFTBL1.Cnt .EQ *-PrintFTBL1
PrintFTBL2 .AS "abefnrtv\%"
PrintFTBL2.Cnt .EQ *-PrintFTBL2
PrintFTBL2.OUT .HS 07.08.1B.0C.0A.0D.09.0B \a\b\e\f\n\r\t\v
.DA #'\' \\
.DA #'%' \%
*-------------------------------------- *--------------------------------------
PrintF.ESC jmp (.1,x) PrintF.ESC jmp (.1,x)
.1 .DA PrintF.B .1 .DA PrintF.B

View File

@ -575,27 +575,27 @@ TERMX.RM clc
ldy #S.DCB.TTY.bDECAWM ldy #S.DCB.TTY.bDECAWM
bra .8 bra .8
*--------------------------------------
.2 cmp #25 .2 eor #25
bne .98 bne .98
ldy #S.DCB.TTY.bCURON ldy #S.DCB.TTY.bCURON
plp plp
ror ror A = 0
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
bmi .80 bmi .3 let it starts blinking..
jsr TERMX.CUROFF jsr TERMX.CUROFF
clc .3 clc
rts rts
.8 plp .8 plp
ror ror
sta (ZPDCBPtr),y sta (ZPDCBPtr),y
.80 clc clc
rts rts
.98 plp .98 plp
@ -989,6 +989,8 @@ TERMX.CUU clc no scroll
TERMX.CBLNK jsr TERMX.CCheck TERMX.CBLNK jsr TERMX.CCheck
bcs TERMX.RTS bcs TERMX.RTS
* ldy #S.DCB.TTY.bCURON
lda DevMgr.Timer lda DevMgr.Timer
and #CURBLNK.SPEED and #CURBLNK.SPEED
eor (ZPDCBPtr),y eor (ZPDCBPtr),y
@ -1001,7 +1003,7 @@ TERMX.CBLNK jsr TERMX.CCheck
asl asl
beq TERMX.CUROFF.1 beq TERMX.CUROFF.1
jsr GetCharAtCurPos TERMX.CURON jsr GetCharAtCurPos
bcs TERMX.RTS Out of screen bcs TERMX.RTS Out of screen
and #$80 and #$80
@ -1011,9 +1013,6 @@ TERMX.CBLNK jsr TERMX.CCheck
TERMX.CUROFF jsr TERMX.CCheck TERMX.CUROFF jsr TERMX.CCheck
bcs TERMX.RTS bcs TERMX.RTS
asl
beq TERMX.RTS already off
TERMX.CUROFF.1 jsr GetCharAtCurPos TERMX.CUROFF.1 jsr GetCharAtCurPos
bcs TERMX.RTS Out of screen bcs TERMX.RTS Out of screen