mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-11-18 19:09:31 +00:00
61474a874f
and link. However, it does not work yet and thus still needs work. The *.asm files have had the following common changes: - 'keep' lines were eliminated - the 'mcopy' now takes the macro from the /obj/gno/bin/gsh directory. This is in anticipation of having the macro files generated from a single source file; there is a large amount of duplication. For the moment, the makefile merely copies the old macro files from the "M" directory to the /obj/gno/bin/gsh directory. - start each file with a dummy routine so that the source code winds up in the *.o rather than the *.root file. - added the 'setcom 60' directive; there were many source lines that were otherwise getting truncated. The makefile is a complete rewrite.
181 lines
2.5 KiB
NASM
181 lines
2.5 KiB
NASM
**************************************************************************
|
|
*
|
|
* The GNO Shell Project
|
|
*
|
|
* Developed by:
|
|
* Jawaid Bazyar
|
|
* Tim Meekins
|
|
*
|
|
* $Id: bufpool.asm,v 1.2 1998/04/24 15:38:05 gdr-ftp Exp $
|
|
*
|
|
**************************************************************************
|
|
*
|
|
* BUFPOOL
|
|
* By Tim Meekins
|
|
*
|
|
* This is the buffer pool
|
|
*
|
|
**************************************************************************
|
|
|
|
mcopy /obj/gno/bin/gsh/bufpool.mac
|
|
|
|
dummy start ; ends up in .root
|
|
end
|
|
|
|
**************************************************************************
|
|
*
|
|
* get a buffer of size 256
|
|
*
|
|
**************************************************************************
|
|
|
|
alloc256 START
|
|
|
|
using bufpool
|
|
|
|
lock pool256mutex
|
|
|
|
lda pool256
|
|
ora pool256+2
|
|
beq allocbuf
|
|
|
|
phd
|
|
ph4 pool256
|
|
tsc
|
|
tcd
|
|
lda [1]
|
|
sta pool256
|
|
ldy #2
|
|
lda [1],y
|
|
sta pool256+2
|
|
unlock pool256mutex
|
|
pla
|
|
plx
|
|
pld
|
|
rtl
|
|
|
|
allocbuf unlock pool256mutex
|
|
ph4 #256
|
|
jsl ~NEW
|
|
rtl
|
|
|
|
END
|
|
|
|
**************************************************************************
|
|
*
|
|
* free a buffer of size 256
|
|
*
|
|
**************************************************************************
|
|
|
|
free256 START
|
|
|
|
using bufpool
|
|
|
|
phd
|
|
phx
|
|
pha
|
|
tsc
|
|
tcd
|
|
lock pool256mutex
|
|
lda pool256
|
|
sta [1]
|
|
ldy #2
|
|
lda pool256+2
|
|
sta [1],y
|
|
lda 1
|
|
sta pool256
|
|
lda 3
|
|
sta pool256+2
|
|
unlock pool256mutex
|
|
pla
|
|
plx
|
|
pld
|
|
rtl
|
|
|
|
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
|
|
jsl ~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
|
|
|
|
pool256 dc i4'0'
|
|
pool256mutex key
|
|
pool1024 dc i4'0'
|
|
pool1024mutex key
|
|
|
|
END
|