1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* The GNO Shell Project
|
|
|
|
*
|
|
|
|
* Developed by:
|
|
|
|
* Jawaid Bazyar
|
|
|
|
* Tim Meekins
|
|
|
|
*
|
1998-12-21 23:57:08 +00:00
|
|
|
* $Id: term.asm,v 1.8 1998/12/21 23:57:08 tribby Exp $
|
1998-04-24 15:38:47 +00:00
|
|
|
*
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* TERM.ASM
|
|
|
|
* By Tim Meekins
|
1998-08-03 17:30:30 +00:00
|
|
|
* Modified by Dave Tribby for GNO 2.0.6
|
1997-11-18 05:31:00 +00:00
|
|
|
*
|
|
|
|
* Routines for dealing with Termcap under gsh.
|
|
|
|
*
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
|
|
|
* | | | | | |
|
|
|
|
* ^ ^ ^ ^ ^ ^
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
|
1998-04-24 15:38:47 +00:00
|
|
|
mcopy /obj/gno/bin/gsh/term.mac
|
|
|
|
|
Major changes to gsh with this checkin:
* When ~ is parsed and next character is a delimiter, make sure contents
of expanded $HOME match the user's delimiter.
* When wildcard patterns don't match, rather than terminating the command
gsh now prints "No match: <pattern> ignored" and passes the command line
minus the unmatched patterns on to be executed.
* Modified echo command so it doesn't add a blank to the end.
* Make "clear" and "source" built-ins non-forked commands. Unforking
"source" allows prefixes to be set in files that are sourced.
* Add loop to parse a single command (removing leading whitespace) before
sending it off to be expanded and executed. Skip null lines and comments
at this level. This allows later commands that depend upon variables set
in the 1st command to work; e.g.: set t_num=1 ; echo "Test number $t_num"
Also fixes problems seen when tab was first character of multiple lines.
* Initialize environment variable flags at startup (for echo, nodirexec,
nonewline, noglob, nobeep, pushdsilent, term, and ignoreeof). Set
flag when env var is set in upper or lower case (formerly, only worked
with lower case).
* Lots of places two-word addresses are incremented using inc, without
checking for overflow into the high-order word. As these are discovered,
they are changed to use adc on both words.
See file UpdateLog for detailed list of changes.
1998-06-30 17:26:04 +00:00
|
|
|
dummyterm start ; ends up in .root
|
1998-04-24 15:38:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
setcom 60
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
TIOCGETP gequ $40067408
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* Initialize the system for termcap - checks to see if $TERM exists
|
1998-07-20 16:23:11 +00:00
|
|
|
* and is set, if not, sets to GNOCON; and allocate termcap buffers.
|
1997-11-18 05:31:00 +00:00
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
InitTerm START
|
1998-09-08 16:53:14 +00:00
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
using termdata
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; See if $TERM exists
|
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
ReadVariableGS ReadVarPB
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
lda term_len Get length of $TERM
|
|
|
|
bne allocate If 0,
|
|
|
|
SetGS SetPB set to default ("gnocon")
|
|
|
|
|
|
|
|
allocate anop Allocate termcap buffers.
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
ph4 #1024
|
1998-08-03 17:30:30 +00:00
|
|
|
~NEW
|
1998-09-08 16:53:14 +00:00
|
|
|
sta bp
|
1997-11-18 05:31:00 +00:00
|
|
|
stx bp+2
|
1998-07-20 16:23:11 +00:00
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
ph4 #1024
|
1998-08-03 17:30:30 +00:00
|
|
|
~NEW
|
1997-11-18 05:31:00 +00:00
|
|
|
sta areabuf
|
|
|
|
stx areabuf+2
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
rts Return to caller.
|
|
|
|
|
|
|
|
;
|
|
|
|
; Parameter block for shell ReadVariableGS call (p 423 in ORCA/M manual)
|
|
|
|
;
|
|
|
|
ReadVarPB anop
|
|
|
|
dc i2'3' pCount
|
|
|
|
dc i4'term' Name (pointer to GS/OS string)
|
|
|
|
dc i4'dummyresult' GS/OS Output buffer ptr
|
|
|
|
ds 2 export flag
|
|
|
|
;
|
|
|
|
; GS/OS result buffer for getting length of TERM env var.
|
|
|
|
;
|
|
|
|
dummyresult dc i2'5' Only five bytes total.
|
|
|
|
term_len ds 2 Value's length returned here.
|
|
|
|
ds 1 Only 1 byte for value.
|
|
|
|
|
|
|
|
;
|
|
|
|
; Parameter block for shell SetGS calls (p 427 in ORCA/M manual)
|
|
|
|
;
|
|
|
|
SetPB anop
|
|
|
|
dc i2'3' pCount
|
|
|
|
dc i4'term' Name (pointer to GS/OS string)
|
|
|
|
dc i4'gnocon' Value (pointer to GS/OS string)
|
|
|
|
dc i2'1' Export flag
|
|
|
|
|
|
|
|
term gsstr 'term'
|
|
|
|
gnocon gsstr 'gnocon'
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* read new temcap information
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
readterm START
|
|
|
|
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
backward_char equ 3
|
|
|
|
forward_char equ 4
|
|
|
|
up_history equ 5
|
|
|
|
down_history equ 6
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
lda #1
|
1997-11-18 05:31:00 +00:00
|
|
|
sta didReadTerm
|
|
|
|
|
|
|
|
ph4 #termname
|
|
|
|
jsl getenv
|
1998-07-20 16:23:11 +00:00
|
|
|
phx Push allocated buffer on stack
|
|
|
|
pha for later call to nullfree.
|
|
|
|
clc Add 4 to GS/OS result buffer
|
|
|
|
adc #4 to get pointer to text.
|
|
|
|
bcc val_addr_set
|
|
|
|
inx
|
|
|
|
val_addr_set sta hold_term_val
|
|
|
|
stx hold_term_val+2
|
1997-11-18 05:31:00 +00:00
|
|
|
tgetent (bp,@xa) ;xa is pushed first
|
|
|
|
beq noentry
|
|
|
|
dec a
|
|
|
|
beq ok
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
jsl nullfree Free buffer allocated by getenv.
|
1997-11-18 05:31:00 +00:00
|
|
|
stz termok
|
|
|
|
ldx #^error1
|
|
|
|
lda #error1
|
|
|
|
jmp errputs
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
noentry anop
|
1997-11-18 05:31:00 +00:00
|
|
|
stz termok
|
|
|
|
ldx #^error2
|
1998-07-20 16:23:11 +00:00
|
|
|
lda #error2 Print error message:
|
|
|
|
jsr errputs 'Termcap entry not found for '
|
|
|
|
lda hold_term_val Get text from buffer allocated
|
|
|
|
ldx hold_term_val+2 by getenv
|
|
|
|
jsr errputs and print it.
|
|
|
|
jsl nullfree Free buffer allocated by getenv.
|
1997-11-18 05:31:00 +00:00
|
|
|
lda #13
|
|
|
|
jmp errputchar
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
ok jsl nullfree Free buffer allocated by getenv.
|
1997-11-18 05:31:00 +00:00
|
|
|
lda #1
|
|
|
|
sta termok
|
1998-09-08 16:53:14 +00:00
|
|
|
mv4 areabuf,area
|
1997-11-18 05:31:00 +00:00
|
|
|
|
Changes for gsh version 2.0d5:
Add quotes around null parameters from the command line so they will be
parsed properly (resolves PR#84).
Output piped to an unfound command caused gsh to terminate, due to an
interface change to the GNO 2.0.6 version of getpgrp(2): it now returns the
process group of the caller. To get the process group number for the
pid passed as a parameter pid, the call has to be made to _getpgrp(2).
In addition to fixing invoke.asm, updates were also made in jobs.asm.
When directory stack is full, pushd, reports a new error message: 'pushd:
Directory stack full'. (Previously, 50 pushds would cause a crash.)
When parameter passed to "pushd +n" is <= 0, report a new error message:
'pushd: Invalid number'. (Previously, tried to chdir to the parameter.)
When a command appends to stderr (e.g., echo test >>&/tmp/err), stdin was
closed, due to errappend being defined as pipefds+2 rather than pipefds+4
in cmd.asm.
When there was an error reading stdin, gsh went into an infinite loop of
beeping and requesting more input. Changed getchar (in stdio.asm) and
GetCmdLine (in edit.asm) to report the error and terminate.
Code in cmd.asm set and reset handler for signal SIGSTOP (17). This makes
no sense, since there cannot be a handler for SIGSTOP. This was changed
to set and reset signal SIGTSTP (18) since that handler is used by gsh.
The error message "specify a command before redirecting" was never
caught by the invoke() subroutine because the next higher routine,
command(), checked for argv==0 before calling invoke(). The error
message was moved into command().
1998-10-26 17:04:51 +00:00
|
|
|
;
|
|
|
|
; Get addresses of termcap strings
|
|
|
|
;
|
1997-11-18 05:31:00 +00:00
|
|
|
tgetstr (#isid,#area)
|
Changes for gsh version 2.0d5:
Add quotes around null parameters from the command line so they will be
parsed properly (resolves PR#84).
Output piped to an unfound command caused gsh to terminate, due to an
interface change to the GNO 2.0.6 version of getpgrp(2): it now returns the
process group of the caller. To get the process group number for the
pid passed as a parameter pid, the call has to be made to _getpgrp(2).
In addition to fixing invoke.asm, updates were also made in jobs.asm.
When directory stack is full, pushd, reports a new error message: 'pushd:
Directory stack full'. (Previously, 50 pushds would cause a crash.)
When parameter passed to "pushd +n" is <= 0, report a new error message:
'pushd: Invalid number'. (Previously, tried to chdir to the parameter.)
When a command appends to stderr (e.g., echo test >>&/tmp/err), stdin was
closed, due to errappend being defined as pipefds+2 rather than pipefds+4
in cmd.asm.
When there was an error reading stdin, gsh went into an infinite loop of
beeping and requesting more input. Changed getchar (in stdio.asm) and
GetCmdLine (in edit.asm) to report the error and terminate.
Code in cmd.asm set and reset handler for signal SIGSTOP (17). This makes
no sense, since there cannot be a handler for SIGSTOP. This was changed
to set and reset signal SIGTSTP (18) since that handler is used by gsh.
The error message "specify a command before redirecting" was never
caught by the invoke() subroutine because the next higher routine,
command(), checked for argv==0 before calling invoke(). The error
message was moved into command().
1998-10-26 17:04:51 +00:00
|
|
|
jsr puts Send initialization string to term.
|
1997-11-18 05:31:00 +00:00
|
|
|
tgetstr (#leid,#area)
|
|
|
|
sta lecap
|
|
|
|
stx lecap+2
|
|
|
|
tgetstr (#ndid,#area)
|
|
|
|
sta ndcap
|
|
|
|
stx ndcap+2
|
|
|
|
tgetstr (#veid,#area)
|
|
|
|
sta vecap
|
|
|
|
stx vecap+2
|
|
|
|
tgetstr (#viid,#area)
|
|
|
|
sta vicap
|
|
|
|
stx vicap+2
|
|
|
|
tgetstr (#vsid,#area)
|
|
|
|
sta vscap
|
|
|
|
stx vscap+2
|
|
|
|
tgetstr (#blid,#area)
|
|
|
|
sta blcap
|
|
|
|
stx blcap+2
|
|
|
|
tgetstr (#clid,#area)
|
|
|
|
sta clcap
|
|
|
|
stx clcap+2
|
|
|
|
tgetstr (#soid,#area)
|
|
|
|
sta socap
|
|
|
|
stx socap+2
|
|
|
|
tgetstr (#seid,#area)
|
|
|
|
sta secap
|
|
|
|
stx secap+2
|
|
|
|
tgetstr (#cdid,#area)
|
|
|
|
sta cdcap
|
|
|
|
stx cdcap+2
|
|
|
|
tgetstr (#ueid,#area)
|
|
|
|
sta uecap
|
|
|
|
stx uecap+2
|
|
|
|
tgetstr (#usid,#area)
|
|
|
|
sta uscap
|
|
|
|
stx uscap+2
|
Changes for gsh version 2.0d5:
Add quotes around null parameters from the command line so they will be
parsed properly (resolves PR#84).
Output piped to an unfound command caused gsh to terminate, due to an
interface change to the GNO 2.0.6 version of getpgrp(2): it now returns the
process group of the caller. To get the process group number for the
pid passed as a parameter pid, the call has to be made to _getpgrp(2).
In addition to fixing invoke.asm, updates were also made in jobs.asm.
When directory stack is full, pushd, reports a new error message: 'pushd:
Directory stack full'. (Previously, 50 pushds would cause a crash.)
When parameter passed to "pushd +n" is <= 0, report a new error message:
'pushd: Invalid number'. (Previously, tried to chdir to the parameter.)
When a command appends to stderr (e.g., echo test >>&/tmp/err), stdin was
closed, due to errappend being defined as pipefds+2 rather than pipefds+4
in cmd.asm.
When there was an error reading stdin, gsh went into an infinite loop of
beeping and requesting more input. Changed getchar (in stdio.asm) and
GetCmdLine (in edit.asm) to report the error and terminate.
Code in cmd.asm set and reset handler for signal SIGSTOP (17). This makes
no sense, since there cannot be a handler for SIGSTOP. This was changed
to set and reset signal SIGTSTP (18) since that handler is used by gsh.
The error message "specify a command before redirecting" was never
caught by the invoke() subroutine because the next higher routine,
command(), checked for argv==0 before calling invoke(). The error
message was moved into command().
1998-10-26 17:04:51 +00:00
|
|
|
|
|
|
|
;
|
|
|
|
; Bind keyboard characters
|
|
|
|
;
|
1997-11-18 05:31:00 +00:00
|
|
|
tgetstr (#klid,#area)
|
1998-09-08 16:53:14 +00:00
|
|
|
phx
|
1997-11-18 05:31:00 +00:00
|
|
|
pha
|
|
|
|
ph2 #backward_char
|
|
|
|
jsl bindkeyfunc
|
|
|
|
tgetstr (#krid,#area)
|
1998-09-08 16:53:14 +00:00
|
|
|
phx
|
1997-11-18 05:31:00 +00:00
|
|
|
pha
|
|
|
|
ph2 #forward_char
|
|
|
|
jsl bindkeyfunc
|
|
|
|
tgetstr (#kuid,#area)
|
1998-09-08 16:53:14 +00:00
|
|
|
phx
|
1997-11-18 05:31:00 +00:00
|
|
|
pha
|
|
|
|
ph2 #up_history
|
|
|
|
jsl bindkeyfunc
|
|
|
|
tgetstr (#kdid,#area)
|
1998-09-08 16:53:14 +00:00
|
|
|
phx
|
1997-11-18 05:31:00 +00:00
|
|
|
pha
|
|
|
|
ph2 #down_history
|
|
|
|
jsl bindkeyfunc
|
|
|
|
|
|
|
|
; the following is VERY important. It doesn't seem so, but I actually tested
|
|
|
|
; a terminal that dropped characters w/o it.
|
|
|
|
|
|
|
|
ioctl (#1,#TIOCGETP,#sgtty)
|
|
|
|
lda sg_ospeed ;let termcap know our speed
|
|
|
|
case on
|
|
|
|
sta >ospeed
|
|
|
|
case off
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
termname gsstr 'term'
|
1997-11-18 05:31:00 +00:00
|
|
|
error1 dc c'Error reading termcap file!',h'0d0d00'
|
|
|
|
error2 dc c'Termcap entry not found for ',h'00'
|
Changes for gsh version 2.0d5:
Add quotes around null parameters from the command line so they will be
parsed properly (resolves PR#84).
Output piped to an unfound command caused gsh to terminate, due to an
interface change to the GNO 2.0.6 version of getpgrp(2): it now returns the
process group of the caller. To get the process group number for the
pid passed as a parameter pid, the call has to be made to _getpgrp(2).
In addition to fixing invoke.asm, updates were also made in jobs.asm.
When directory stack is full, pushd, reports a new error message: 'pushd:
Directory stack full'. (Previously, 50 pushds would cause a crash.)
When parameter passed to "pushd +n" is <= 0, report a new error message:
'pushd: Invalid number'. (Previously, tried to chdir to the parameter.)
When a command appends to stderr (e.g., echo test >>&/tmp/err), stdin was
closed, due to errappend being defined as pipefds+2 rather than pipefds+4
in cmd.asm.
When there was an error reading stdin, gsh went into an infinite loop of
beeping and requesting more input. Changed getchar (in stdio.asm) and
GetCmdLine (in edit.asm) to report the error and terminate.
Code in cmd.asm set and reset handler for signal SIGSTOP (17). This makes
no sense, since there cannot be a handler for SIGSTOP. This was changed
to set and reset signal SIGTSTP (18) since that handler is used by gsh.
The error message "specify a command before redirecting" was never
caught by the invoke() subroutine because the next higher routine,
command(), checked for argv==0 before calling invoke(). The error
message was moved into command().
1998-10-26 17:04:51 +00:00
|
|
|
|
|
|
|
;
|
|
|
|
; Termcap identification strings
|
|
|
|
;
|
|
|
|
isid dc c'is',h'00' Initialization
|
|
|
|
leid dc c'le',h'00' Out of keypad transmit mode
|
|
|
|
ndid dc c'nd',h'00' Non-destructive space
|
|
|
|
veid dc c've',h'00' Normal cursor visible
|
|
|
|
viid dc c'vi',h'00' Cursor unvisible
|
|
|
|
vsid dc c'vs',h'00' Standout cursor
|
|
|
|
blid dc c'bl',h'00' Bell
|
|
|
|
clid dc c'cl',h'00' Clear screen and home cursor
|
|
|
|
soid dc c'so',h'00' Begin standout mode
|
|
|
|
seid dc c'se',h'00' End standout mode
|
|
|
|
cdid dc c'cd',h'00' Clear to end of display
|
|
|
|
ueid dc c'ue',h'00' End underscore mode
|
|
|
|
usid dc c'us',h'00' Begin underscore mode
|
|
|
|
klid dc c'kl',h'00' Left arrow key
|
|
|
|
krid dc c'kr',h'00' Right arrow key
|
|
|
|
kuid dc c'ku',h'00' Up key
|
|
|
|
kdid dc c'kd',h'00' Down key
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
sgtty anop
|
|
|
|
dc i1'0'
|
|
|
|
sg_ospeed dc i1'0'
|
|
|
|
dc i1'0'
|
|
|
|
dc i1'0'
|
|
|
|
sg_flags dc i2'0'
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
; Hold the address of the value of $TERM
|
|
|
|
hold_term_val ds 4
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
END
|
1998-09-08 16:53:14 +00:00
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* outc for outputting characters by termcap
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
outc START
|
|
|
|
|
|
|
|
space equ 0
|
|
|
|
|
|
|
|
subroutine (2:char),space
|
|
|
|
|
|
|
|
lda char
|
|
|
|
jsr putchar
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* move left x characters
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
moveleft START
|
|
|
|
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
lda termok
|
|
|
|
beq done
|
|
|
|
|
|
|
|
loop dex
|
|
|
|
bmi done
|
|
|
|
phx
|
|
|
|
tputs (lecap,#0,#outc)
|
|
|
|
plx
|
|
|
|
bra loop
|
|
|
|
|
|
|
|
done rts
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* move right x characters
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
moveright START
|
|
|
|
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
lda termok
|
|
|
|
beq done
|
|
|
|
|
|
|
|
loop dex
|
|
|
|
bmi done
|
|
|
|
phx
|
|
|
|
tputs (ndcap,#0,#outc)
|
|
|
|
plx
|
|
|
|
bra loop
|
|
|
|
|
|
|
|
done rts
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* cursor off
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
cursoroff START
|
|
|
|
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
lda termok
|
|
|
|
beq done
|
|
|
|
lda vicap
|
|
|
|
ldx vicap+2
|
|
|
|
jmp puts
|
|
|
|
done rts
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* cursor on
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
cursoron START
|
|
|
|
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
lda termok
|
|
|
|
beq done
|
|
|
|
lda insertflag
|
|
|
|
beq dovs
|
|
|
|
|
|
|
|
lda vecap
|
|
|
|
ldx vecap+2
|
|
|
|
jmp puts
|
|
|
|
|
|
|
|
dovs lda vscap
|
|
|
|
ldx vscap+2
|
|
|
|
jmp puts
|
|
|
|
done rts
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* Beep the bell if it's ok.
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
beep START
|
|
|
|
|
|
|
|
using vardata
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
lda varnobeep
|
|
|
|
bne beepdone
|
|
|
|
lda termok
|
|
|
|
beq beepdone
|
|
|
|
tputs (blcap,#0,#outc)
|
|
|
|
beepdone rts
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* clear the screen
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
clearscrn START
|
|
|
|
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
lda termok
|
|
|
|
beq done
|
|
|
|
tputs (clcap,#0,#outc)
|
|
|
|
done rts
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* begin standout mode
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
standout START
|
|
|
|
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
lda termok
|
|
|
|
beq done
|
|
|
|
|
|
|
|
tputs (socap,#0,#outc)
|
|
|
|
|
|
|
|
done rts
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* end standout mode
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
standend START
|
|
|
|
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
lda termok
|
|
|
|
beq done
|
|
|
|
|
|
|
|
tputs (secap,#0,#outc)
|
|
|
|
|
|
|
|
done rts
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* begin underline mode
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
underline START
|
|
|
|
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
lda termok
|
|
|
|
beq done
|
|
|
|
|
|
|
|
tputs (uscap,#0,#outc)
|
|
|
|
|
|
|
|
done rts
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* end underline mode
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
underend START
|
|
|
|
|
|
|
|
using termdata
|
|
|
|
|
|
|
|
lda termok
|
|
|
|
beq done
|
|
|
|
|
|
|
|
tputs (uecap,#0,#outc)
|
|
|
|
|
|
|
|
done rts
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* TSET: builtin command
|
|
|
|
* syntax: tset
|
|
|
|
*
|
|
|
|
* reset the termcap for gsh
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
tset START
|
|
|
|
|
|
|
|
using global
|
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
status equ 0
|
|
|
|
space equ status+2
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
subroutine (4:argv,2:argc),space
|
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
stz status
|
|
|
|
lda argc
|
|
|
|
dec a
|
|
|
|
beq doterm
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-12-21 23:57:08 +00:00
|
|
|
ldx #^Usage
|
|
|
|
lda #Usage
|
|
|
|
jsr errputs
|
|
|
|
inc status Return status = 1.
|
|
|
|
bra exit
|
|
|
|
|
|
|
|
doterm jsr readterm
|
|
|
|
|
|
|
|
exit return 2:status
|
|
|
|
|
|
|
|
usage dc c'Usage: tset',h'0d00'
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* termcap data
|
|
|
|
*
|
|
|
|
**************************************************************************
|
|
|
|
|
|
|
|
termdata DATA
|
|
|
|
|
|
|
|
didReadTerm dc i2'0'
|
|
|
|
|
|
|
|
termok dc i2'0'
|
1998-09-08 16:53:14 +00:00
|
|
|
insertflag dc i2'1'
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
bp ds 4
|
|
|
|
areabuf ds 4
|
|
|
|
area ds 4
|
|
|
|
|
|
|
|
blcap ds 4
|
|
|
|
cdcap ds 4
|
|
|
|
clcap ds 4
|
|
|
|
lecap ds 4
|
|
|
|
ndcap ds 4
|
|
|
|
secap ds 4
|
|
|
|
socap ds 4
|
|
|
|
uecap ds 4
|
|
|
|
uscap ds 4
|
|
|
|
vecap ds 4
|
|
|
|
vicap ds 4
|
|
|
|
vscap ds 4
|
|
|
|
|
|
|
|
END
|
1998-09-08 16:53:14 +00:00
|
|
|
|