1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* The GNO Shell Project
|
|
|
|
*
|
|
|
|
* Developed by:
|
|
|
|
* Jawaid Bazyar
|
|
|
|
* Tim Meekins
|
|
|
|
*
|
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
|
|
|
* $Id: shell.asm,v 1.9 1998/12/31 18:29:14 tribby Exp $
|
1998-04-24 15:38:47 +00:00
|
|
|
*
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* SHELL.ASM
|
|
|
|
* By Tim Meekins
|
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
|
|
|
* Modified by Dave Tribby for GNO 2.0.6
|
1997-11-18 05:31:00 +00:00
|
|
|
*
|
|
|
|
* This is the main routines for the shell.
|
|
|
|
*
|
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
|
|
|
|
* | | | | | |
|
|
|
|
* ^ ^ ^ ^ ^ ^
|
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* Interfaces defined in this file:
|
|
|
|
*
|
|
|
|
* shell subroutine (0:dummy)
|
|
|
|
* NOTE: gnoloop is an entry defined in shell.
|
1998-09-08 16:53:14 +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
|
|
|
* AppendHome subroutine (4:str)
|
|
|
|
* return 4:outPtr
|
|
|
|
*
|
1998-09-08 16:53:14 +00:00
|
|
|
* Dogshrc jsr with no parameters
|
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
|
|
|
*
|
|
|
|
* signal2 subroutine (4:fubar)
|
|
|
|
*
|
|
|
|
* signal18 subroutine (4:fubar)
|
|
|
|
*
|
1997-11-18 05:31:00 +00:00
|
|
|
**************************************************************************
|
|
|
|
|
1998-04-24 15:38:47 +00:00
|
|
|
mcopy /obj/gno/bin/gsh/shell.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
|
|
|
dummyshell start ; ends up in .root
|
1998-04-24 15:38:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
setcom 60
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
SIGINT gequ 2
|
|
|
|
SIGTSTP gequ 18
|
|
|
|
SIGCHLD gequ 20
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
cmdbuflen gequ 1024
|
1997-11-18 05:31:00 +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
|
|
|
**************************************************************************
|
|
|
|
*
|
|
|
|
* shell: entry point for acting upon commands
|
|
|
|
*
|
|
|
|
**************************************************************************
|
1998-09-08 16:53:14 +00:00
|
|
|
case on
|
|
|
|
shell start
|
|
|
|
case off
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
using global
|
1997-11-18 05:31:00 +00:00
|
|
|
using pdata
|
|
|
|
using HistoryData
|
1998-09-08 16:53:14 +00:00
|
|
|
using termdata
|
|
|
|
|
|
|
|
p equ 0 General pointer
|
|
|
|
cflag equ p+4 Flag: set when path converted
|
|
|
|
space equ cflag+2
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
subroutine (0:dummy),space
|
|
|
|
|
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
|
|
|
tsc Save stack pointer
|
|
|
|
sta cmdcontext in cmdcontext
|
|
|
|
tdc and direct page reg
|
1998-09-08 16:53:14 +00:00
|
|
|
sta cmddp in cmddp.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
PushVariablesGS NullPB Save environment variables.
|
1997-11-18 05:31:00 +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
|
|
|
Open ttyopen Open tty,
|
|
|
|
bcc settty checking for error.
|
1997-11-18 05:31:00 +00:00
|
|
|
ErrWriteCString #ttyerr
|
|
|
|
jmp quit
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
ttyerr dc c'gsh: Failed opening tty.',h'0d00'
|
|
|
|
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
settty mv2 ttyref,gshtty
|
|
|
|
tcnewpgrp gshtty
|
|
|
|
settpgrp gshtty
|
|
|
|
getpid
|
|
|
|
sta gshpid
|
|
|
|
|
|
|
|
jsr InitTerm
|
|
|
|
|
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
|
|
|
lda FastFlag If FastFlag is set,
|
|
|
|
bne fastskip1 skip copyright message.
|
1998-09-08 16:53:14 +00:00
|
|
|
lda gshpid Only print the copyright msg
|
|
|
|
cmp #2 if not using login
|
1997-11-18 05:31:00 +00:00
|
|
|
bne fastskip1
|
|
|
|
ldx #^gnostr
|
|
|
|
lda #gnostr
|
|
|
|
jsr puts
|
|
|
|
fastskip1 anop
|
|
|
|
|
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
|
|
|
;
|
|
|
|
; Set up signal handlers
|
|
|
|
;
|
1997-11-18 05:31:00 +00:00
|
|
|
signal (#SIGINT,#signal2)
|
|
|
|
signal (#SIGTSTP,#signal18)
|
|
|
|
signal (#SIGCHLD,#pchild)
|
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
|
|
|
;
|
|
|
|
; Set entry point for users calling system
|
|
|
|
;
|
1997-11-18 05:31:00 +00:00
|
|
|
setsystemvector #system
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
; Initialize some stuff
|
|
|
|
;
|
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
|
|
|
jsr initalias Set all AliasTable entries to 0.
|
|
|
|
jsr InitDStack Zero out directory stack.
|
|
|
|
jsr InitVars Set value of all env var flags.
|
1998-09-08 16:53:14 +00:00
|
|
|
;
|
|
|
|
; Check for login shell (argv[0] starts with '-')
|
|
|
|
;
|
|
|
|
mv4 ~COMMANDLINE,p Copy commandline addr to dir page.
|
|
|
|
ldy #8 Skip over shell identifier
|
|
|
|
lda [p],y to get first char of
|
|
|
|
and #$FF command name.
|
|
|
|
cmp #'-' If not '-',
|
|
|
|
bne nologin_init skip over login initialization.
|
|
|
|
|
|
|
|
; Change ":" to " " in $PATH if it doesn't start with ":" or contain a " "
|
|
|
|
|
|
|
|
ph4 #pathname Get $PATH environment variable string
|
|
|
|
jsl getenv
|
|
|
|
sta p Save address of allocated buffer.
|
|
|
|
stx p+2 in direct page variable
|
|
|
|
ora p+2 If null,
|
|
|
|
beq nopathconv no need to convert
|
|
|
|
|
|
|
|
stz cflag Initialize conversion flag = false.
|
|
|
|
ldy #4 Index over GS/OS length fields.
|
|
|
|
short m Use 8-bit mode.
|
|
|
|
lda [p],y
|
|
|
|
beq endpathconv If null string, or
|
|
|
|
cmp #':' if first character is ':',
|
|
|
|
beq endpathconv don't do the conversion.
|
|
|
|
|
|
|
|
bumpit iny
|
|
|
|
lda [p],y
|
|
|
|
beq endpathconv If at end of string, all done.
|
|
|
|
cmp #' ' If $PATH contains a space,
|
|
|
|
bne chkcolon
|
|
|
|
stz cflag abort the conversion.
|
|
|
|
bra endpathconv
|
|
|
|
chkcolon cmp #':' If next character is ':',
|
|
|
|
bne bumpit
|
|
|
|
lda #' ' change it to ' ', and
|
|
|
|
sta [p],y
|
|
|
|
sta cflag set conversion flag = true.
|
|
|
|
bra bumpit
|
|
|
|
|
|
|
|
endpathconv long m Back to 16-bit mode.
|
|
|
|
lda cflag If there was no conversion,
|
|
|
|
beq freepath skip the setting of $PATH.
|
|
|
|
|
|
|
|
clc Address of $PATH as a GS/OS
|
|
|
|
lda p output string is 2 bytes
|
|
|
|
adc #2 beyond the input string
|
|
|
|
sta SetValue starting address.
|
|
|
|
lda p+2
|
|
|
|
adc #0
|
|
|
|
sta SetValue+2
|
|
|
|
SetGS SetPB Set $PATH to the converted value.
|
|
|
|
|
|
|
|
freepath ph4 p Free the $PATH C string.
|
|
|
|
jsl nullfree
|
|
|
|
|
|
|
|
nopathconv anop
|
|
|
|
|
|
|
|
; Read and execute /etc/glogin
|
|
|
|
ph4 #etcglogin path = "/etc/glogin"
|
|
|
|
lda #0
|
|
|
|
pha argc = 0
|
|
|
|
pha argv = NULL
|
|
|
|
pha
|
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
|
|
|
lda #$8000
|
|
|
|
pha jobflag = $8000
|
1998-09-08 16:53:14 +00:00
|
|
|
jsl ShellExec
|
|
|
|
|
|
|
|
; Read and execute $HOME/glogin
|
|
|
|
jsr Doglogin
|
|
|
|
|
|
|
|
;
|
|
|
|
; Initialization that is not specific to login shells
|
|
|
|
;
|
|
|
|
nologin_init anop
|
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
|
|
|
lda FastFlag If fast startup flag isn't set,
|
1997-11-18 05:31:00 +00:00
|
|
|
bne fastskip2
|
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
|
|
|
jsr InitHistory Init: historyFN->"$HOME/history",
|
1998-09-08 16:53:14 +00:00
|
|
|
jsr ReadHistory read in history from disk,
|
|
|
|
jsr Dogshrc and read $HOME/gshrc.
|
1997-11-18 05:31:00 +00:00
|
|
|
jsr newline
|
1998-09-08 16:53:14 +00:00
|
|
|
fastskip2 anop
|
1997-11-18 05:31:00 +00:00
|
|
|
lda didReadTerm
|
|
|
|
bne didit
|
|
|
|
jsr readterm
|
1998-09-08 16:53:14 +00:00
|
|
|
didit anop
|
1998-12-21 23:57:08 +00:00
|
|
|
jsr dispose_hash Remove old table (if set in
|
|
|
|
jsl hashpath login files) and hash $PATH.
|
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
|
|
|
ld2 1,done_init Set initialization done flag.
|
1997-11-18 05:31:00 +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
|
|
|
;
|
|
|
|
; Check for command-line arguments -c and -e
|
|
|
|
;
|
1997-11-18 05:31:00 +00:00
|
|
|
lda CmdFlag
|
|
|
|
beq cmdskip
|
|
|
|
|
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
|
|
|
;
|
|
|
|
; The -c flag is set: execute remaining arguments as a command file and exit.
|
|
|
|
;
|
1997-11-18 05:31:00 +00:00
|
|
|
mv4 CmdArgV,p
|
|
|
|
ldy #2
|
|
|
|
lda [p],y
|
|
|
|
pha
|
|
|
|
lda [p]
|
|
|
|
pha
|
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
|
|
|
ph2 CmdArgc argc
|
|
|
|
pei (p+2) argv
|
1997-11-18 05:31:00 +00:00
|
|
|
pei (p)
|
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
|
|
|
pea 0 jobflag = 0
|
1997-11-18 05:31:00 +00:00
|
|
|
jsl ShellExec
|
|
|
|
jmp done1
|
|
|
|
|
|
|
|
cmdskip lda ExecFlag
|
|
|
|
beq execskip
|
|
|
|
|
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
|
|
|
;
|
|
|
|
; The -e flag is set: execute remaining arguments as a command and exit.
|
|
|
|
;
|
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
|
|
|
ph4 ExecCmd cmdline
|
|
|
|
ph2 #0 jobflag = 0
|
|
|
|
jsl execute
|
1998-09-08 16:53:14 +00:00
|
|
|
jmp done1
|
|
|
|
|
|
|
|
;
|
|
|
|
; Parameter block for shell SetGS calls (p 427 in ORCA/M manual)
|
|
|
|
;
|
|
|
|
SetPB dc i2'3' pCount
|
|
|
|
dc i4'pathname' Name (pointer to GS/OS string)
|
|
|
|
SetValue ds 4 Value (pointer to GS/OS string)
|
|
|
|
dc i2'1' Export flag
|
|
|
|
|
|
|
|
pathname gsstr 'path' GS/OS string
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
|
|
|
|
etcglogin dc c'/etc/glogin',h'00'
|
|
|
|
|
|
|
|
execskip anop
|
1997-11-18 05:31:00 +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
|
|
|
****************************************************************
|
|
|
|
*
|
|
|
|
* Main loop for reading and executing commands
|
|
|
|
*
|
|
|
|
****************************************************************
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
stz lastabort
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
gnoloop entry
|
1997-11-18 05:31:00 +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
|
|
|
;
|
|
|
|
; Set the fundamental registers.
|
|
|
|
;
|
|
|
|
phk Copy Program Bank register
|
|
|
|
plb into Data Bank register.
|
1998-09-08 16:53:14 +00:00
|
|
|
lda cmdcontext Set Stack Pointer and
|
|
|
|
tcs Direct Page register
|
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
|
|
|
lda cmddp to values saved when
|
|
|
|
tcd entering shell.
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
jsl WritePrompt Print prompt.
|
|
|
|
jsr GetCmdLine Get response.
|
|
|
|
bcs done
|
1997-11-18 05:31:00 +00:00
|
|
|
jsr newline
|
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-09-08 16:53:14 +00:00
|
|
|
lda cmdlen Check for empty string.
|
|
|
|
beq gnoloop
|
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
|
|
|
jsr cursoron
|
1997-11-18 05:31:00 +00:00
|
|
|
jsr newlineX
|
|
|
|
jsr 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
|
|
|
|
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
|
|
|
ph4 #cmdline execute(cmdline,0)
|
|
|
|
ph2 #0 jobflag = 0
|
1998-09-08 16:53:14 +00:00
|
|
|
jsl execute
|
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
|
|
|
lda exit_requested
|
1997-11-18 05:31:00 +00:00
|
|
|
bne done1
|
1998-09-08 16:53:14 +00:00
|
|
|
jsr newlineX
|
1997-11-18 05:31:00 +00:00
|
|
|
stz lastabort
|
1998-09-08 16:53:14 +00:00
|
|
|
bra gnoloop
|
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
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
;
|
|
|
|
; shut down gsh
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
done jsr newline
|
1997-11-18 05:31:00 +00:00
|
|
|
jsr newlineX
|
1998-09-08 16:53:14 +00:00
|
|
|
done1 ora2 pjoblist,pjoblist+2,@a
|
1997-11-18 05:31:00 +00:00
|
|
|
beq done2
|
1998-09-08 16:53:14 +00:00
|
|
|
lda lastabort
|
1997-11-18 05:31:00 +00:00
|
|
|
bne donekiller
|
|
|
|
inc lastabort
|
1998-07-20 16:23:11 +00:00
|
|
|
stz exit_requested
|
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
|
|
|
ldx #^stopstr Print message:
|
|
|
|
lda #stopstr "There are stopped jobs"
|
1997-11-18 05:31:00 +00:00
|
|
|
jsr puts
|
|
|
|
jsr newlineX
|
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
|
|
|
bra gnoloop Continue getting commands.
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
donekiller jsl jobkiller
|
|
|
|
done2 lda FastFlag
|
|
|
|
bne fastskip5
|
1998-09-08 16:53:14 +00:00
|
|
|
jsl SaveHistory
|
|
|
|
fastskip5 jsr dispose_hash
|
1997-11-18 05:31:00 +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
|
|
|
quit PopVariablesGS NullPB
|
1998-09-08 16:53:14 +00:00
|
|
|
Quit QuitParm
|
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-09-08 16:53:14 +00:00
|
|
|
QuitParm dc i'0'
|
1997-11-18 05:31:00 +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
|
|
|
; Null parameter block used for shell calls PushVariables
|
|
|
|
; (ORCA/M manual p.420) and PopVariablesGS (p. 419)
|
|
|
|
NullPB dc i2'0' pCount
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
gnostr dc h'0d',c'GNO/Shell 2.0.6',h'0d'
|
|
|
|
dc c'Copyright 1991-1993, Procyon, Inc. & Tim Meekins. '
|
|
|
|
dc c'ALL RIGHTS RESERVED',h'0d'
|
|
|
|
dc h'0d00'
|
1997-11-18 05:31:00 +00:00
|
|
|
stopstr dc c'gsh: There are stopped jobs.',h'0d00'
|
|
|
|
|
|
|
|
ttyopen dc i2'2'
|
|
|
|
ttyref dc i2'0'
|
|
|
|
dc i4'ttyname'
|
|
|
|
ttyname gsstr '.tty'
|
|
|
|
|
|
|
|
exitstr dc c'000000',h'0d00'
|
|
|
|
|
|
|
|
lastabort ds 2
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
END
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
;=========================================================================
|
|
|
|
;
|
|
|
|
; Interpret the login file (gshrc).
|
1998-09-08 16:53:14 +00:00
|
|
|
; If $HOME is set, we presume the gshrc file is there. If not,
|
1997-11-18 05:31:00 +00:00
|
|
|
; or if an error occurs getting the $HOME variable, we use
|
|
|
|
; @:gshrc.
|
|
|
|
;
|
|
|
|
;=========================================================================
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
Dogshrc START
|
1997-11-18 05:31:00 +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
|
|
|
ph4 #gshrcName
|
1998-09-08 16:53:14 +00:00
|
|
|
bra doit
|
|
|
|
|
|
|
|
; Alternate entry point: execute $HOME/glogin
|
|
|
|
|
|
|
|
Doglogin ENTRY
|
|
|
|
ph4 #gloginName
|
|
|
|
|
|
|
|
doit jsl AppendHome
|
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
|
|
|
phx Save pointer to GS/OS input
|
|
|
|
pha string for later.
|
|
|
|
|
|
|
|
clc Adjust the pointer
|
|
|
|
adc #2 to skip the length word
|
|
|
|
bcc no_ovf so it's a C string.
|
|
|
|
inx
|
|
|
|
no_ovf phx
|
|
|
|
pha
|
|
|
|
|
|
|
|
* ShellExec subroutine (4:path,2:argc,4:argv,2:jobflag)
|
|
|
|
; (ptr to $HOME/gshrc is on stack)
|
|
|
|
lda #0
|
|
|
|
pha argc = 0
|
|
|
|
pha argv = NULL
|
|
|
|
pha
|
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
|
|
|
lda #$8000
|
|
|
|
pha jobflag = $8000
|
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
|
|
|
jsl ShellExec
|
|
|
|
|
|
|
|
; Dispose $HOME/gshrc string
|
|
|
|
pla Get address of
|
|
|
|
plx GS/OS input string.
|
|
|
|
sec Subtract two bytes to get
|
|
|
|
sbc #2 addr of original output buffer.
|
|
|
|
bcs no_undf
|
|
|
|
dex
|
1998-08-03 17:30:30 +00:00
|
|
|
no_undf phx
|
|
|
|
pha
|
|
|
|
jsl nullfree
|
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
|
|
|
rts
|
|
|
|
|
|
|
|
gshrcName dc c'/gshrc',h'00'
|
1998-09-08 16:53:14 +00:00
|
|
|
gloginName dc c'/glogin',h'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-09-08 16:53:14 +00:00
|
|
|
END
|
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
|
|
|
;=========================================================================
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
; Append a C string to the value of the $HOME variable. If $HOME is
|
1998-07-20 16:23:11 +00:00
|
|
|
; not set, then it appends the C string to the string '@/'. Returns
|
|
|
|
; a pointer to a GS/OS input string.
|
|
|
|
;
|
|
|
|
;=========================================================================
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
AppendHome START
|
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
outPtr equ 0 Pointer into allocated memory
|
|
|
|
str_len equ outPtr+4 Length of string parameter
|
|
|
|
buf_len equ str_len+2 Size of GS/OS buffer
|
|
|
|
space equ buf_len+2
|
|
|
|
|
|
|
|
subroutine (4:str),space
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
lock mutex
|
|
|
|
;
|
|
|
|
; Get the variable's length using ReadVariableGS
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
ld4 TempResultBuf,RVresult Use temporary result buf.
|
1998-08-03 17:30:30 +00:00
|
|
|
ReadVariableGS ReadVar Get length.
|
|
|
|
|
|
|
|
;
|
|
|
|
; Allocate memory for value string
|
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
pei (str+2) Get length of
|
|
|
|
pei (str) string to be
|
|
|
|
jsr cstrlen appended.
|
1998-08-03 17:30:30 +00:00
|
|
|
sta str_len
|
|
|
|
|
|
|
|
lda TempRBlen Get length of value.
|
|
|
|
bne notnull If 0,
|
|
|
|
inc a increment because "@" will be used.
|
|
|
|
notnull inc2 a Add 4 bytes for result buf len words.
|
|
|
|
inc2 a
|
|
|
|
clc Add length of string parameter.
|
|
|
|
adc str_len
|
|
|
|
sta buf_len Save result buf length.
|
|
|
|
inc a Add 1 more for terminating null byte.
|
|
|
|
pea 0
|
|
|
|
pha
|
|
|
|
~NEW Request the memory.
|
|
|
|
sta RVresult Store address in ReadVariable
|
|
|
|
stx RVresult+2 parameter block and
|
|
|
|
sta outPtr direct page pointer.
|
|
|
|
stx outPtr+2
|
|
|
|
ora outPtr+2 If address == NULL,
|
|
|
|
beq exit return NULL to user.
|
|
|
|
|
|
|
|
lda buf_len Store result buffer length
|
|
|
|
sta [outPtr] at beginning of buf.
|
|
|
|
;
|
|
|
|
; Read the full value into the allocated memory
|
|
|
|
;
|
|
|
|
ReadVariableGS ReadVar ReadVariable $HOME
|
1998-09-08 16:53:14 +00:00
|
|
|
bcs doAtSign If error, use @/
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
ldy #2 Get length of
|
|
|
|
lda [outPtr],y GS/OS string.
|
|
|
|
beq doAtSign If $HOME not defined, use "@".
|
1998-09-08 16:53:14 +00:00
|
|
|
clc
|
1998-08-03 17:30:30 +00:00
|
|
|
adc #4 Turn into a c-string
|
|
|
|
tay by storing a 0 byte
|
|
|
|
short m after the last $HOME
|
|
|
|
lda #0 character.
|
1997-11-18 05:31:00 +00:00
|
|
|
sta [outPtr],y
|
|
|
|
long m
|
|
|
|
bra doAppend
|
|
|
|
|
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
|
|
|
;
|
|
|
|
; $HOME is null string or not defined. Use @
|
|
|
|
;
|
1997-11-18 05:31:00 +00:00
|
|
|
doAtSign lda atSign
|
1998-09-08 16:53:14 +00:00
|
|
|
ldy #4
|
1997-11-18 05:31:00 +00:00
|
|
|
sta [outPtr],y
|
1998-08-03 17:30:30 +00:00
|
|
|
lda #1 Set GS/OS buffer
|
1998-09-08 16:53:14 +00:00
|
|
|
ldy #2 string length word
|
1998-08-03 17:30:30 +00:00
|
|
|
sta [outPtr],y to 1.
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
doAppend anop
|
1998-08-03 17:30:30 +00:00
|
|
|
ldy #4 Start index beyond length words.
|
1997-11-18 05:31:00 +00:00
|
|
|
short m
|
|
|
|
lp lda [outPtr],y
|
1998-09-08 16:53:14 +00:00
|
|
|
beq noSep
|
1997-11-18 05:31:00 +00:00
|
|
|
cmp #':'
|
|
|
|
beq foundSep
|
|
|
|
cmp #'/'
|
|
|
|
beq foundSep
|
1998-09-08 16:53:14 +00:00
|
|
|
iny
|
1997-11-18 05:31:00 +00:00
|
|
|
bra lp
|
|
|
|
|
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
|
|
|
noSep lda #':' No separator found; use ":".
|
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
foundSep sta [str] Store sep at start of appended string.
|
1997-11-18 05:31:00 +00:00
|
|
|
long m
|
|
|
|
|
|
|
|
pei (str+2)
|
|
|
|
pei (str)
|
1998-07-20 16:23:11 +00:00
|
|
|
ldx outPtr+2
|
1997-11-18 05:31:00 +00:00
|
|
|
lda outPtr
|
|
|
|
clc
|
|
|
|
adc #4
|
1998-07-20 16:23:11 +00:00
|
|
|
bcc pushptr
|
|
|
|
inx
|
|
|
|
pushptr phx
|
1997-11-18 05:31:00 +00:00
|
|
|
pha
|
|
|
|
case on
|
|
|
|
jsl strcat
|
|
|
|
case off
|
|
|
|
|
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
|
|
|
clc Add 2 bytes to address of
|
|
|
|
lda outPtr GS/OS output buffer to
|
1998-08-03 17:30:30 +00:00
|
|
|
adc #2 get address of GS/OS
|
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
|
|
|
bcc no_ovf input string.
|
|
|
|
inc outPtr+2
|
|
|
|
no_ovf sta outPtr
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
lda [outPtr] Adjust string length
|
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
|
|
|
clc to include appended
|
1998-08-03 17:30:30 +00:00
|
|
|
adc str_len string (parameter).
|
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
|
|
|
sta [outPtr]
|
1998-07-20 16:23:11 +00:00
|
|
|
;
|
|
|
|
; NOTE: The returned value points to a GS/OS string, two bytes offset
|
|
|
|
; from the allocated memory for a GS/OS result buffer. When the
|
|
|
|
; memory is deallocated, the address must be adjusted back.
|
|
|
|
;
|
1998-08-03 17:30:30 +00:00
|
|
|
exit unlock mutex
|
1997-11-18 05:31:00 +00:00
|
|
|
return 4:outPtr
|
|
|
|
|
1998-08-03 17:30:30 +00:00
|
|
|
mutex key
|
|
|
|
|
1997-11-18 05:31:00 +00:00
|
|
|
atSign dc c'@',i1'0'
|
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-08-03 17:30:30 +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
|
|
|
; Parameter block for Shell call ReadVariable (p 423 in ORCA/M reference)
|
1998-08-03 17:30:30 +00:00
|
|
|
;
|
|
|
|
ReadVar anop
|
|
|
|
dc i2'3' pCount
|
1998-07-20 16:23:11 +00:00
|
|
|
dc a4'home' address of variable's name
|
1998-08-03 17:30:30 +00:00
|
|
|
RVresult ds 4 GS/OS Output buffer ptr
|
|
|
|
ds 2 export flag (returned)
|
|
|
|
;
|
1998-09-08 16:53:14 +00:00
|
|
|
; GS/OS result buffer for getting the full length of the HOME env var.
|
1998-08-03 17:30:30 +00:00
|
|
|
;
|
|
|
|
TempResultBuf dc i2'5' Only five bytes total.
|
|
|
|
TempRBlen ds 2 Value's length returned here.
|
|
|
|
ds 1 Only 1 byte for value.
|
|
|
|
;
|
|
|
|
; "HOME" as a GS/OS string
|
|
|
|
;
|
1998-07-20 16:23:11 +00:00
|
|
|
home gsstr 'HOME'
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
|
|
|
|
;=========================================================================
|
|
|
|
;
|
|
|
|
; GLOBAL data
|
|
|
|
;
|
|
|
|
;=========================================================================
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
global DATA
|
1997-11-18 05:31:00 +00:00
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
ID ds 2
|
|
|
|
GSOSDP ds 2
|
|
|
|
cmdloc ds 2
|
|
|
|
cmdlen ds 2
|
|
|
|
cmdline ds cmdbuflen
|
1998-07-20 16:23:11 +00:00
|
|
|
buffer ds 256
|
1997-11-18 05:31:00 +00:00
|
|
|
wordlen ds 2
|
|
|
|
wordbuf ds 256
|
|
|
|
nummatch ds 2
|
|
|
|
matchbuf ds 512*4
|
1998-09-08 16:53:14 +00:00
|
|
|
cmdcontext ds 2
|
1997-11-18 05:31:00 +00:00
|
|
|
cmddp ds 2
|
|
|
|
gshtty ds 2
|
1998-09-08 16:53:14 +00:00
|
|
|
gshpid ds 2
|
|
|
|
exit_requested dc i'0' ;!=0 if exit
|
1997-11-18 05:31:00 +00:00
|
|
|
signalled dc i'0'
|
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
|
|
|
done_init dc i2'0' 0 until init is complete
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
FastFlag dc i'0'
|
|
|
|
CmdFlag dc i'0'
|
|
|
|
CmdArgV ds 4
|
|
|
|
CmdArgC ds 2
|
|
|
|
ExecFlag dc i'0'
|
|
|
|
ExecCmd ds 4
|
|
|
|
|
1998-09-08 16:53:14 +00:00
|
|
|
END
|
1997-11-18 05:31:00 +00:00
|
|
|
|
|
|
|
;=========================================================================
|
|
|
|
;
|
|
|
|
; SIGINT handler when typed at command-line
|
|
|
|
;
|
|
|
|
;=========================================================================
|
|
|
|
|
|
|
|
signal2 START
|
|
|
|
|
|
|
|
using global
|
|
|
|
|
|
|
|
subroutine (4:fubar),0
|
|
|
|
WriteCString #msg
|
|
|
|
inc signalled
|
|
|
|
; ld2 $80,$E0C000
|
|
|
|
return
|
|
|
|
|
|
|
|
msg dc c'^C',h'0d0a00'
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
;=========================================================================
|
|
|
|
;
|
|
|
|
; SIGTSTP handler when typed at command-line
|
|
|
|
;
|
|
|
|
;=========================================================================
|
|
|
|
|
|
|
|
signal18 START
|
|
|
|
|
|
|
|
using global
|
|
|
|
|
|
|
|
subroutine (4:fubar),0
|
|
|
|
WriteCString #msg
|
|
|
|
inc signalled
|
|
|
|
; ld2 $80,$E0C000
|
|
|
|
return
|
|
|
|
|
|
|
|
msg dc c'^Z',h'0d0a00'
|
|
|
|
|
|
|
|
END
|