1998-07-20 16:23:11 +00:00
|
|
|
**************************************************************************
|
|
|
|
* Macros used by gsh, the GNO shell.
|
|
|
|
*
|
|
|
|
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
|
|
|
|
* | | | | | |
|
|
|
|
* ^ ^ ^ ^ ^ ^
|
|
|
|
**************************************************************************
|
1998-06-09 16:22:56 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
; ------------------
|
|
|
|
; GNO/ME subroutine calls
|
|
|
|
; ------------------
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* dup2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab dup2 &a1
|
|
|
|
&lab ph2 &a1(2)
|
|
|
|
ph2 &a1(1)
|
|
|
|
case on
|
|
|
|
jsl dup2
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* fork
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab fork &a1
|
|
|
|
&lab ph4 &a1
|
|
|
|
case on
|
|
|
|
jsl fork
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +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
|
|
|
* _getpgrp
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
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
|
|
|
&lab _getpgrp &a1
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab ph2 &a1
|
|
|
|
case on
|
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
|
|
|
jsl _getpgrp
|
1998-07-20 16:23:11 +00:00
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* getpid
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab getpid
|
|
|
|
&lab case on
|
|
|
|
jsl getpid
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* getuid
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab getuid
|
|
|
|
&lab case on
|
|
|
|
jsl getuid
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ioctl
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab ioctl &a1
|
|
|
|
&lab ph4 &a1(3)
|
|
|
|
ph4 &a1(2)
|
|
|
|
ph2 &a1(1)
|
|
|
|
case on
|
|
|
|
jsl ioctl
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* kernstatus
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab kernStatus &a1
|
|
|
|
&lab pha
|
|
|
|
ldx #$603
|
|
|
|
jsl $E10008
|
|
|
|
pl2 &a1
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* kill
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab kill &a1
|
|
|
|
&lab ph2 &a1(2)
|
|
|
|
ph2 &a1(1)
|
|
|
|
case on
|
|
|
|
jsl kill
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* kvm_close
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab kvm_close &a1
|
|
|
|
&lab ph4 &a1
|
|
|
|
case on
|
|
|
|
jsl kvm_close
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* kvm_open
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab kvm_open
|
|
|
|
&lab case on
|
|
|
|
jsl kvm_open
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* kvmgetproc
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab kvmgetproc &a1
|
|
|
|
&lab ph2 &a1(2)
|
|
|
|
ph4 &a1(1)
|
|
|
|
case on
|
|
|
|
jsl kvmgetproc
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* kvmnextproc
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab kvmnextproc &a1
|
|
|
|
&lab ph4 &a1
|
|
|
|
case on
|
|
|
|
jsl kvmnextproc
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* pipe
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab pipe &a1
|
1998-06-09 16:22:56 +00:00
|
|
|
&lab ph4 &a1
|
1998-07-20 16:23:11 +00:00
|
|
|
case on
|
|
|
|
jsl pipe
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* screate
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab screate &a1
|
|
|
|
&lab ph2 &a1
|
|
|
|
case on
|
|
|
|
jsl screate
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* sdelete
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab sdelete &a1
|
|
|
|
&lab ph2 &a1
|
1998-06-09 16:22:56 +00:00
|
|
|
case on
|
1998-07-20 16:23:11 +00:00
|
|
|
jsl sdelete
|
1998-06-09 16:22:56 +00:00
|
|
|
case off
|
|
|
|
MEND
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* screate
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab screate &a1
|
|
|
|
&lab ph2 &a1
|
|
|
|
case on
|
|
|
|
jsl screate
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* sdelete
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab sdelete &a1
|
|
|
|
&lab ph2 &a1
|
|
|
|
case on
|
|
|
|
jsl sdelete
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* setsystemvector
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab setsystemvector &a1
|
1998-06-09 16:22:56 +00:00
|
|
|
&lab ph4 &a1
|
1998-07-20 16:23:11 +00:00
|
|
|
case on
|
|
|
|
jsl setsystemvector
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* settpgrp
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab settpgrp &a1
|
|
|
|
&lab ph2 &a1
|
|
|
|
case on
|
|
|
|
jsl settpgrp
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* sigblock
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab sigblock &a1
|
|
|
|
&lab ph4 &a1
|
|
|
|
case on
|
|
|
|
jsl sigblock
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
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
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* signal
|
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
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab signal &a1
|
|
|
|
&lab ph4 &a1(2)
|
|
|
|
ph2 &a1(1)
|
|
|
|
case on
|
|
|
|
jsl signal
|
|
|
|
case off
|
|
|
|
MEND
|
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
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* sigpause
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab sigpause &a1
|
|
|
|
&lab ph4 &a1
|
|
|
|
case on
|
|
|
|
jsl sigpause
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* sigsetmask
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab sigsetmask &a1
|
|
|
|
&lab ph4 &a1
|
|
|
|
case on
|
|
|
|
jsl sigsetmask
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ssignal
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab ssignal &a1
|
|
|
|
&lab ph2 &a1
|
1998-06-09 16:22:56 +00:00
|
|
|
case on
|
1998-07-20 16:23:11 +00:00
|
|
|
jsl ssignal
|
1998-06-09 16:22:56 +00:00
|
|
|
case off
|
|
|
|
MEND
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* swait
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab swait &a1
|
|
|
|
&lab ph2 &a1
|
|
|
|
case on
|
|
|
|
jsl swait
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* tcnewpgrp
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab tcnewpgrp &a1
|
|
|
|
&lab ph2 &a1
|
|
|
|
case on
|
|
|
|
jsl tcnewpgrp
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* tctpgrp
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab tctpgrp &a1
|
|
|
|
&lab ph2 &a1(2)
|
|
|
|
ph2 &a1(1)
|
|
|
|
case on
|
|
|
|
jsl tctpgrp
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* tgetent
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab tgetent &a1
|
|
|
|
&lab ph4 &a1(2)
|
|
|
|
ph4 &a1(1)
|
1998-06-09 16:22:56 +00:00
|
|
|
case on
|
1998-07-20 16:23:11 +00:00
|
|
|
jsl tgetent
|
1998-06-09 16:22:56 +00:00
|
|
|
case off
|
|
|
|
MEND
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* tgetstr
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab tgetstr &a1
|
|
|
|
&lab ph4 &a1(2)
|
|
|
|
ph4 &a1(1)
|
|
|
|
case on
|
|
|
|
jsl tgetstr
|
1998-06-09 16:22:56 +00:00
|
|
|
case off
|
|
|
|
MEND
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* tputs
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab tputs &a1
|
|
|
|
&lab ph4 &a1(3)
|
|
|
|
ph2 &a1(2)
|
|
|
|
ph4 &a1(1)
|
|
|
|
case on
|
|
|
|
jsl tputs
|
|
|
|
case off
|
|
|
|
MEND
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* wait
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab wait &a1
|
|
|
|
&lab ph4 &a1
|
|
|
|
case on
|
|
|
|
jsl wait
|
1998-06-09 16:22:56 +00:00
|
|
|
case off
|
|
|
|
MEND
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
; ------------------
|
|
|
|
; GS/OS calls
|
|
|
|
; ------------------
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* Close
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab Close &a1
|
|
|
|
&lab gsos $2014,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* Create
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab Create &a1
|
|
|
|
&lab gsos $2001,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* Destroy
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab Destroy &a1
|
|
|
|
&lab gsos $2002,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* DInfo
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab DInfo &a1
|
|
|
|
&lab gsos $202C,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ExpandPath
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&lab ExpandPath &a1
|
|
|
|
&lab gsos $200E,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
********************
|
|
|
|
* Flush
|
|
|
|
********************
|
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
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab Flush &a1
|
|
|
|
&lab gsos $2015,&a1
|
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
|
|
|
mend
|
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* GetBootVol
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&lab GetBootVol &a1
|
|
|
|
&lab gsos $2028,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* GetDirEntry
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab GetDirEntry &a1
|
|
|
|
&lab gsos $201C,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* GetFileInfo
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab GetFileInfo &a1
|
|
|
|
&lab gsos $2006,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* GetPrefix
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab GetPrefix &a1
|
|
|
|
&lab gsos $200A,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* NewLine
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab NewLine &a1
|
|
|
|
&lab gsos $2011,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* Open
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab Open &a1
|
|
|
|
&lab gsos $2010,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* Quit
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab Quit &a1
|
|
|
|
&lab gsos $2029,&a1
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* Read
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab Read &a1
|
|
|
|
&lab gsos $2012,&a1
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* SetPrefix
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab SetPrefix &a1
|
|
|
|
&lab gsos $2009,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* Volume
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab Volume &a1
|
|
|
|
&lab gsos $2008,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* Write
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab Write &a1
|
|
|
|
&lab gsos $2013,&a1
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
1998-07-20 16:23:11 +00:00
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* gsos
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab gsos &a1,&a2
|
|
|
|
&lab jsl $E100A8
|
|
|
|
dc i2'&a1'
|
|
|
|
dc i4'&a2'
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
; ------------------
|
|
|
|
; Shell calls
|
|
|
|
; ------------------
|
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ErrorGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&l ErrorGS &p
|
|
|
|
&l ShellGS $0145,&p
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ExportGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l ExportGS &p
|
|
|
|
&l ShellGS $0156,&p
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* InitWildcardGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l InitWildcardGS &p
|
|
|
|
&l ShellGS $0149,&p
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* NextWildcardGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l NextWildcardGS &p
|
|
|
|
&l ShellGS $014A,&p
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* PopVariablesGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l PopVariablesGS &p
|
|
|
|
&l ShellGS $0157,&p
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* PushVariablesGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l PushVariablesGS &p
|
|
|
|
&l ShellGS $0158,&p
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ReadIndexedGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l ReadIndexedGS &p
|
|
|
|
&l ShellGS $0148,&p
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ReadVariableGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l ReadVariableGS &p
|
|
|
|
&l ShellGS $014B,&p
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* RedirectGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l RedirectGS &p
|
|
|
|
&l ShellGS $0150,&p
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* SetLInfoGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l SetLInfoGS &p
|
|
|
|
&l ShellGS $0142,&p
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* SetGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l SetGS &p
|
|
|
|
&l ShellGS $0146,&p
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
1998-07-20 16:23:11 +00:00
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* UnsetVariableGS
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&l UnsetVariableGS &p
|
|
|
|
&l ShellGS $0155,&p
|
|
|
|
mend
|
|
|
|
|
|
|
|
***********************************************
|
|
|
|
* ShellGS: Jump into OS for a shell call
|
|
|
|
***********************************************
|
1998-06-09 16:22:56 +00:00
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab ShellGS &a1,&a2
|
|
|
|
&lab jsl $E100A8
|
|
|
|
dc i2'&a1'
|
|
|
|
dc i4'&a2'
|
|
|
|
mend
|
|
|
|
|
|
|
|
; ------------------
|
|
|
|
; Debugging
|
|
|
|
; ------------------
|
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* setdebug
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab setdebug &a1
|
|
|
|
&lab ph2 &a1
|
|
|
|
case on
|
|
|
|
jsl setdebug
|
|
|
|
case off
|
|
|
|
MEND
|
|
|
|
|
|
|
|
********************
|
|
|
|
* name
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab name
|
1998-06-09 16:22:56 +00:00
|
|
|
&lab anop
|
1998-07-20 16:23:11 +00:00
|
|
|
aif DebugSymbols=0,.pastName
|
|
|
|
brl pastName&SYSCNT
|
|
|
|
dc i'$7771'
|
|
|
|
dc i1'L:&lab',c'&lab'
|
|
|
|
pastName&SYSCNT anop
|
|
|
|
.pastName
|
|
|
|
MEND
|
|
|
|
|
|
|
|
; ------------------
|
|
|
|
; Data Structures
|
|
|
|
; ------------------
|
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
*****************************
|
|
|
|
* GSStr: GS/OS output string
|
|
|
|
*****************************
|
1998-06-09 16:22:56 +00:00
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab GSStr &string
|
|
|
|
&lab dc i2'L:&string'
|
|
|
|
dc c"&string"
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
; ------------------
|
|
|
|
; Branch
|
|
|
|
; ------------------
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* if2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab if2 &var,&rel,&val,&label
|
|
|
|
&lab ago .skip
|
|
|
|
ble
|
|
|
|
bgt
|
|
|
|
.skip
|
1998-06-09 16:22:56 +00:00
|
|
|
lclc &char1
|
|
|
|
lclc &char2
|
1998-07-20 16:23:11 +00:00
|
|
|
&char1 amid &var,1,1
|
|
|
|
&char2 amid &var,2,1
|
|
|
|
aif "&char1"="@",.index
|
|
|
|
lda &var
|
|
|
|
.cmp
|
|
|
|
cmp &val
|
|
|
|
ago .branch
|
|
|
|
.index
|
|
|
|
aif "&char2"="x",.x1
|
|
|
|
aif "&char2"="X",.x1
|
|
|
|
aif "&char2"="y",.y1
|
|
|
|
aif "&char2"="Y",.y1
|
|
|
|
ago ^cmp
|
|
|
|
.x1
|
|
|
|
cpx &val
|
|
|
|
ago .branch
|
|
|
|
.y1
|
|
|
|
cpy &val
|
|
|
|
.branch
|
|
|
|
&char1 amid &rel,1,1
|
|
|
|
aif "&char1"="@",.done
|
|
|
|
b&rel &label
|
1998-06-09 16:22:56 +00:00
|
|
|
.done
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* bgt
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab bgt &loc
|
|
|
|
&lab beq *+4
|
|
|
|
bcs &loc
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ble
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab ble &loc
|
|
|
|
&lab bcc &loc
|
|
|
|
beq &loc
|
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
|
|
|
mend
|
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* jcc
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab jcc &loc
|
|
|
|
&lab bcs *+5
|
|
|
|
jmp &loc
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* jcs
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&lab jcs &loc
|
|
|
|
&lab bcc *+5
|
|
|
|
jmp &loc
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* jeq
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab jeq &loc
|
|
|
|
&lab bne *+5
|
|
|
|
jmp &loc
|
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
|
|
|
mend
|
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* jge
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab jge &loc
|
|
|
|
&lab bcc *+5
|
|
|
|
jmp &loc
|
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
|
|
|
mend
|
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* jmi
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab jmi &loc
|
|
|
|
&lab bpl *+5
|
|
|
|
jmp &loc
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* jne
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab jne &loc
|
|
|
|
&lab beq *+5
|
|
|
|
jmp &loc
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
; ------------------
|
|
|
|
; Enter and exit subroutine
|
|
|
|
; ------------------
|
1998-06-09 16:22:56 +00:00
|
|
|
|
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
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* subroutine
|
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
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab subroutine &parms,&work
|
|
|
|
&lab anop
|
|
|
|
aif c:&work,.a
|
|
|
|
lclc &work
|
|
|
|
&work setc 0
|
|
|
|
.a
|
|
|
|
gbla &totallen
|
|
|
|
gbla &worklen
|
|
|
|
&worklen seta &work
|
|
|
|
&totallen seta 0
|
|
|
|
aif c:&parms=0,.e
|
|
|
|
lclc &len
|
|
|
|
lclc &p
|
|
|
|
lcla &i
|
|
|
|
&i seta c:&parms
|
|
|
|
.b
|
|
|
|
&p setc &parms(&i)
|
|
|
|
&len amid &p,2,1
|
|
|
|
aif "&len"=":",.c
|
|
|
|
&len amid &p,1,2
|
|
|
|
&p amid &p,4,l:&p-3
|
|
|
|
ago .d
|
|
|
|
.c
|
|
|
|
&len amid &p,1,1
|
|
|
|
&p amid &p,3,l:&p-2
|
|
|
|
.d
|
|
|
|
&p equ &totallen+3+&work
|
|
|
|
&totallen seta &totallen+&len
|
|
|
|
&i seta &i-1
|
|
|
|
aif &i,^b
|
|
|
|
.e
|
|
|
|
tsc
|
|
|
|
sec
|
|
|
|
sbc #&work
|
|
|
|
tcs
|
|
|
|
inc a
|
|
|
|
phd
|
|
|
|
tcd
|
|
|
|
phb
|
|
|
|
phk
|
|
|
|
plb
|
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
|
|
|
mend
|
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* return
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab return &r
|
1998-06-09 16:22:56 +00:00
|
|
|
&lab anop
|
|
|
|
lclc &len
|
|
|
|
aif c:&r,.a
|
|
|
|
lclc &r
|
|
|
|
&r setc 0
|
|
|
|
&len setc 0
|
|
|
|
ago .h
|
|
|
|
.a
|
|
|
|
&len amid &r,2,1
|
|
|
|
aif "&len"=":",.b
|
|
|
|
&len amid &r,1,2
|
|
|
|
&r amid &r,4,l:&r-3
|
|
|
|
ago .c
|
|
|
|
.b
|
|
|
|
&len amid &r,1,1
|
|
|
|
&r amid &r,3,l:&r-2
|
|
|
|
.c
|
|
|
|
aif &len<>2,.d
|
|
|
|
ldy &r
|
|
|
|
ago .h
|
|
|
|
.d
|
|
|
|
aif &len<>4,.e
|
|
|
|
ldx &r+2
|
|
|
|
ldy &r
|
|
|
|
ago .h
|
|
|
|
.e
|
|
|
|
aif &len<>10,.g
|
|
|
|
ldy #&r
|
|
|
|
ldx #^&r
|
|
|
|
ago .h
|
|
|
|
.g
|
1998-07-20 16:23:11 +00:00
|
|
|
mnote 'Not a valid return length',16
|
1998-06-09 16:22:56 +00:00
|
|
|
mexit
|
|
|
|
.h
|
|
|
|
aif &totallen=0,.i
|
|
|
|
lda &worklen+1
|
|
|
|
sta &worklen+&totallen+1
|
|
|
|
lda &worklen
|
|
|
|
sta &worklen+&totallen
|
|
|
|
.i
|
|
|
|
plb
|
|
|
|
pld
|
|
|
|
tsc
|
|
|
|
clc
|
|
|
|
adc #&worklen+&totallen
|
|
|
|
tcs
|
|
|
|
aif &len=0,.j
|
|
|
|
tya
|
|
|
|
.j
|
|
|
|
rtl
|
|
|
|
mend
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
; ------------------
|
|
|
|
; Change size of memory or index register access
|
|
|
|
; ------------------
|
|
|
|
|
|
|
|
********************
|
|
|
|
* long
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab long &stat
|
|
|
|
&lab anop
|
|
|
|
lcla &t
|
|
|
|
lcla &len
|
|
|
|
lclc &ch
|
|
|
|
&t seta 0
|
|
|
|
&len seta l:&stat
|
|
|
|
.a
|
|
|
|
aif &len=0,.b
|
|
|
|
&ch amid &stat,&len,1
|
|
|
|
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
|
|
|
aif ("&ch"="a").or.("&ch"="m"),.m
|
|
|
|
.c
|
|
|
|
&len seta &len-1
|
|
|
|
ago ^a
|
|
|
|
.i
|
|
|
|
longi on
|
|
|
|
&t seta &t+16
|
|
|
|
ago ^c
|
|
|
|
.m
|
|
|
|
longa on
|
|
|
|
&t seta &t+32
|
|
|
|
ago ^c
|
|
|
|
.b
|
|
|
|
aif &t=0,.d
|
|
|
|
rep #&t
|
|
|
|
.d
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* short
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab short &stat
|
|
|
|
&lab anop
|
|
|
|
lcla &t
|
|
|
|
lcla &len
|
|
|
|
lclc &ch
|
|
|
|
&t seta 0
|
|
|
|
&len seta l:&stat
|
|
|
|
.a
|
|
|
|
aif &len=0,.b
|
|
|
|
&ch amid &stat,&len,1
|
|
|
|
aif ("&ch"="x").or.("&ch"="y").or.("&ch"="i"),.i
|
|
|
|
aif ("&ch"="a").or.("&ch"="m"),.m
|
|
|
|
.c
|
|
|
|
&len seta &len-1
|
|
|
|
ago ^a
|
|
|
|
.i
|
|
|
|
longi off
|
|
|
|
&t seta &t+16
|
|
|
|
ago ^c
|
|
|
|
.m
|
|
|
|
longa off
|
|
|
|
&t seta &t+32
|
|
|
|
ago ^c
|
|
|
|
.b
|
|
|
|
aif &t=0,.d
|
|
|
|
sep #&t
|
|
|
|
.d
|
|
|
|
mend
|
|
|
|
|
|
|
|
; ------------------
|
|
|
|
; Math toolbox calls
|
|
|
|
; ------------------
|
|
|
|
|
|
|
|
********************
|
|
|
|
* Dec2Int
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab Dec2Int &a1,&a2
|
|
|
|
&lab pha
|
|
|
|
ph4 &a1(1)
|
|
|
|
ph2 &a1(2)
|
|
|
|
ph2 &a1(3)
|
|
|
|
Tool $280b
|
|
|
|
pl2 &a2
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* Int2Dec
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab Int2Dec &a1
|
|
|
|
&lab ph2 &a1(1)
|
|
|
|
ph4 &a1(2)
|
|
|
|
ph2 &a1(3)
|
|
|
|
ph2 &a1(4)
|
|
|
|
Tool $260b
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* Int2Hex
|
|
|
|
********************
|
|
|
|
macro
|
|
|
|
&lab Int2Hex &a1
|
|
|
|
&lab ph2 &a1(1)
|
|
|
|
ph4 &a1(2)
|
|
|
|
ph2 &a1(3)
|
|
|
|
Tool $220b
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* Long2Dec
|
|
|
|
********************
|
|
|
|
macro
|
|
|
|
&lab Long2Dec &a1
|
|
|
|
&lab ph4 &a1(1)
|
|
|
|
ph4 &a1(2)
|
|
|
|
ph2 &a1(3)
|
|
|
|
ph2 &a1(4)
|
|
|
|
Tool $270b
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* LongDivide
|
|
|
|
********************
|
|
|
|
macro
|
|
|
|
&lab LongDivide &a1,&a2
|
|
|
|
&lab pha
|
|
|
|
pha
|
|
|
|
pha
|
|
|
|
pha
|
|
|
|
ph4 &a1(1)
|
|
|
|
ph4 &a1(2)
|
|
|
|
Tool $0d0b
|
|
|
|
pl4 &a2(1)
|
|
|
|
pl4 &a2(2)
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* LongMul
|
|
|
|
********************
|
|
|
|
macro
|
|
|
|
&lab LongMul &a1,&a2
|
|
|
|
&lab pha
|
|
|
|
pha
|
|
|
|
pha
|
|
|
|
pha
|
|
|
|
ph4 &a1(1)
|
|
|
|
ph4 &a1(2)
|
|
|
|
Tool $0c0b
|
|
|
|
pl4 &a2(1)
|
|
|
|
pl4 &a2(2)
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* UDivide
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab UDivide &a1,&a2
|
|
|
|
&lab pha
|
|
|
|
pha
|
|
|
|
ph2 &a1(1)
|
|
|
|
ph2 &a1(2)
|
|
|
|
Tool $0b0b
|
|
|
|
pl2 &a2(1)
|
|
|
|
pl2 &a2(2)
|
|
|
|
mend
|
|
|
|
|
|
|
|
|
|
|
|
; ------------------
|
|
|
|
; Memory manager toolbox calls
|
|
|
|
; ------------------
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* DisposeHandle
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&lab DisposeHandle &a1
|
|
|
|
&lab ph4 &a1
|
|
|
|
tool $1002
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* FindHandle
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab FindHandle &a1,&a2
|
|
|
|
&lab pha
|
|
|
|
pha
|
|
|
|
ph4 &a1
|
|
|
|
tool $1a02
|
|
|
|
pl4 &a2
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* NewHandle
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab NewHandle &a1,&a2
|
|
|
|
&lab pha
|
|
|
|
pha
|
|
|
|
ph4 &a1(1)
|
|
|
|
ph2 &a1(2)
|
|
|
|
ph2 &a1(3)
|
|
|
|
ph4 &a1(4)
|
|
|
|
tool $0902
|
|
|
|
pl4 &a2
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
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
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* PtrToHand
|
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
|
|
|
********************
|
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab PtrToHand &a1
|
|
|
|
&lab ph4 &a1(1)
|
|
|
|
ph4 &a1(2)
|
|
|
|
ph4 &a1(3)
|
|
|
|
tool $2802
|
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
|
|
|
mend
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
; ------------------
|
|
|
|
; Text toolbox calls
|
|
|
|
; ------------------
|
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
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ErrWriteCString
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&lab ErrWriteCString &a1
|
|
|
|
&lab ph4 &a1
|
|
|
|
Tool $210c
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* ErrWriteLine
|
|
|
|
********************
|
|
|
|
macro
|
|
|
|
&lab ErrWriteLine &a1
|
|
|
|
&lab ph4 &a1
|
|
|
|
Tool $1b0c
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* ReadLine
|
|
|
|
********************
|
|
|
|
macro
|
|
|
|
&lab ReadLine &a1,&a2
|
|
|
|
&lab pha
|
|
|
|
ph4 &a1(1)
|
|
|
|
ph2 &a1(2)
|
|
|
|
ph2 &a1(3)
|
|
|
|
ph2 &a1(4)
|
|
|
|
Tool $240c
|
|
|
|
pl2 &a2
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* SetInGlobals
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab SetInGlobals &a1
|
1998-06-09 16:22:56 +00:00
|
|
|
&lab ph2 &a1(1)
|
|
|
|
ph2 &a1(2)
|
|
|
|
Tool $090c
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* SetInputDevice
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab SetInputDevice &a1
|
1998-06-09 16:22:56 +00:00
|
|
|
&lab ph2 &a1(1)
|
|
|
|
ph4 &a1(2)
|
|
|
|
Tool $0f0c
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* SetOutputDevice
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab SetOutputDevice &a1
|
1998-06-09 16:22:56 +00:00
|
|
|
&lab ph2 &a1(1)
|
|
|
|
ph4 &a1(2)
|
|
|
|
Tool $100c
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* WriteChar
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab WriteChar &a1
|
|
|
|
&lab ph2 &a1
|
|
|
|
Tool $180c
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* WriteCString
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab WriteCString &a1
|
1998-06-09 16:22:56 +00:00
|
|
|
&lab ph4 &a1
|
1998-07-20 16:23:11 +00:00
|
|
|
Tool $200c
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* WriteString
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab WriteString &a1
|
1998-06-09 16:22:56 +00:00
|
|
|
&lab ph4 &a1
|
1998-07-20 16:23:11 +00:00
|
|
|
Tool $1c0c
|
|
|
|
mend
|
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
; ------------------
|
|
|
|
; Miscellaneous toolbox calls
|
|
|
|
; ------------------
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ReadTimeHex
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab ReadTimeHex &a1
|
|
|
|
&lab pha
|
|
|
|
pha
|
|
|
|
pha
|
|
|
|
pha
|
|
|
|
tool $0d03
|
|
|
|
pl2 &a1(1)
|
|
|
|
pl2 &a1(2)
|
|
|
|
pl2 &a1(3)
|
|
|
|
pl2 &a1(4)
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* tool
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab tool &a1
|
|
|
|
&lab ldx #&a1
|
|
|
|
jsl $e10000
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
; ------------------
|
|
|
|
; Math & bit manipulation instructions
|
|
|
|
; ------------------
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* add2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab add2 &arg1,&arg2,&dest
|
1998-06-09 16:22:56 +00:00
|
|
|
lclc &char
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab clc
|
1998-06-09 16:22:56 +00:00
|
|
|
&char amid &arg1,1,1
|
|
|
|
aif "&char"="@",.at1
|
|
|
|
lda &arg1
|
1998-07-20 16:23:11 +00:00
|
|
|
ago .add
|
1998-06-09 16:22:56 +00:00
|
|
|
.at1
|
|
|
|
&char amid &arg1,2,1
|
|
|
|
aif "&char"="x",.x1
|
|
|
|
aif "&char"="X",.x1
|
|
|
|
aif "&char"="y",.y1
|
|
|
|
aif "&char"="Y",.y1
|
1998-07-20 16:23:11 +00:00
|
|
|
ago .add
|
1998-06-09 16:22:56 +00:00
|
|
|
.x1
|
|
|
|
txa
|
1998-07-20 16:23:11 +00:00
|
|
|
ago .add
|
1998-06-09 16:22:56 +00:00
|
|
|
.y1
|
|
|
|
tya
|
1998-07-20 16:23:11 +00:00
|
|
|
.add
|
|
|
|
adc &arg2
|
1998-06-09 16:22:56 +00:00
|
|
|
&char amid &dest,1,1
|
|
|
|
aif "&char"="@",.at2
|
|
|
|
sta &dest
|
|
|
|
ago .b
|
|
|
|
.at2
|
|
|
|
&char amid &dest,2,1
|
|
|
|
aif "&char"="x",.x2
|
|
|
|
aif "&char"="X",.x2
|
|
|
|
aif "&char"="y",.y2
|
|
|
|
aif "&char"="Y",.y2
|
|
|
|
ago .b
|
|
|
|
.x2
|
|
|
|
tax
|
|
|
|
ago .b
|
|
|
|
.y2
|
|
|
|
tay
|
|
|
|
.b
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* add4
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab add4 &arg1,&arg2,&dest
|
1998-06-09 16:22:56 +00:00
|
|
|
&lab anop
|
|
|
|
lclc &ch
|
|
|
|
&ch amid &arg2,1,1
|
1998-07-20 16:23:11 +00:00
|
|
|
clc
|
1998-06-09 16:22:56 +00:00
|
|
|
lda &arg1
|
1998-07-20 16:23:11 +00:00
|
|
|
adc &arg2
|
1998-06-09 16:22:56 +00:00
|
|
|
sta &dest
|
|
|
|
lda &arg1+2
|
|
|
|
aif "&ch"="#",.a
|
1998-07-20 16:23:11 +00:00
|
|
|
adc &arg2+2
|
1998-06-09 16:22:56 +00:00
|
|
|
ago .b
|
|
|
|
.a
|
1998-07-20 16:23:11 +00:00
|
|
|
adc &arg2|-16
|
|
|
|
.b
|
|
|
|
sta &dest+2
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* and2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab and2 &arg1,&arg2,&dest
|
|
|
|
&lab anop
|
|
|
|
lclc &char
|
|
|
|
&char amid &arg1,1,1
|
|
|
|
aif "&char"="@",.at1
|
|
|
|
lda &arg1
|
|
|
|
ago .add
|
|
|
|
.at1
|
|
|
|
&char amid &arg1,2,1
|
|
|
|
aif "&char"="x",.x1
|
|
|
|
aif "&char"="X",.x1
|
|
|
|
aif "&char"="y",.y1
|
|
|
|
aif "&char"="Y",.y1
|
|
|
|
ago .add
|
|
|
|
.x1
|
|
|
|
txa
|
|
|
|
ago .add
|
|
|
|
.y1
|
|
|
|
tya
|
|
|
|
.add
|
|
|
|
and &arg2
|
|
|
|
&char amid &dest,1,1
|
|
|
|
aif "&char"="@",.at2
|
|
|
|
sta &dest
|
|
|
|
ago .b
|
|
|
|
.at2
|
|
|
|
&char amid &dest,2,1
|
|
|
|
aif "&char"="x",.x2
|
|
|
|
aif "&char"="X",.x2
|
|
|
|
aif "&char"="y",.y2
|
|
|
|
aif "&char"="Y",.y2
|
|
|
|
ago .b
|
|
|
|
.x2
|
|
|
|
tax
|
|
|
|
ago .b
|
|
|
|
.y2
|
|
|
|
tay
|
|
|
|
.b
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* asl2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab asl2 &a
|
|
|
|
&lab asl &a
|
|
|
|
asl &a
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* asl3
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab asl3 &a
|
|
|
|
&lab asl &a
|
|
|
|
asl &a
|
|
|
|
asl &a
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* asl4
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab asl4 &a
|
|
|
|
&lab asl &a
|
|
|
|
asl &a
|
|
|
|
asl &a
|
|
|
|
asl &a
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* dec2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab dec2 &a
|
|
|
|
&lab dec &a
|
|
|
|
dec &a
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* dey2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab dey2
|
|
|
|
&lab dey
|
|
|
|
dey
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* dey4
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab dey4
|
|
|
|
&lab dey
|
|
|
|
dey
|
|
|
|
dey
|
|
|
|
dey
|
1998-06-09 16:22:56 +00:00
|
|
|
MEND
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* eor2
|
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
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
MACRO
|
|
|
|
&lab eor2 &arg1,&arg2,&dest
|
|
|
|
&lab anop
|
|
|
|
lclc &char
|
|
|
|
&char amid &arg1,1,1
|
|
|
|
aif "&char"="@",.at1
|
|
|
|
lda &arg1
|
|
|
|
ago .add
|
|
|
|
.at1
|
|
|
|
&char amid &arg1,2,1
|
|
|
|
aif "&char"="x",.x1
|
|
|
|
aif "&char"="X",.x1
|
|
|
|
aif "&char"="y",.y1
|
|
|
|
aif "&char"="Y",.y1
|
|
|
|
ago .add
|
|
|
|
.x1
|
|
|
|
txa
|
|
|
|
ago .add
|
|
|
|
.y1
|
|
|
|
tya
|
|
|
|
.add
|
|
|
|
eor &arg2
|
|
|
|
&char amid &dest,1,1
|
|
|
|
aif "&char"="@",.at2
|
|
|
|
sta &dest
|
|
|
|
ago .b
|
|
|
|
.at2
|
|
|
|
&char amid &dest,2,1
|
|
|
|
aif "&char"="x",.x2
|
|
|
|
aif "&char"="X",.x2
|
|
|
|
aif "&char"="y",.y2
|
|
|
|
aif "&char"="Y",.y2
|
|
|
|
ago .b
|
|
|
|
.x2
|
|
|
|
tax
|
|
|
|
ago .b
|
|
|
|
.y2
|
|
|
|
tay
|
|
|
|
.b
|
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
|
|
|
mend
|
|
|
|
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* inc2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
macro
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab inc2 &a
|
|
|
|
&lab inc &a
|
|
|
|
inc &a
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* inx2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab inx2
|
|
|
|
&lab inx
|
|
|
|
inx
|
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* inx4
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
macro
|
|
|
|
&lab inx4
|
|
|
|
&lab inx
|
|
|
|
inx
|
|
|
|
inx
|
|
|
|
inx
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* iny2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab iny2
|
|
|
|
&lab iny
|
|
|
|
iny
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* iny4
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab iny4
|
|
|
|
&lab iny
|
|
|
|
iny
|
|
|
|
iny
|
|
|
|
iny
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* LD2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab LD2 &val,&adr
|
|
|
|
&lab lcla &count
|
|
|
|
lda #&val
|
|
|
|
&count seta 1
|
|
|
|
.loop
|
|
|
|
sta &adr(&count)
|
|
|
|
&count seta &count+1
|
|
|
|
aif &count>c:&adr,.done
|
|
|
|
ago ^loop
|
|
|
|
.done
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* LD4
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab LD4 &val,&adr
|
|
|
|
&lab lcla &count
|
|
|
|
lda #<&val
|
|
|
|
&count seta 1
|
|
|
|
.loop1
|
|
|
|
sta &adr(&count)
|
|
|
|
&count seta &count+1
|
|
|
|
aif &count>c:&adr,.part2
|
|
|
|
ago ^loop1
|
|
|
|
.part2
|
|
|
|
lda #+(&val)|-16
|
|
|
|
&count seta 1
|
|
|
|
.loop2
|
|
|
|
sta &adr(&count)+2
|
|
|
|
&count seta &count+1
|
|
|
|
aif &count>c:&adr,.done
|
|
|
|
ago ^loop2
|
|
|
|
.done
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* lsr2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab lsr2 &a
|
|
|
|
&lab lsr &a
|
|
|
|
lsr &a
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* MV2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab MV2 &src,&adr
|
|
|
|
&lab lcla &count
|
|
|
|
lda &src
|
|
|
|
&count seta 1
|
|
|
|
.loop
|
|
|
|
sta &adr(&count)
|
|
|
|
&count seta &count+1
|
|
|
|
aif &count>c:&adr,.done
|
|
|
|
ago ^loop
|
|
|
|
.done
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
1998-07-20 16:23:11 +00:00
|
|
|
********************
|
|
|
|
* MV4
|
|
|
|
********************
|
|
|
|
macro
|
|
|
|
&lab MV4 &src,&adr
|
|
|
|
&lab lcla &count
|
|
|
|
lda &src
|
|
|
|
&count seta 1
|
|
|
|
.loop1
|
|
|
|
sta &adr(&count)
|
|
|
|
&count seta &count+1
|
|
|
|
aif &count>c:&adr,.part2
|
|
|
|
ago ^loop1
|
|
|
|
.part2
|
|
|
|
lda &src+2
|
|
|
|
&count seta 1
|
|
|
|
.loop2
|
|
|
|
sta &adr(&count)+2
|
|
|
|
&count seta &count+1
|
|
|
|
aif &count>c:&adr,.done
|
|
|
|
ago ^loop2
|
|
|
|
.done
|
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
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ora2
|
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
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab ora2 &arg1,&arg2,&dest
|
|
|
|
&lab anop
|
|
|
|
lclc &char
|
|
|
|
&char amid &arg1,1,1
|
|
|
|
aif "&char"="@",.at1
|
|
|
|
lda &arg1
|
|
|
|
ago .add
|
|
|
|
.at1
|
|
|
|
&char amid &arg1,2,1
|
|
|
|
aif "&char"="x",.x1
|
|
|
|
aif "&char"="X",.x1
|
|
|
|
aif "&char"="y",.y1
|
|
|
|
aif "&char"="Y",.y1
|
|
|
|
ago .add
|
|
|
|
.x1
|
|
|
|
txa
|
|
|
|
ago .add
|
|
|
|
.y1
|
|
|
|
tya
|
|
|
|
.add
|
|
|
|
ora &arg2
|
|
|
|
&char amid &dest,1,1
|
|
|
|
aif "&char"="@",.at2
|
|
|
|
sta &dest
|
|
|
|
ago .b
|
|
|
|
.at2
|
|
|
|
&char amid &dest,2,1
|
|
|
|
aif "&char"="x",.x2
|
|
|
|
aif "&char"="X",.x2
|
|
|
|
aif "&char"="y",.y2
|
|
|
|
aif "&char"="Y",.y2
|
|
|
|
ago .b
|
|
|
|
.x2
|
|
|
|
tax
|
|
|
|
ago .b
|
|
|
|
.y2
|
|
|
|
tay
|
|
|
|
.b
|
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
|
|
|
mend
|
1998-06-09 16:22:56 +00:00
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* ph2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab ph2 &parm
|
|
|
|
lclc &char
|
|
|
|
&lab anop
|
|
|
|
aif c:&parm=0,.done
|
|
|
|
&char amid &parm,1,1
|
|
|
|
aif "&char"="#",.immediate
|
|
|
|
aif "&char"="@",.at
|
|
|
|
aif s:longa=1,.chk
|
|
|
|
rep #%00100000
|
|
|
|
.chk
|
|
|
|
aif "&char"<>"{",.absolute
|
|
|
|
&char amid &parm,l:&parm,1
|
|
|
|
aif "&char"<>"}",.error
|
|
|
|
&parm amid &parm,2,l:&parm-2
|
|
|
|
lda (&parm)
|
|
|
|
pha
|
|
|
|
ago .shorten
|
|
|
|
.absolute
|
|
|
|
lda &parm
|
|
|
|
pha
|
|
|
|
ago .shorten
|
|
|
|
.immediate
|
|
|
|
&parm amid &parm,2,l:&parm-1
|
|
|
|
pea &parm
|
|
|
|
ago .done
|
|
|
|
.at
|
|
|
|
&char amid &parm,2,1
|
|
|
|
ph&char
|
|
|
|
.shorten
|
|
|
|
aif s:longa=1,.done
|
|
|
|
sep #%00100000
|
|
|
|
.done
|
|
|
|
mexit
|
|
|
|
.error
|
1998-07-20 16:23:11 +00:00
|
|
|
mnote "Missing closing '}'",16
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* ph4
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab ph4 &parm
|
|
|
|
lclc &char
|
|
|
|
lclc &char1
|
|
|
|
lclc &char2
|
|
|
|
&lab anop
|
|
|
|
&char amid &parm,1,1
|
|
|
|
aif "&char"="#",.immediate
|
|
|
|
aif "&char"="@",.at
|
|
|
|
aif s:longa=1,.chk1
|
|
|
|
rep #%00100000
|
|
|
|
.chk1
|
|
|
|
aif "&char"<>"{",.chk2
|
|
|
|
&char amid &parm,l:&parm,1
|
|
|
|
aif "&char"<>"}",.error
|
|
|
|
&parm amid &parm,2,l:&parm-2
|
|
|
|
ldy #2
|
|
|
|
lda (&parm),y
|
|
|
|
pha
|
|
|
|
lda (&parm)
|
|
|
|
pha
|
|
|
|
ago .shorten
|
|
|
|
.chk2
|
|
|
|
aif "&char"<>"[",.absolute
|
|
|
|
ldy #2
|
|
|
|
lda &parm,y
|
|
|
|
pha
|
|
|
|
lda &parm
|
|
|
|
pha
|
|
|
|
ago .shorten
|
|
|
|
.absolute
|
|
|
|
lda &parm+2
|
|
|
|
pha
|
|
|
|
lda &parm
|
|
|
|
pha
|
|
|
|
ago .shorten
|
|
|
|
.at
|
|
|
|
&char1 amid &parm,2,1
|
|
|
|
&char2 setc &char1
|
|
|
|
ph&char1
|
|
|
|
aif l:&parm<3,.chk2a
|
|
|
|
&char2 amid &parm,3,1
|
|
|
|
.chk2a
|
|
|
|
ph&char2
|
|
|
|
ago .shorten
|
|
|
|
.immediate
|
|
|
|
&parm amid &parm,2,l:&parm-1
|
|
|
|
pea +(&parm)|-16
|
|
|
|
pea &parm
|
|
|
|
ago .done
|
|
|
|
.shorten
|
|
|
|
aif s:longa=1,.done
|
|
|
|
sep #%00100000
|
|
|
|
.done
|
|
|
|
mexit
|
|
|
|
.error
|
|
|
|
mnote "Missing closing '}'",16
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* pl2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab pl2 &parm
|
|
|
|
lclc &char
|
|
|
|
&lab anop
|
|
|
|
aif s:longa=1,.start
|
|
|
|
rep #%00100000
|
|
|
|
.start
|
|
|
|
&char amid &parm,1,1
|
|
|
|
aif "&char"="@",.at
|
|
|
|
aif "&char"<>"{",.absolute
|
|
|
|
&char amid &parm,l:&parm,1
|
|
|
|
aif "&char"<>"}",.error
|
|
|
|
&parm amid &parm,2,l:&parm-2
|
|
|
|
pla
|
|
|
|
sta (&parm)
|
|
|
|
ago .shorten
|
|
|
|
.absolute
|
|
|
|
pla
|
|
|
|
sta &parm
|
|
|
|
ago .shorten
|
|
|
|
.at
|
|
|
|
&char amid &parm,2,1
|
|
|
|
pl&char
|
|
|
|
.shorten
|
|
|
|
aif s:longa=1,.done
|
|
|
|
sep #%00100000
|
|
|
|
.done
|
|
|
|
mexit
|
|
|
|
.error
|
1998-07-20 16:23:11 +00:00
|
|
|
mnote "Missing Closing '}'",16
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* pl4
|
|
|
|
********************
|
|
|
|
macro
|
|
|
|
&lab pl4 &parm
|
|
|
|
lclc &char
|
|
|
|
lclc &char1
|
|
|
|
lclc &char2
|
|
|
|
&lab anop
|
|
|
|
aif s:longa=1,.start
|
|
|
|
rep #%00100000
|
|
|
|
.start
|
|
|
|
&char amid &parm,1,1
|
|
|
|
aif "&char"<>"{",.chk
|
|
|
|
&char amid &parm,l:&parm,1
|
|
|
|
aif "&char"<>"}",.error
|
|
|
|
&parm amid &parm,2,l:&parm-2
|
|
|
|
pla
|
|
|
|
sta (&parm)
|
|
|
|
ldy #2
|
|
|
|
pla
|
|
|
|
sta (&parm),y
|
|
|
|
ago .shorten
|
|
|
|
.chk
|
|
|
|
aif "&char"<>"[",.chk2
|
|
|
|
pla
|
|
|
|
sta &parm
|
|
|
|
ldy #2
|
|
|
|
pla
|
|
|
|
sta &parm,y
|
|
|
|
ago .shorten
|
|
|
|
.chk2
|
|
|
|
aif "&char"<>"@",.absolute
|
|
|
|
&char1 amid &parm,2,1
|
|
|
|
&char2 setc &char1
|
|
|
|
pl&char1
|
|
|
|
aif l:&parm<3,.chk2a
|
|
|
|
&char2 amid &parm,3,1
|
|
|
|
.chk2a
|
|
|
|
pl&char2
|
|
|
|
ago .shorten
|
|
|
|
.absolute
|
|
|
|
pla
|
|
|
|
sta &parm
|
|
|
|
pla
|
|
|
|
sta &parm+2
|
|
|
|
.shorten
|
|
|
|
aif s:longa=1,.done
|
|
|
|
sep #%00100000
|
|
|
|
.done
|
|
|
|
mexit
|
|
|
|
.error
|
|
|
|
mnote "Missing closing '}'",16
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
1998-07-20 16:23:11 +00:00
|
|
|
* sub2
|
1998-06-09 16:22:56 +00:00
|
|
|
********************
|
|
|
|
MACRO
|
1998-07-20 16:23:11 +00:00
|
|
|
&lab sub2 &arg1,&arg2,&dest
|
|
|
|
lclc &char
|
|
|
|
&lab sec
|
|
|
|
&char amid &arg1,1,1
|
|
|
|
aif "&char"="@",.at1
|
|
|
|
lda &arg1
|
|
|
|
ago .sub
|
|
|
|
.at1
|
|
|
|
&char amid &arg1,2,1
|
|
|
|
aif "&char"="x",.x1
|
|
|
|
aif "&char"="X",.x1
|
|
|
|
aif "&char"="y",.y1
|
|
|
|
aif "&char"="Y",.y1
|
|
|
|
ago .sub
|
|
|
|
.x1
|
|
|
|
txa
|
|
|
|
ago .sub
|
|
|
|
.y1
|
|
|
|
tya
|
|
|
|
.sub
|
|
|
|
sbc &arg2
|
|
|
|
&char amid &dest,1,1
|
|
|
|
aif "&char"="@",.at2
|
|
|
|
sta &dest
|
|
|
|
ago .b
|
|
|
|
.at2
|
|
|
|
&char amid &dest,2,1
|
|
|
|
aif "&char"="x",.x2
|
|
|
|
aif "&char"="X",.x2
|
|
|
|
aif "&char"="y",.y2
|
|
|
|
aif "&char"="Y",.y2
|
|
|
|
ago .b
|
|
|
|
.x2
|
|
|
|
tax
|
|
|
|
ago .b
|
|
|
|
.y2
|
|
|
|
tay
|
|
|
|
.b
|
|
|
|
mend
|
|
|
|
|
|
|
|
********************
|
|
|
|
* sub4
|
|
|
|
********************
|
|
|
|
macro
|
|
|
|
&lab sub4 &arg1,&arg2,&dest
|
|
|
|
&lab anop
|
|
|
|
lclc &ch
|
|
|
|
&ch amid &arg2,1,1
|
|
|
|
sec
|
|
|
|
lda &arg1
|
|
|
|
sbc &arg2
|
|
|
|
sta &dest
|
|
|
|
lda &arg1+2
|
|
|
|
aif "&ch"="#",.a
|
|
|
|
sbc &arg2+2
|
|
|
|
ago .b
|
|
|
|
.a
|
|
|
|
sbc &arg2|-16
|
|
|
|
.b
|
|
|
|
sta &dest+2
|
1998-06-09 16:22:56 +00:00
|
|
|
mend
|
1998-07-20 16:23:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
; ------------------
|
|
|
|
; New, experimental macros
|
|
|
|
; ------------------
|
|
|
|
|
|
|
|
********************
|
|
|
|
* breakpoint
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab breakpoint &flag
|
1998-08-03 17:30:30 +00:00
|
|
|
&lab lda check4debug
|
1998-07-20 16:23:11 +00:00
|
|
|
and #$80
|
|
|
|
beq *+4
|
|
|
|
brk &flag
|
|
|
|
MEND
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*****************************************
|
|
|
|
* incad: Increment a 4-byte address
|
|
|
|
*****************************************
|
|
|
|
MACRO
|
|
|
|
&lab incad &ptr
|
|
|
|
aif "&ptr"="@xa",.at1
|
|
|
|
&lab inc &ptr Increment low-order word.
|
|
|
|
bne skip&syscnt If rollover,
|
|
|
|
inc &ptr+2 increment high-order word.
|
|
|
|
ago .done
|
|
|
|
.at1 Same for address in X/A registers.
|
|
|
|
&lab inc a
|
|
|
|
bne skip&syscnt
|
|
|
|
inx
|
|
|
|
.done
|
|
|
|
skip&syscnt anop
|
|
|
|
MEND
|
1998-08-03 17:30:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
********************************************************************
|
|
|
|
* ~NEW: call ~NEW or DB~NEW, depending upon whether debug is wanted
|
|
|
|
********************************************************************
|
|
|
|
MACRO
|
|
|
|
&lab ~NEW
|
|
|
|
&lab anop
|
Changes for gsh version 2.0d8:
Fixed several mutual exclusion problems, including a particularly nasty
one that would cause gsh to loop forever inside the memory manager. (You
could identify this one by the "BRA (-23)" at the bottom of the infinite
loop.)
Fixed the string vector print routine to properly handle all numbers of
entries in the hash table. Previously, it would always print duplicate
entries if there were < 6 commands hashed, and would sometimes print
duplicates (depending on previous contents of an internal table) for
other numbers of commands.
gsh would wait on background processes started from an exec file
(executed, not sourced). Now the exec file does not wait on the process,
but the background process is not associated with the parent shell after
the exec file terminates.
Made gsh globbing work more like csh: if none of the requested patterns
are found, print "No match" and exit.
At startup, if /etc/glogin, $HOME/glogin, or $HOME/gshrc does not exist,
don't report a "file not found" error message. (PR#100)
1998-12-31 18:29:14 +00:00
|
|
|
* -- Portion needed for debug version
|
|
|
|
* jsl DB~NEW
|
|
|
|
*
|
|
|
|
* -- Rest is for non-debug version
|
|
|
|
using memglobal
|
|
|
|
lock memmutex
|
1998-08-03 17:30:30 +00:00
|
|
|
jsl ~NEW
|
Changes for gsh version 2.0d8:
Fixed several mutual exclusion problems, including a particularly nasty
one that would cause gsh to loop forever inside the memory manager. (You
could identify this one by the "BRA (-23)" at the bottom of the infinite
loop.)
Fixed the string vector print routine to properly handle all numbers of
entries in the hash table. Previously, it would always print duplicate
entries if there were < 6 commands hashed, and would sometimes print
duplicates (depending on previous contents of an internal table) for
other numbers of commands.
gsh would wait on background processes started from an exec file
(executed, not sourced). Now the exec file does not wait on the process,
but the background process is not associated with the parent shell after
the exec file terminates.
Made gsh globbing work more like csh: if none of the requested patterns
are found, print "No match" and exit.
At startup, if /etc/glogin, $HOME/glogin, or $HOME/gshrc does not exist,
don't report a "file not found" error message. (PR#100)
1998-12-31 18:29:14 +00:00
|
|
|
unlock memmutex
|
1998-08-03 17:30:30 +00:00
|
|
|
MEND
|
|
|
|
|
|
|
|
|
|
|
|
***************************************************************************
|
|
|
|
* ~DISPOSE: call ~DISPOSE or DB~DISPOSE, depending upon if debug is wanted
|
|
|
|
***************************************************************************
|
|
|
|
MACRO
|
|
|
|
&lab ~DISPOSE
|
|
|
|
&lab anop
|
Changes for gsh version 2.0d8:
Fixed several mutual exclusion problems, including a particularly nasty
one that would cause gsh to loop forever inside the memory manager. (You
could identify this one by the "BRA (-23)" at the bottom of the infinite
loop.)
Fixed the string vector print routine to properly handle all numbers of
entries in the hash table. Previously, it would always print duplicate
entries if there were < 6 commands hashed, and would sometimes print
duplicates (depending on previous contents of an internal table) for
other numbers of commands.
gsh would wait on background processes started from an exec file
(executed, not sourced). Now the exec file does not wait on the process,
but the background process is not associated with the parent shell after
the exec file terminates.
Made gsh globbing work more like csh: if none of the requested patterns
are found, print "No match" and exit.
At startup, if /etc/glogin, $HOME/glogin, or $HOME/gshrc does not exist,
don't report a "file not found" error message. (PR#100)
1998-12-31 18:29:14 +00:00
|
|
|
* -- Portion needed for debug version
|
|
|
|
* jsl DB~DISPOSE
|
|
|
|
*
|
|
|
|
* -- Rest is for non-debug version
|
|
|
|
using memglobal
|
|
|
|
lock memmutex
|
|
|
|
jsl ~DISPOSE
|
|
|
|
unlock memmutex
|
|
|
|
MEND
|
|
|
|
|
|
|
|
; ------------------
|
|
|
|
; Mutual Exclusion
|
|
|
|
; ------------------
|
|
|
|
|
|
|
|
********************
|
|
|
|
* key
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab key
|
|
|
|
&lab dc i2'0'
|
|
|
|
MEND
|
|
|
|
|
|
|
|
********************
|
|
|
|
* lock
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab lock &a1
|
|
|
|
&lab lda #1
|
|
|
|
tsb &a1
|
|
|
|
beq *+6
|
|
|
|
cop $7F
|
|
|
|
bra *-7
|
|
|
|
MEND
|
|
|
|
|
|
|
|
********************
|
|
|
|
* unlock
|
|
|
|
********************
|
|
|
|
MACRO
|
|
|
|
&lab unlock &a1
|
|
|
|
&lab stz &a1
|
1998-08-03 17:30:30 +00:00
|
|
|
MEND
|