Compare commits

...

14 Commits

Author SHA1 Message Date
Stephen Heumann
b5220aac6a Update ORCA/C version number to 2.2.0 B6. 2022-07-17 18:31:00 -05:00
Stephen Heumann
1fd1de0be8 Merge branch 'master' into gno-version 2022-07-16 20:45:02 -05:00
Stephen Heumann
28f653693c Update GNO version makefile to include new source files. 2022-01-10 19:10:50 -06:00
Stephen Heumann
522a6fc3f8 Merge branch 'master' into gno-version 2022-01-10 19:07:55 -06:00
Stephen Heumann
3dac15e6b9 Update GNO version makefile to include new source files. 2021-09-03 22:03:17 -05:00
Stephen Heumann
cc6ee968f3 Merge branch 'master' into gno-version 2021-09-03 21:59:40 -05:00
Stephen Heumann
508d0266a0 Update README.GNO file. 2021-02-26 22:21:58 -06:00
Stephen Heumann
d92183ad41 Update version number in rVersion resource. 2021-02-26 21:25:52 -06:00
Stephen Heumann
14c7a1186c Update GNO version makefile to include int64.asm. 2021-02-26 21:22:53 -06:00
Stephen Heumann
fffeef1206 Merge branch 'master' into gno-version 2021-02-26 21:20:39 -06:00
Stephen Heumann
7566fffb6c Add readme describing GNO version of ORCALib. 2020-02-19 12:49:29 -06:00
Stephen Heumann
f906cac5f9 Update the version in the resource fork.
This is now an ORCA/C version number, rather than a GNO version number.
2020-02-19 12:47:16 -06:00
Stephen Heumann
3145f4b023 Merge branch 'master' into gno-version.
The includes all the changes through the version in ORCA/C 2.2.0 B4, plus a small POSIX conformance tweak in strtol/strtoul.

# Conflicts:
#	assert.asm
#	cc.asm
#	ctype.asm
#	string.asm
#	vars.asm
2020-02-19 12:43:57 -06:00
Stephen Heumann
97c3ecad73 ORCALib changes for GNO.
This is a reconstruction of the ORCALib source changes for the version of ORCALib distributed with GNO 2.0.6. The library built with this code should be identical to the original GNO one, apart from insignificant junk bytes at the ends of segments and the build date in the resource fork.
2020-02-19 12:19:41 -06:00
8 changed files with 76 additions and 158 deletions

18
Makefile Normal file
View 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
View 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.

View File

@ -39,7 +39,7 @@ __assert start
ph2 <l
ph4 <f
ph4 #msg
ph4 >stderr
ph4 >__assertfp
jsl fprintf
jsl abort

21
cc.asm
View File

@ -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
View 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
View 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);
}

View File

@ -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
View File

@ -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