gno/bin/gsh/bufpool.asm
tribby 1dc5497309 Added startup protocol as requested by Devin Reed (PR#78) and Steve Reeves
(PR#85, PR#86):
   For login shells (command line starts with '-'),
	If $PATH doesn't start with ':' or contain a space,
	   change all ":" to " ".
	source /etc/glogin
	source $HOME/glogin
$HOME/gshrc is sourced afterward for both login and non-login shells.

Don't the print number of hashed commands (from "rehash") until all
initialization is completed.

Only pass exported environment variables to child processes, and prevent child
processes from changing parent's environment.

A null command followed by a redirection of stdout, for example
  > /tmp/list
would cause an error message "<garbage> not found" due to incorrect
setting of command buffer pointer.

Filename completion did not work following ">&" or ">" without a trailing
space.

Entabbed all the asm files, saving more than 36,000 bytes.
1998-09-08 16:53:14 +00:00

124 lines
2.1 KiB
NASM

**************************************************************************
*
* The GNO Shell Project
*
* Developed by:
* Jawaid Bazyar
* Tim Meekins
*
* $Id: bufpool.asm,v 1.5 1998/09/08 16:53:05 tribby Exp $
*
**************************************************************************
*
* BUFPOOL
* By Tim Meekins
* Modified by Dave Tribby for GNO 2.0.6 (256-byte buffer code removed)
*
* This is the buffer pool
*
* Note: text set up for tabs at col 16, 22, 41, 49, 57, 65
* | | | | | |
* ^ ^ ^ ^ ^ ^
**************************************************************************
*
* Interfaces defined in this file:
* The alloc routines are a jsl without any stack params.
* Pointer to requested buffer is returned in X/A registers.
* alloc1024
* free1024
*
* bufpool data:
* pool1024 dc i4'0'
* pool1024mutex key
*
**************************************************************************
mcopy /obj/gno/bin/gsh/bufpool.mac
dummybufpool start ; ends up in .root
end
**************************************************************************
*
* get a buffer of size 1024
*
**************************************************************************
alloc1024 START
using bufpool
lock pool1024mutex
lda pool1024
ora pool1024+2
beq allocbuf
phd
ph4 pool1024
tsc
tcd
lda [1]
sta pool1024
ldy #2
lda [1],y
sta pool1024+2
unlock pool1024mutex
pla
plx
pld
rtl
allocbuf unlock pool1024mutex
ph4 #1024
~NEW
rtl
END
**************************************************************************
*
* free a buffer of size 1024
*
**************************************************************************
free1024 START
using bufpool
phd
phx
pha
tsc
tcd
lock pool1024mutex
lda pool1024
sta [1]
ldy #2
lda pool1024+2
sta [1],y
lda 1
sta pool1024
lda 3
sta pool1024+2
unlock pool1024mutex
pla
plx
pld
rtl
END
**************************************************************************
*
* buffer pool data
*
**************************************************************************
bufpool DATA
pool1024 dc i4'0'
pool1024mutex key
END