mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2024-09-27 20:56:05 +00:00
Compare commits
14 Commits
master
...
gno-orcali
Author | SHA1 | Date | |
---|---|---|---|
|
b5220aac6a | ||
|
1fd1de0be8 | ||
|
28f653693c | ||
|
522a6fc3f8 | ||
|
3dac15e6b9 | ||
|
cc6ee968f3 | ||
|
508d0266a0 | ||
|
d92183ad41 | ||
|
14c7a1186c | ||
|
fffeef1206 | ||
|
7566fffb6c | ||
|
f906cac5f9 | ||
|
3145f4b023 | ||
|
97c3ecad73 |
18
Makefile
Normal file
18
Makefile
Normal file
@ -0,0 +1,18 @@
|
||||
#
|
||||
# Makefile for GNO version of ORCALib
|
||||
#
|
||||
# To use this, you need a GNO system with the GNO source code in /src.
|
||||
#
|
||||
# This currently builds the library as "liborca".
|
||||
# You will have to manually copy it to /lib/ORCALib.
|
||||
#
|
||||
# The assert.o file is not included in ORCALib but is used in libc.
|
||||
|
||||
LIB = orca
|
||||
SRCS = cc.asm ctype.asm orca.asm signal2.c stdlib.asm string.asm \
|
||||
time.asm toolglue.asm vars.asm int64.asm fenv.asm fpextra.asm \
|
||||
math2.asm locale.asm uchar.asm
|
||||
|
||||
buildall .PHONY: build assert.o
|
||||
|
||||
.INCLUDE: /src/gno/lib/lib.mk
|
13
README.GNO
Normal file
13
README.GNO
Normal file
@ -0,0 +1,13 @@
|
||||
This is an updated version of the ORCALib library suitable for use with
|
||||
GNO 2.0.6. For those library functions that it implements, it contains
|
||||
the same updates and fixes as the standard version of ORCALib included
|
||||
with ORCA/C 2.2.0 B6. However, under GNO, some portions of the C standard
|
||||
library are implemented by GNO's libc rather than by ORCALib, and so
|
||||
updating ORCALib will not affect those library functions. This applies
|
||||
to all of <stdio.h>, as well as to certain other functions.
|
||||
|
||||
This library update is intended for use with ORCA/C 2.2.0 B6, but it
|
||||
should also be compatible with ORCA/C versions back to 2.1.
|
||||
|
||||
To install the update, copy the new version of ORCALib into the /lib
|
||||
directory, replacing the version provided with GNO 2.0.6.
|
@ -39,7 +39,7 @@ __assert start
|
||||
ph2 <l
|
||||
ph4 <f
|
||||
ph4 #msg
|
||||
ph4 >stderr
|
||||
ph4 >__assertfp
|
||||
jsl fprintf
|
||||
jsl abort
|
||||
|
||||
|
21
cc.asm
21
cc.asm
@ -186,9 +186,6 @@ TAB equ 9 TAB key code
|
||||
stz ~ExitList+2
|
||||
stz ~QuickExitList
|
||||
stz ~QuickExitList+2
|
||||
case on
|
||||
jsl ~InitIO reset standard I/O
|
||||
case off
|
||||
|
||||
lda cLine if cLine == 0 then
|
||||
ora cLine+2
|
||||
@ -484,13 +481,19 @@ lb2 ldy #2 dereference the pointer
|
||||
; Close (and flush) any open files
|
||||
;
|
||||
case on
|
||||
lb3 lda >stderr+6 while there is a next file
|
||||
ora >stderr+4
|
||||
lb3 lda >__cleanup+2
|
||||
ora >__cleanup
|
||||
beq lb4
|
||||
ph4 >stderr+4 close it
|
||||
dc h'22' (jsl fclose, soft reference)
|
||||
dc s3'fclose'
|
||||
bra lb3
|
||||
phk
|
||||
pea lb4-1
|
||||
short I,M
|
||||
lda >__cleanup+2
|
||||
pha
|
||||
long I,M
|
||||
lda >__cleanup
|
||||
dec A
|
||||
pha
|
||||
rtl
|
||||
case off
|
||||
;
|
||||
; return
|
||||
|
20
liborca.rez
Normal file
20
liborca.rez
Normal file
@ -0,0 +1,20 @@
|
||||
#include "Types.rez"
|
||||
|
||||
resource rVersion (0x1, purgeable3) {
|
||||
{
|
||||
2,2,0,beta,6
|
||||
},
|
||||
verUS,
|
||||
"ORCALib (GNO Version)",
|
||||
"Byte Works' General Purpose Library.\n"
|
||||
"This library is only for use with GNO.\n"
|
||||
"Build Date: " $$DATE
|
||||
};
|
||||
|
||||
resource rComment (0x1, purgeable3) {
|
||||
"ORCALib (GNO Version)\n"
|
||||
"Byte Works' General Purpose Library.\n"
|
||||
"This library is only for use with GNO.\n"
|
||||
"Build Date: " $$DATE
|
||||
};
|
||||
|
10
signal2.c
Normal file
10
signal2.c
Normal file
@ -0,0 +1,10 @@
|
||||
#ifdef __ORCAC__
|
||||
segment "libc_sys__";
|
||||
#endif
|
||||
|
||||
#include <gno/kerntool.h>
|
||||
#include <errno.h>
|
||||
|
||||
int raise(int sig) {
|
||||
return Kkill(Kgetpid(), sig, &errno);
|
||||
}
|
32
string.asm
32
string.asm
@ -902,38 +902,6 @@ lb2 sty set set the disp past the current disp
|
||||
rtl
|
||||
end
|
||||
|
||||
****************************************************************
|
||||
*
|
||||
* strerror - return the addr of an error message
|
||||
*
|
||||
* Inputs:
|
||||
* err - error number to return the error for
|
||||
*
|
||||
****************************************************************
|
||||
*
|
||||
strerror start
|
||||
maxErr equ EILSEQ max error in sys_errlist
|
||||
|
||||
phb get the error number
|
||||
plx
|
||||
ply
|
||||
pla
|
||||
phy
|
||||
phx
|
||||
phk use local data bank
|
||||
plb
|
||||
cmp #maxErr+1
|
||||
blt lb1
|
||||
lda #0
|
||||
lb1 asl A compute the index
|
||||
asl A
|
||||
tay
|
||||
ldx sys_errlist+2,Y load the address
|
||||
lda sys_errlist,Y
|
||||
plb restore caller's data bank
|
||||
rtl
|
||||
end
|
||||
|
||||
****************************************************************
|
||||
*
|
||||
* strlen - find the length of a string
|
||||
|
118
vars.asm
118
vars.asm
@ -30,123 +30,9 @@ errno entry library error number
|
||||
_ownerid entry user ID (C)
|
||||
~USER_ID entry user ID (Pascal, libraries)
|
||||
ds 2
|
||||
sys_nerr entry # of error messages
|
||||
dc i'13'
|
||||
__cleanup entry function to clean up files at exit
|
||||
dc i4'0'
|
||||
_toolErr entry last error in a tool call (C)
|
||||
~TOOLERROR entry last error in a tool call (Pascal)
|
||||
ds 2
|
||||
end
|
||||
|
||||
****************************************************************
|
||||
*
|
||||
* ~InitIO - initialize the standard I/O files
|
||||
*
|
||||
****************************************************************
|
||||
*
|
||||
~InitIO start
|
||||
|
||||
ldx #sizeofFILE-4-2 set up the file records
|
||||
lb1 lda stderr+4+sizeofFILE,X
|
||||
sta stderr+8,X
|
||||
lda stdin+4+sizeofFILE,X
|
||||
sta stdin+8,X
|
||||
lda stdout+4+sizeofFILE,X
|
||||
sta stdout+8,X
|
||||
dex
|
||||
dex
|
||||
bpl lb1
|
||||
lla stderr,stderr+4 set up the file pointers
|
||||
lla stdin,stdin+4
|
||||
lla stdout,stdout+4
|
||||
rtl
|
||||
end
|
||||
|
||||
****************************************************************
|
||||
*
|
||||
* stderr - error out file
|
||||
*
|
||||
****************************************************************
|
||||
*
|
||||
stderr start
|
||||
|
||||
dc a4'lb1'
|
||||
|
||||
lb1 dc a4'0' next file
|
||||
dc a4'0' next location to write to
|
||||
dc a4'0' first byte of buffer
|
||||
dc a4'0' end of the file buffer
|
||||
dc i4'0' size of the file buffer
|
||||
dc i4'0' count
|
||||
dc i'EOF,EOF' putback buffer
|
||||
dc i'_IONBF+_IOWRT+_IOTEXT' no buffering; allow writes; text file
|
||||
dc i'stderrID' error out
|
||||
|
||||
dc a4'0' next location to write to
|
||||
dc a4'0' first byte of buffer
|
||||
dc a4'0' end of the file buffer
|
||||
dc i4'0' size of the file buffer
|
||||
dc i4'0' count
|
||||
dc i'EOF,EOF' putback buffer
|
||||
dc i'_IONBF+_IOWRT+_IOTEXT' no buffering; allow writes; text file
|
||||
dc i'stderrID' error out
|
||||
end
|
||||
|
||||
****************************************************************
|
||||
*
|
||||
* stdin - standard in file
|
||||
*
|
||||
****************************************************************
|
||||
*
|
||||
stdin start
|
||||
|
||||
dc a4'lb1'
|
||||
|
||||
lb1 dc a4'stdout+4' next file
|
||||
dc a4'0' next location to write to
|
||||
dc a4'0' first byte of buffer
|
||||
dc a4'0' end of the file buffer
|
||||
dc i4'0' size of the file buffer
|
||||
dc i4'0' count
|
||||
dc i'EOF,EOF' putback buffer
|
||||
dc i'_IONBF+_IOREAD+_IOTEXT' no buffering; allow reads; text file
|
||||
dc i'stdinID' standard in
|
||||
|
||||
dc a4'0' next location to write to
|
||||
dc a4'0' first byte of buffer
|
||||
dc a4'0' end of the file buffer
|
||||
dc i4'0' size of the file buffer
|
||||
dc i4'0' count
|
||||
dc i'EOF,EOF' putback buffer
|
||||
dc i'_IONBF+_IOREAD+_IOTEXT' no buffering; allow reads; text file
|
||||
dc i'stdinID' standard in
|
||||
end
|
||||
|
||||
****************************************************************
|
||||
*
|
||||
* stdout - standard out file
|
||||
*
|
||||
****************************************************************
|
||||
*
|
||||
stdout start
|
||||
|
||||
dc a4'lb1'
|
||||
|
||||
lb1 dc a4'stderr+4' next file
|
||||
dc a4'0' next location to write to
|
||||
dc a4'0' first byte of buffer
|
||||
dc a4'0' end of the file buffer
|
||||
dc i4'0' size of the file buffer
|
||||
dc i4'0' count
|
||||
dc i'EOF,EOF' putback buffer
|
||||
dc i'_IONBF+_IOWRT+_IOTEXT' no buffering; allow writes; text file
|
||||
dc i'stdoutID' standard out
|
||||
|
||||
dc a4'0' next location to write to
|
||||
dc a4'0' first byte of buffer
|
||||
dc a4'0' end of the file buffer
|
||||
dc i4'0' size of the file buffer
|
||||
dc i4'0' count
|
||||
dc i'EOF,EOF' putback buffer
|
||||
dc i'_IONBF+_IOWRT+_IOTEXT' no buffering; allow writes; text file
|
||||
dc i'stdoutID' standard out
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user