Manx Aztec C86 v4.2b

This commit is contained in:
davidly 2024-07-02 07:07:59 -07:00
parent 979ffce0f7
commit 3ccb69b30f
148 changed files with 22622 additions and 0 deletions

View File

@ -0,0 +1,396 @@
Aztec C86, version 4.10d
Release Document
26 Oct 88
This "readme" file describes what's new version 4.10d of Aztec C86. For
more information on Aztec C86, see the printed release documents for
versions 4.10a and 4.10c. In particular, these printed documents contain
packaging information and describe features in Aztec C86 that have been
added since the manual was last printed.
Version 4.10d of Aztec C86 differs from version 4.10c in the following
ways: (1) sdb has been enhanced; and (2) bugs have been fixed.
The programs and functions that have had bugs fixed are:
* cc
* cgen
* as
* z
* hex86
* signal() and raise()
* all libraries
The new versions of cc, cgen, and as must be used together; you can't,
for example, use v4.10c of cc with v4.10d of cgen.
The following paragraphs describe the new features of sdb.
1. SDB: New Features
Version 4.10d of sdb has the following new features:
* Separate virtual screens for sdb and the program being debugged are
now required.
* sdb's screen is now formatted, with different sections of the screen
being used for different purposes.
* The Microsoft mouse, and compatibles, are now supported by sdb.
* A new program, initsdb, is used to configure sdb. THIS PROGRAM MUST BE
RUN BEFORE SDB.
* A new environment variable, SDBOPT, can be used to pass options to
sdb.
* sdb's bm command (memory-change breakpoint) now works.
* The new be command sets an expression breakpoint. When the specified
expression is true, a breakpoint is taken.
* sdb now supports the 43-line mode of EGA display adaptors.
* The -w option has been changed. It now suppresses restoration of the
program screen when single-stepping, thus reducing screen flicker. The
old meaning of -w has been taken over by the new -p option.
* The w command has been changed. It now toggles screen restoration
mode. For example, if screen restoration was disabled, the w command
disables it.
* The new -p option, defines the display page that sdb is to use for its
screen.
* The new -m option defines the memory address at which the display
memory begins.
Page 1
Aztec C86, v4.10d Release Document
The following paragraphs describe these features in detail.
1.1 Virtual screens
Separate virtual screens for sdb and the program being debugged are now
required. sdb uses one virtual screen to display its information and to get
operator commands, and the program uses the other.
As with previous versions of sdb, virtual screens can either be stored in
display adaptor pages or in sdb buffers:
+ Virtual screens can be stored in a display adaptor page, if the
display adaptor has multiple pages. (The CGA is one such adaptor).
sdb's screen is stored in one page, and the program is free to use any
other page. Screen swapping is fast, since to switch the display from
one virtual screen to the other, sdb simply outputs a single command
to the display adaptor.
+ Virtual screens can be stored in sdb buffers, if the display adaptor
has only one display page; it can also be used if you want sdb to
share display page 0 with the program that's being debugged. To switch
the display from one virtual screen to the other, sdb stores the
screen page in one of its buffers, and restores the virtual screen
that's in the other buffer.
You define the display type when you run initsdb. If the display contains
only one page, then sdb will automatically store virtual pages in its own
buffers. If the display contains multiple pages you tell initsdb where
virtual screens are to be stored. If display pages are to be used, you tell
initsdb the page that sdb is to use; this can be overriden when sdb is
started, using the new -p option.
The -p option has the form -px, where x is the number of the page that
sdb is to use.
1.2 Formatted Screen
sdb's virtual screen is now formatted, with different sections of the
screen displaying different information, as follows:
* The top line lists the name of the source file currently being
displayed, and specifies whether sdb is in source or assembly mode.
* The next few lines display lines in the current source file. These
lines act like a window into the source file, a window that can be
moved (as described below) to display different sections of the source
file.
* The next line is used to enter and display commands. sdb maintains a
log of commands, and this line acts like a window into that log. You
can move the window around within the log, and then easily rexecute a
previously-entered command.
* The remaining lines are used for sdb output. sdb remembers data that
it has previously displayed, and these lines act like a window onto
that data, a window that can be moved to recall different sections of
the displayed data.
* The rightmost column contains a scroll bar and other features that are
used with a mouse.
Page 2
Aztec C86, v4.10d Release Document
1.3 Keys used to manipulate sdb
Function keys and cursor-motion keys have meaning to sdb, as follows:
Key Meaning
F1 Scroll source window up one line
F2 Scroll source window down one line
F3 Move command line up one line (also makes source window
one line smaller and data window one line larger)
F4 Move command line down one line (also makes source
window one line larger and data window one line
smaller)
F5 Scroll data window up one line
F6 Scroll data window down one line
Alt-F1 Move source window to the top of the source file
Alt-F2 Move source window to the bottom of the source file
Alt-F3 Move the command line to the top of the screen
Alt-F4 Move the command line to the bottom of the screen
Alt-F5 Move the data window to the top of the data buffer
Alt-F6 Move the data window to the bottom of the data buffer
Shift-F1 Move the source window to the position at which it was
located before the previous Alt-F1 or Alt-F2
Shift-F2 Same as Shift-F1
Shift-F3 Move the command line to the position at which it was
located before the previous Alt-F3 or Alt-F4
Shift-F4 Same as Shift-F3
Shift-F5 Move the data window to the position at which it was
located before the previous Alt-F5 or Alt-F6
Shift-F6 Same as Shift-F5
F9 Scroll source window to current source line
F10 Toggle between Source and Assembly modes
PgUp Move the source window up one page
PgDn Move the source window down one page
Up arrow Move command window up one line in the command log
Dn arrow Move command window down one line in the command log
Left arrow
Move cursor left one character on the command line
Right arrow
Move cursor right one character on the command line
Delete Delete the character on the command line that's under
the cursor
Home Move the cursor to the beginning of the command line
End Move the cursor to the end of the command line
Escape Display the other virtual screen
Right single quote
Same as Escape
Control-L Redraw the screen
1.4 Using a mouse
There are three sections of the sdb screen in which a mouse can be used:
the scroll bar at the right of the screen, the top line of the screen, and
the command line. These sections are described in the following paragraphs.
Page 3
Aztec C86, v4.10d Release Document
1.4.1 The scroll bar
The scroll bar has three sections. The box in the middle of the bar with
the up and down triangles positions the command line on the screen, and
hence indirectly controls the size of the source and data windows. The area
above the triangles positions the source window; the area below the
triangles positions the data window.
1.4.1.1 Moving the command line
To move the command line with the mouse, move the mouse cursor to the box
that contains the triangles. Press and hold the left mouse button, drag the
cursor to the desired location, and release the mouse button.
1.4.1.2 Positioning the source window
The area of the scroll bar that positions the source window contains a
solid rectangle; this indicates the current position of the window within
the source file. When the rectangle is at the top of the area, the window
is at the top of the file; when the rectangle is at the bottom of the area,
the window is at the bottom of the file; and so on. Using the mouse, you
can move the rectangle within the scroll bar; this causes the source window
to move the source window within the source file. To do this, put the mouse
cursor in the rectangle, press and hold the left mouse button, move the
mouse cursor to the desired position in the scroll bar, and release the
button.
At the top of the source window's section of the scroll bar are two
upward-facing arrows. To scroll the source window up a line at a line, move
the mouse cursor to the arrows, press and hold the left mouse button. The
source window will begin scrolling upward. When it reaches the desired
location, release the button.
At the bottom of the source window's section of the scroll bar are two
downward-facing arrows. They are used to scroll the source window down a
line at a time, in a manner analagous to the up arrows.
To move the source window up a page, move the mouse cursor somewhere
below the up arrows and above the rectangle, and click the left mouse
button.
To move the source window down a page, move the mouse cursor somewhere
above the down arrows and below the rectangle, and click the left mouse
button.
To move the source window to the beginning or end of the source file,
move the mouse cursor to the up or down arrows, respectively, and click
both mouse buttons.
1.4.1.3 Positioning the data window
The data window's section of the scroll bar looks just like the source
window's, and is used in the same way. For example, (1) the rectangle
indicates the position of the window in the data buffer and can be used to
move to the data window within the data buffer; (2) the up arrows scroll
the data window up in the data buffer one line; (3) the down arrows scroll
the data window down one line; (4) and so on.
Page 4
Aztec C86, v4.10d Release Document
1.4.2 Using the mouse on the top line
The top line of sdb's virtual screen has a section that specifies whether
sdb is in source or assembly mode, and a section that lists the file that's
currently displayed in the source window. To use the mouse to toggle
between source and assembly mode, move the mouse cursor to the top line's
source/assembly mode section and click the left mouse button.
To move the source window back to the source line at which execution is
currently stopped, move the mouse cursor to the top line's source file
section and click the left mouse button.
1.4.3 Using the mouse on the command line
The mouse can be used to position the text cursor on the command line. To
do this, just move the mouse cursor to the desired location and click the
left mouse button.
1.4.4 Switching screens with the mouse
The mouse can be used to switch the display from one virtual screen to
another: just click the right mouse button.
1.5 The SDBOPT environment variable
The SDBOPT environment variable can be used to pass frequently-used
options to sdb, without having to explicitly list them on the command line
when sdb is started.
For example, if you always want the -p2 option to be specified when sdb
is started, you could set SDBOPT like this:
set SDBOPT=-p2
1.6 The initsdb utility
The initsdb utility is used to define the attributes of your monitor to
sdb and the way you want the lines on sdb's virtual screen to appear. The
information you select is written to a file named sdb.ini.
1.6.1 Using initsdb
initsdb's screen is organized into four sections. The top three sections
are used to set options, and the bottom section summarizes the keys that
you can use with initsdb. The three option-selecting sections are entitled
Basic Options, Advanced Options, and Color selection. Selections are
toggled using the <ENTER> key.
In the Basic Options section you define the type of monitor you have, and
for CGA monitors, whether you want "snow" removed. This section also has
options that you select to write your choices to the sdb.ini file, to abort
without writing anything, and to quit after writing.
In the Color Selection section you define the attributes of the various
lines that appear on sdb's screen; i.e. the foreground and background color
of each type of line. There are five lines in the Color Selection section,
each of which corresponds to one type of line on the sdb screen. To select
the attributes of a line, move the cursor to a line; then type 'f' or 'F'
Page 5
Aztec C86, v4.10d Release Document
to advance or decrement the line's forground color. Type 'b' or 'B' to
advance or decrement the line's background color.
The Advanced Options section contains several display-dependent options.
You are only allowed to change the ones that are relevant to your monitor.
For example, if you have an EGA monitor, you can select the option that
causes sdb to use a 43 line screen. If you have a CGA monitor, you can
select whether you want sdb and the program that's being debugged to share
the same display page or whether you want sdb and the program to each have
a separate display page.
1.6.2 The sdb.ini file
Configuration options are stored in a file named sdb.ini. When sdb and
initsdb start, they look for this file first in the current drive's current
directory, and then in the directories specified in the PATH environment
variable.
initsdb writes configuration options back to the same file; if it didn't
find an sdb.ini file, it writes the options to an sdb.ini file in the
current directory.
1.7 Summary of new and changed sdb options
Here is a summary of the new sdb options:
-px On a CGA monitor, have sdb use page x for its screen.
-mx Display memory begins at paragraph x, where x is a
hexadecimal number. If this option isn't used, sdb will use
the standard value for your type of display.
-w When single-stepping, don't restore the program's screen.
1.8 Summary of new and changed commands
Here is a summary of the sdb commands that are new or have changed:
w Toggle screen restoration mode.
be Set or remove a memory change breakpoint
Page 6

View File

@ -0,0 +1,890 @@
build.bat
echo off
if NOT '%1'=='RESTART' goto makeall
shift
goto %RESTART%
:makeall
make clean
:SMALL
set RESTART=SMALL
make MODEL= AMODEL=0 %1 %2 %3 %4 %5 %6
if ERRORLEVEL 1 goto quit
make clean
:COMPACT
set RESTART=COMPACT
make MODEL=lc AMODEL=1 %1 %2 %3 %4 %5 %6
if ERRORLEVEL 1 goto quit
make clean
:MEDIUM
set RESTART=MEDIUM
make MODEL=ld AMODEL=2 %1 %2 %3 %4 %5 %6
if ERRORLEVEL 1 goto quit
make clean
:LARGE
set RESTART=LARGE
make MODEL=l AMODEL=3 %1 %2 %3 %4 %5 %6
if ERRORLEVEL 1 goto quit
make clean
set RESTART=
echo All models built OK.
goto done
:quit
echo Build failed making %RESTART% model libraries.
echo To restart build type "build RESTART [parameters]"
:done
c.bld
dos20/dosdir.o
dos20/monitor.o
dos20/profil.o
stdio/tmpfile.o
stdio/perror.o
stdio/fdopen.o
stdio/fgets.o
stdio/assert.o
stdio/fprintf.o
stdio/fputs.o
stdio/fread.o
stdio/fscanf.o
stdio/fseek.o
stdio/gets.o
stdio/getchar.o
stdio/getw.o
stdio/puterr.o
stdio/puts.o
stdio/putw.o
stdio/scanf.o
stdio/agetc.o
stdio/getc.o
stdio/setbuf.o
stdio/ungetc.o
stdio/tmpnam.o
stdio/mktemp.o
misc/atoi.o
misc/atol.o
misc/calloc.o
misc/lcalloc.o
misc/qsort.o
misc/sscanf.o
misc/scan.o
misc/rand.o
misc/abort.o
misc/raise.o
dos20/bdos.o
dos20/bdosx.o
dos20/chmod.o
dos20/csread.o
dos20/ctime.o
dos20/asctime.o
dos20/dostime.o
dos20/dup.o
dos20/execl.o
dos20/execlp.o
dos20/execvp.o
dos20/execv.o
dos20/exec.o
dos20/fexecl.o
dos20/fexecv.o
dos20/fcbinit.o
dos20/getcwd.o
dos20/ioctl.o
dos20/dioctl.o
dos20/localtim.o
dos20/mkdir.o
dos20/stat.o
dos20/system.o
misc/sprintf.o
dos20/fexec.o
dos20/getenv.o
dos20/utime.o
dos20/ftime.o
dos20/time.o
dos20/wait.o
dos20/access.o
mch86/cswt.o
mch86/cswit.o
mch86/clswit.o
mch86/farcall.o
mch86/fcall.o
mch86/index.o
mch86/olsubs.o
mch86/movblock.o
mch86/peek.o
mch86/port.o
mch86/rindex.o
mch86/segread.o
mch86/setjmp.o
mch86/setmem.o
mch86/strcat.o
mch86/strcpy.o
mch86/strncpy.o
mch86/strstr.o
mch86/stricmp.o
mch86/strlwr.o
mch86/strrev.o
mch86/swapmem.o
dos20/lmalloc.o
mch86/sysint.o
mch86/toupper.o
mch86/csav.o
dos20/dos.o
dos20/dosx.o
mch86/memccpy.o
mch86/memchr.o
mch86/memcmp.o
mch86/memcpy.o
mch86/memset.o
dos20/syserr.o
mch86/pointers.o
mch86/fptrs.o
mch86/ptradd.o
mch86/strchr.o
mch86/strrchr.o
dos20/clock.o
misc/signal.o
dos20/sighand.o
dos20/sigfix.o
misc/sigtable.o
dos20/mon.o
dos20/clk.o
stdio/fopen.o
stdio/fwrite.o
stdio/printf.o
stdio/putchar.o
stdio/aputc.o
stdio/putc.o
stdio/getbuff.o
misc/malloc.o
misc/format.o
misc/ctype.o
dos20/open.o
mch86/lsubs.o
mch86/strcmp.o
mch86/strlen.o
dos20/sys.o
mch86/ptrdiff.o
dos20/sbegin.o
dos20/croot.o
mch86/fltstub.o
dos20/stkover.o
dos20/stksiz.o
dos20/io.o
dos20/ttyio.o
mch86/movmem.o
dos20/isatty.o
dos20/ssbrk.o
dos20/filelock.o
c86.bld
stdio/tmpfile.o
stdio/perror.o
stdio/fdopen.o
stdio/fgets.o
stdio/fopen.o
stdio/assert.o
stdio/fprintf.o
stdio/fputs.o
stdio/fread.o
stdio/fscanf.o
stdio/fseek.o
stdio/fwrite.o
stdio/gets.o
stdio/getchar.o
stdio/getw.o
stdio/printf.o
stdio/puterr.o
stdio/puts.o
stdio/putchar.o
stdio/aputc.o
stdio/putw.o
stdio/putc.o
stdio/scanf.o
stdio/agetc.o
stdio/getc.o
stdio/getbuff.o
stdio/setbuf.o
stdio/ungetc.o
stdio/tmpnam.o
stdio/mktemp.o
misc/atoi.o
misc/atol.o
misc/calloc.o
misc/qsort.o
misc/sscanf.o
misc/scan.o
misc/rand.o
misc/abort.o
misc/raise.o
misc/signal.o
misc/sigtable.o
misc/malloc.o
misc/sprintf.o
misc/format.o
misc/ctype.o
mch86/cswt.o
mch86/cswit.o
mch86/clswit.o
mch86/farcall.o
mch86/fcall.o
mch86/index.o
mch86/lsubs.o
mch86/olsubs.o
mch86/peek.o
mch86/port.o
mch86/rindex.o
mch86/segread.o
mch86/setjmp.o
mch86/strlen.o
mch86/strncpy.o
mch86/swapmem.o
mch86/sysint.o
mch86/toupper.o
cpm86/sbrk.o
mch86/memccpy.o
mch86/memchr.o
mch86/memcmp.o
mch86/memcpy.o
mch86/memset.o
cpm86/access.o
cpm86/csread.o
mch86/movblock.o
cpm86/execl.o
cpm86/exec.o
cpm86/ioctl.o
cpm86/isatty.o
cpm86/lseek.o
cpm86/read.o
cpm86/rename.o
cpm86/write.o
cpm86/blkio.o
mch86/csav.o
mch86/pointers.o
mch86/fptrs.o
mch86/ptrdiff.o
mch86/ptradd.o
mch86/strchr.o
mch86/strrchr.o
cpm86/stkover.o
cpm86/begin.o
cpm86/croot.o
cpm86/close.o
cpm86/open.o
mch86/strcmp.o
cpm86/ceof.o
cpm86/find.o
mch86/setmem.o
mch86/strcat.o
mch86/strcpy.o
mch86/movmem.o
cpm86/unlink.o
mch86/fltstub.o
cpm86/bdos.o
cpm86/fcbinit.o
cpm86/user.o
cl.bld
dos20/monitor.o
dos20/profil.o
dos20/dosdir.o
stdio/tmpfile.o
stdio/perror.o
stdio/fdopen.o
stdio/fgets.o
stdio/assert.o
stdio/fprintf.o
stdio/fputs.o
stdio/fread.o
stdio/fscanf.o
stdio/fseek.o
stdio/gets.o
stdio/getchar.o
stdio/getw.o
stdio/puterr.o
stdio/puts.o
stdio/putw.o
stdio/scanf.o
stdio/agetc.o
stdio/getc.o
stdio/setbuf.o
stdio/ungetc.o
stdio/tmpnam.o
stdio/mktemp.o
misc/atoi.o
misc/atol.o
misc/calloc.o
misc/lcalloc.o
misc/qsort.o
misc/sscanf.o
misc/scan.o
misc/rand.o
misc/abort.o
misc/raise.o
dos20/bdos.o
dos20/bdosx.o
dos20/chmod.o
dos20/csread.o
dos20/ctime.o
dos20/asctime.o
dos20/dostime.o
dos20/dup.o
dos20/execl.o
dos20/execlp.o
dos20/execvp.o
dos20/execv.o
dos20/exec.o
dos20/fexecl.o
dos20/fexecv.o
dos20/fcbinit.o
dos20/getcwd.o
dos20/ioctl.o
dos20/dioctl.o
dos20/localtim.o
dos20/mkdir.o
dos20/stat.o
dos20/system.o
misc/sprintf.o
dos20/fexec.o
dos20/getenv.o
dos20/utime.o
dos20/ftime.o
dos20/time.o
dos20/wait.o
dos20/access.o
mch86/cswit.o
mch86/clswit.o
mch86/farcall.o
mch86/fcall.o
mch86/index.o
mch86/movblock.o
mch86/peek.o
mch86/port.o
mch86/rindex.o
mch86/segread.o
mch86/setjmp.o
mch86/setmem.o
mch86/strcat.o
mch86/strcpy.o
mch86/strncpy.o
mch86/strstr.o
mch86/stricmp.o
mch86/strlwr.o
mch86/strrev.o
mch86/swapmem.o
mch86/sysint.o
mch86/toupper.o
mch86/csav.o
dos20/dos.o
dos20/dosx.o
mch86/memccpy.o
mch86/memchr.o
mch86/memcmp.o
mch86/memcpy.o
mch86/memset.o
dos20/syserr.o
mch86/pointers.o
mch86/fptrs.o
mch86/strchr.o
mch86/strrchr.o
dos20/clock.o
misc/signal.o
dos20/sighand.o
dos20/sigfix.o
misc/sigtable.o
dos20/mon.o
dos20/clk.o
stdio/fopen.o
stdio/fwrite.o
stdio/printf.o
stdio/putchar.o
stdio/aputc.o
stdio/putc.o
stdio/getbuff.o
misc/ldlmallo.o
misc/ldmalloc.o
misc/format.o
misc/ctype.o
dos20/open.o
mch86/lsubs.o
mch86/strcmp.o
mch86/strlen.o
dos20/sys.o
mch86/ptrdiff.o
mch86/ptradd.o
dos20/lbegin.o
dos20/stksiz.o
dos20/croot.o
mch86/fltstub.o
dos20/stkover.o
dos20/io.o
dos20/ttyio.o
mch86/movmem.o
dos20/isatty.o
dos20/lsbrk.o
dos20/filelock.o
clc.bld
stdio/tmpfile.o
dos20/monitor.o
dos20/profil.o
dos20/dosdir.o
stdio/perror.o
stdio/fdopen.o
stdio/fgets.o
stdio/assert.o
stdio/fprintf.o
stdio/fputs.o
stdio/fread.o
stdio/fscanf.o
stdio/fseek.o
stdio/gets.o
stdio/getchar.o
stdio/getw.o
stdio/puterr.o
stdio/puts.o
stdio/putw.o
stdio/scanf.o
stdio/agetc.o
stdio/getc.o
stdio/setbuf.o
stdio/ungetc.o
stdio/tmpnam.o
stdio/mktemp.o
misc/atoi.o
misc/atol.o
misc/calloc.o
misc/lcalloc.o
misc/qsort.o
misc/sscanf.o
misc/scan.o
misc/rand.o
misc/abort.o
misc/raise.o
dos20/bdos.o
dos20/bdosx.o
dos20/chmod.o
dos20/csread.o
dos20/ctime.o
dos20/asctime.o
dos20/dostime.o
dos20/dup.o
dos20/execl.o
dos20/execlp.o
dos20/execvp.o
dos20/execv.o
dos20/exec.o
dos20/fexecl.o
dos20/fexecv.o
dos20/fcbinit.o
dos20/getcwd.o
dos20/ioctl.o
dos20/dioctl.o
dos20/localtim.o
dos20/mkdir.o
dos20/stat.o
dos20/system.o
misc/sprintf.o
dos20/fexec.o
dos20/getenv.o
dos20/utime.o
dos20/ftime.o
dos20/time.o
dos20/wait.o
dos20/access.o
mch86/cswit.o
mch86/clswit.o
mch86/farcall.o
mch86/fcall.o
mch86/index.o
mch86/movblock.o
mch86/peek.o
mch86/port.o
mch86/rindex.o
mch86/segread.o
mch86/setjmp.o
mch86/setmem.o
mch86/strcat.o
mch86/strcpy.o
mch86/strncpy.o
mch86/strstr.o
mch86/stricmp.o
mch86/strlwr.o
mch86/strrev.o
mch86/swapmem.o
dos20/lmalloc.o
mch86/sysint.o
mch86/toupper.o
mch86/csav.o
dos20/dos.o
dos20/dosx.o
mch86/memccpy.o
mch86/memchr.o
mch86/memcmp.o
mch86/memcpy.o
mch86/memset.o
dos20/syserr.o
mch86/pointers.o
mch86/fptrs.o
mch86/ptradd.o
mch86/strchr.o
mch86/strrchr.o
dos20/clock.o
misc/signal.o
dos20/sighand.o
dos20/sigfix.o
misc/sigtable.o
dos20/mon.o
dos20/clk.o
stdio/fopen.o
stdio/fwrite.o
stdio/printf.o
stdio/putchar.o
stdio/aputc.o
stdio/putc.o
stdio/getbuff.o
misc/malloc.o
misc/format.o
misc/ctype.o
dos20/open.o
mch86/lsubs.o
mch86/strcmp.o
mch86/strlen.o
dos20/sys.o
mch86/ptrdiff.o
dos20/sbegin.o
dos20/croot.o
mch86/fltstub.o
dos20/stkover.o
dos20/io.o
dos20/ttyio.o
mch86/movmem.o
dos20/isatty.o
dos20/ssbrk.o
dos20/stksiz.o
dos20/filelock.o
cld.bld
dos20/monitor.o
dos20/profil.o
dos20/dosdir.o
stdio/tmpfile.o
stdio/perror.o
stdio/fdopen.o
stdio/fgets.o
stdio/assert.o
stdio/fprintf.o
stdio/fputs.o
stdio/fread.o
stdio/fscanf.o
stdio/fseek.o
stdio/gets.o
stdio/getchar.o
stdio/getw.o
stdio/puterr.o
stdio/puts.o
stdio/putw.o
stdio/scanf.o
stdio/agetc.o
stdio/getc.o
stdio/setbuf.o
stdio/ungetc.o
stdio/tmpnam.o
stdio/mktemp.o
misc/atoi.o
misc/atol.o
misc/calloc.o
misc/lcalloc.o
misc/qsort.o
misc/sscanf.o
misc/scan.o
misc/rand.o
misc/abort.o
misc/raise.o
dos20/bdos.o
dos20/bdosx.o
dos20/chmod.o
dos20/csread.o
dos20/ctime.o
dos20/asctime.o
dos20/dostime.o
dos20/dup.o
dos20/execl.o
dos20/execlp.o
dos20/execvp.o
dos20/execv.o
dos20/exec.o
dos20/fexecl.o
dos20/fexecv.o
dos20/fcbinit.o
dos20/getcwd.o
dos20/ioctl.o
dos20/dioctl.o
dos20/localtim.o
dos20/mkdir.o
dos20/stat.o
dos20/system.o
misc/sprintf.o
dos20/fexec.o
dos20/getenv.o
dos20/utime.o
dos20/ftime.o
dos20/time.o
dos20/wait.o
dos20/access.o
mch86/cswit.o
mch86/clswit.o
mch86/farcall.o
mch86/fcall.o
mch86/index.o
mch86/movblock.o
mch86/peek.o
mch86/port.o
mch86/rindex.o
mch86/segread.o
mch86/setjmp.o
mch86/setmem.o
mch86/strcat.o
mch86/strcpy.o
mch86/strncpy.o
mch86/swapmem.o
mch86/sysint.o
mch86/csav.o
mch86/strstr.o
mch86/stricmp.o
mch86/strlwr.o
mch86/strrev.o
mch86/toupper.o
dos20/dos.o
dos20/dosx.o
mch86/memccpy.o
mch86/memchr.o
mch86/memcmp.o
mch86/memcpy.o
mch86/memset.o
dos20/syserr.o
mch86/pointers.o
mch86/fptrs.o
mch86/strchr.o
mch86/strrchr.o
dos20/clock.o
misc/signal.o
dos20/sighand.o
dos20/sigfix.o
misc/sigtable.o
dos20/mon.o
dos20/clk.o
stdio/fopen.o
stdio/fwrite.o
stdio/printf.o
stdio/putchar.o
stdio/aputc.o
stdio/putc.o
stdio/getbuff.o
misc/ldlmallo.o
misc/ldmalloc.o
misc/format.o
misc/ctype.o
dos20/open.o
mch86/lsubs.o
mch86/strcmp.o
mch86/strlen.o
dos20/sys.o
mch86/ptrdiff.o
mch86/ptradd.o
dos20/lbegin.o
dos20/stksiz.o
dos20/croot.o
mch86/fltstub.o
dos20/stkover.o
dos20/io.o
dos20/ttyio.o
mch86/movmem.o
dos20/isatty.o
dos20/lsbrk.o
dos20/filelock.o
m.bld
math/asin.o
math/atan.o
math/floor.o
math/pow.o
math/log.o
math/random.o
math/sin.o
math/sinh.o
math/sqrt.o
math/tan.o
math/tanh.o
math/exp.o
stdio/fprintf.o
stdio/printf.o
misc/sprintf.o
misc/fformat.o
stdio/fscanf.o
stdio/scanf.o
misc/sscanf.o
misc/fscan.o
math/atof.o
math/ftoa.o
math/frexp.o
math/fabs.o
math/fpst.o
math/fsubs.o
m87.bld
math/floor87.o
math/pow87.o
math/log87.o
math/random87.o
math/sin87.o
math/sinh87.o
math/tan87.o
math/tanh87.o
stdio/fprintf.o
stdio/printf.o
misc/sprintf.o
misc/fformat.o
stdio/fscanf.o
stdio/scanf.o
misc/sscanf.o
misc/fscan87.o
math/atof87.o
math/ftoa87.o
math/asin87.o
math/sqrt87.o
math/atan87.o
math/exp1087.o
math/exp87.o
math/fmod87.o
math/frexp87.o
math/fabs87.o
math/fpst.o
math/isnan.o
math/fsubs87.o
math/chk87.o
m87s.bld
math/asin.o
math/atan.o
math/floor.o
math/pow.o
math/log.o
math/random.o
math/sin.o
math/sinh.o
math/sqrt87s.o
math/tan.o
math/tanh.o
math/exp.o
stdio/fprintf.o
stdio/printf.o
misc/sprintf.o
misc/fformat.o
stdio/fscanf.o
stdio/scanf.o
misc/sscanf.o
misc/fscan.o
math/atof.o
math/ftoa.o
math/frexp87s.o
math/fabs.o
math/fpst.o
math/fsubs87s.o
makefile
MODEL=
AMODEL=0
all: dos math86 math87 maths graph scn rom
@echo all done
math: math86 math87 maths
@echo math all done
clean:
del dos20\*.o
del math\*.o
del mch86\*.o
del misc\*.o
del stdio\*.o
del cpm86\*.o
del graphics\*.o
del screen\*.o
dos: mkdos20 mkmch86 mkmisc mkstdio
del libs\c$(MODEL).lib
lb libs/c$(MODEL).lib -f c$(MODEL).bld
cpm: mkcpm mkmch86 mkmisc mkstdio
del libs\c86$(MODEL).lib
lb libs/c86$(MODEL).lib -f c86$(MODEL).bld
math86: mkmath mathmisc mathstdio
del libs\m$(MODEL).lib
lb libs/m$(MODEL).lib -f m.bld
maths: mkmath mathmisc mathstdio
del libs\m87s$(MODEL).lib
lb libs/m87s$(MODEL).lib -f m87s.bld
math87: mkmath87 mathmisc mathstdio
del libs\m87$(MODEL).lib
lb libs/m87$(MODEL).lib -f m87.bld
graph:
cd graphics
make MODEL=$(MODEL) AMODEL=$(AMODEL) DIR=..\libs\ ..\libs\g$(MODEL).lib
cd ..
scn:
cd screen
make MODEL=$(MODEL) AMODEL=$(AMODEL) DIR=..\libs\ ..\libs\s$(MODEL).lib
cd ..
rom:
cd mch86
make MODEL=$(MODEL) AMODEL=$(AMODEL) DIR=..\libs\ ..\libs\\$(MODEL)rom.o
cd ..
ovly:
cd mch86
make MODEL=$(MODEL) AMODEL=$(AMODEL) DIR=..\libs\ ovly$(MODEL)
cd ..
mkdos20:
cd dos20
make MODEL=$(MODEL) AMODEL=$(AMODEL) bld$(MODEL)
cd ..
mkcpm:
cd cpm86
make MODEL=$(MODEL) AMODEL=$(AMODEL) bld$(MODEL)
cd ..
mkmath:
cd math
make MODEL=$(MODEL) AMODEL=$(AMODEL) bld$(MODEL)
cd ..
mkmath87:
cd math
make MODEL=$(MODEL) AMODEL=$(AMODEL) bld87$(MODEL)
cd ..
mkmch86:
cd mch86
make MODEL=$(MODEL) AMODEL=$(AMODEL) bld$(MODEL)
cd ..
mkmisc:
cd misc
make MODEL=$(MODEL) AMODEL=$(AMODEL) bld$(MODEL)
cd ..
mathmisc:
cd misc
make MODEL=$(MODEL) AMODEL=$(AMODEL) math
cd ..
mkstdio:
cd stdio
make MODEL=$(MODEL) AMODEL=$(AMODEL) bld$(MODEL)
cd ..
mathstdio:
cd stdio
make MODEL=$(MODEL) AMODEL=$(AMODEL) math
cd ..
arc:
mkarcv build.arc <build.bld

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
August 24, 1987
The DBGMAP program converts an Aztec .DBG file to an Microsoft .MAP file.
It currently converts global data and source line data. The usage is:
dbgmap filename
Let me know if there are any questions.
Paul McClintock
Computer Dymamics
(803) 877-8700

View File

@ -0,0 +1,668 @@
/********************************************
dbgmap - conversion utily for
Aztec C
This utility converts an Aztec C
symbol table file (.DBG) into a
RDSD compatible symbol file (.MAP).
Paul McClintock April 21, 1987
Last Edit April 21, 1987
(c) Lines Unlimited April 1987
*******************************************/
/******************************************
The following definition of the Aztec .DBG
file is the results of a phone coversation with
Tom Ferwick of Aztec. The .DBG file is a
complex binary symbol file containing substancially
more data then the Microsoft .MAP file is able
to contain.
The .DBG file format is based on 64 byte records.
Each record type has a unique structure.
HEADER RECORD :
type_def dw 13678 ; 0356Eh
num_struct dw ; number of structure records
start_struct dw ; starting record # for struct
num_strings dw ; total # of strings
total_string_lnth dw ; total string table length
start_string dw ; starting record for strings
num_src_line_rec dw ; number of src line records
num_block_rec dw ; number of block records
num_sym_rec dw ; number of symbol records
; offsets into symbol data
s_abs_symbol dw ; 1st aboslute symbol
s_code_symbol dw ; 1st code symbol
s_data_symbol dw ; 1st data symbol
SYMBOL RECORD :
type_def dw 15431 ; 03C47h
name_idx dw ; name string subscript
type_idx dw ; type string subscript
struct_idx dw ; index into struct table
add_offset dw ;
add_segment dw ; also used as a flag word
-2 = Auto variable BP.[add_offset]
-3 = Register variable
add_offset == 5 for SI
add_offset == 6 for DI
-4 = argument BP.[add_offset]
-5 = argument, Register variable
-6 = TYPE DEF name
Type Strings Modifers
* = 16 Bit Pointer
# = 32 Bit Pointer
[size = size of array
( = Near Function
{ = Far Function
Base Type Characters
c = char
C = unsigned char
i = int
I = unsigned int
l = long
L = unsigned int
f = float
D = double
V = void
: = struct
SOURCE LINE RECORD :
type_def dw 12345 ; 3039h
add_offset dw ; starting address offset
add_segment dw ; starting address segment
file_name dw ; file name string subscript
line_number dw ; starting source line number
object_displacement db ; obj code displacement / line
Special flag bit
0FFH == end of obj offsets array
00h to 07Fh == 8 bit object code displacement
080h to 0FEh == 15 bit object code displacement
SYMBOL SCOPE DEF RECORD :
type_def dw 15432 ; 03C48h (BLOCK)
Unknown record format
STRUCT DEF RECORD :
; no type_def
;
name_idx dw ; name string subscript
type_idx dw ; type string subscript
struct_idx dw ; index into struct table
add_segment dw ; also used as a flag word
*******************************************/
#include <stdio.h>
#include <fcntl.h>
#include <sys\types.h>
#include <sys\stat.h>
#include <io.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
/* .DBG Header record */
struct HEADER
{
unsigned int type_def, /* 13678 */
num_struct, /* nuber of struct records */
start_struct, /* starting record for struct */
num_strings, /* total num of strings */
tot_str_lnth, /* total strings length */
start_string, /* starting record for string */
num_src_rec, /* total src records */
num_block_rec, /* total block records */
num_sym_rec, /* total symbol records */
s_abs_sym, /* starting abs symbol */
s_code_sym, /* starting code symbol */
s_data_sym; /* starting data symbol */
unsigned int fill[20]; /* total size of 64 bytes */
};
/* Public Symbols */
struct SYMBOL
{
unsigned int name_idx, /* symbol name index */
type_idx, /* symbol type index */
struct_idx, /* index into struct table */
add_offset, /* address offset value */
add_segment; /* address segment value */
};
struct SYM_RECORD
{
unsigned int type_def; /* 15431 */
struct SYMBOL sym_data[6];
unsigned int fill[1]; /* total size of 64 bytes */
};
/* Internal Format */
struct SYM_DATA
{
struct SYM_DATA *next; /* linked list */
unsigned int name_idx, /* symbol name index */
type_idx, /* symbol type index */
add_offset, /* address offset value */
add_segment, /* address segment value */
struct_idx; /* index into struct table */
};
#define RECORDSIZE 64
#define LINEENTRY (RECORDSIZE - 5*sizeof(short))
/* Source Line numbers */
struct SRC_RECORD
{
unsigned short type_def, /* 12345 */
add_offset, /* address offset value */
add_segment, /* address segment value */
file_idx, /* function's src file index */
line_num; /* starting line number */
unsigned char obj_displ[LINEENTRY]; /* object code displacement */
};
/* internal format */
struct SRC_DATA
{
struct SRC_DATA *next; /* linked list */
unsigned int file_idx, /* src file index */
line_num, /* specified line number */
add_offset,
add_segment;
};
/* Global DATA */
struct HEADER dbg_header;
struct SYM_DATA *sym_list = NULL; /* header for linked list */
int sym_count = 0; /* number of entries */
unsigned short max_symbol ; /* max valid symbol index */
struct SRC_DATA *src_list = NULL; /* header for linked list */
int src_count = 0; /* number of entries */
char **str_idx, *str_buff; /* string buffer pointers */
char *dbg_file, *map_file; /* file paths */
char *filename() ;
main (argc, argv)
int argc; /* number of paramiters */
char **argv; /* array of paramiters */
{
int count ; /* loop counter */
unsigned int *buff ; /* input buffer */
int dbg ; /* input file handle */
int error ; /* file operations return value */
FILE *map ; /* output map file */
printf("\nAztec .DBG to Microsoft compatible .MAP symbol file converter");
printf("\n(c) Lines Unlimited 8-24-87 \n");
if (argc != 2)
{
printf("\n\nusage: dbgmap filename");
exit(1);
}
++argv; /* skip command name */
dbg_file = filename( *argv, ".dbg");
map_file = filename( *argv, ".map");
dbg = open( dbg_file, O_RDONLY | O_BINARY);
if (dbg == -1)
err_abort(dbg_file); /* abort on error */
/* Read header record */
error = read( dbg, &dbg_header, sizeof(struct HEADER) );
if (error == -1)
err_abort(dbg_file); /* abort on read error */
buff = (int *) malloc(64); /* block buffer */
if (buff == NULL)
err_abort("buff - out of memory ");
max_symbol = 0xffff ; /* initialize */
/* build data structures from the .DBG file */
for (count = dbg_header.start_struct - 1 ; count ; --count)
{
error = read( dbg, buff, 64);
if (error == -1)
err_abort( dbg_file);
switch (*buff) /* type_def */
{
case 15431 : /* SYMBOL RECORD */
save_symbols( buff);
break;
case 12345 : /* SOURCE LINE RECORD */
save_src_line( buff);
break;
}
}
free(buff);
read_strings( dbg); /* read in strings */
/* Time to generate the .MAP file */
map = fopen ( map_file, "w");
if (map == NULL)
err_abort ( map_file);
print_symbols ( map);
print_src_data ( map);
if ( fclose ( map) )
err_abort( map_file);
exit (0);
}
save_symbols ( buff)
struct SYM_RECORD *buff;
{
int count;
struct SYMBOL *c_symbol;
struct SYM_DATA *tmp;
c_symbol = buff->sym_data;
for (count = 0 ; count < 6 ; ++count, ++c_symbol)
{
if ( c_symbol->name_idx < dbg_header.num_strings )
{
tmp = (struct SYM_DATA *) malloc(sizeof(struct SYM_DATA) );
if (tmp == NULL)
err_abort( "save_symbols - out of memory ");
tmp->name_idx = c_symbol->name_idx;
tmp->type_idx = c_symbol->type_idx;
tmp->add_offset = c_symbol->add_offset;
tmp->add_segment = c_symbol->add_segment;
tmp->struct_idx = c_symbol->struct_idx;
if ((tmp->type_idx < max_symbol) && (tmp->type_idx != 0 ) )
max_symbol = tmp->type_idx ; /* type strings follow global
symbols strings */
/* add to linked list in memory */
tmp->next = sym_list;
sym_list = tmp; /* update linked list */
++sym_count;
}
}
}
print_symbols( map)
FILE *map; /* output file descriptor */
{
struct SYM_DATA **idx, **tmp, *cur;
int count, tot_sym ;
int sym_by_name(), sym_by_value();
tmp = idx = (struct SYM_DATA **)
malloc( sizeof(struct SYM_DATA) * (sym_count + 1) ) ;
if (idx == NULL)
err_abort("print_symbols - out of memory ");
/* generate index for quick sort */
for ( tot_sym = 0 , cur = sym_list; cur != NULL ; cur = cur->next )
{
if ( ( cur->add_segment < (unsigned) -6 ) &&
(cur->name_idx < max_symbol ) )
{
*tmp++ = cur ;
++tot_sym ;
}
}
*tmp = NULL ;
fprintf ( map, "\n\n Address Publics by Name\n");
qsort ( idx, tot_sym, sizeof(struct SYM_DATA *), sym_by_name );
for ( tmp = idx; *tmp ; ++tmp)
{
fprintf( map, "\n %04X:%04X %s", (*tmp)->add_segment,
(*tmp)->add_offset, str_idx[ (*tmp)->name_idx] );
}
fprintf ( map, "\n\n Address Publics by Value\n");
qsort ( idx, tot_sym, sizeof(struct SYM_DATA *), sym_by_value );
for ( tmp = idx; (*tmp) ; ++tmp)
{
fprintf( map, "\n %04x:%04x %s", (*tmp)->add_segment,
(*tmp)->add_offset, str_idx[ (*tmp)->name_idx] );
}
free(idx); /* return to free memory */
}
sym_by_name(a, b)
struct SYM_DATA **a, **b;
{
return ( strcmp( str_idx[ (*a)->name_idx], str_idx[ (*b)->name_idx]) );
}
sym_by_value ( a, b)
struct SYM_DATA **a, **b;
{
long a_add, b_add, add_to_long() ;
int ret_value;
a_add = add_to_long( (*a)->add_segment, (*a)->add_offset);
b_add = add_to_long( (*b)->add_segment, (*b)->add_offset);
(a_add == b_add) ? ( ret_value = 0) :
((a_add < b_add) ? (ret_value = -1) : (ret_value = 1) ) ;
return (ret_value);
}
long add_to_long ( segment, offset)
unsigned int segment, offset;
{
long ret_value ;
ret_value = (long) segment << 4 ;
ret_value += (long) offset ;
return (ret_value);
}
save_src_line ( src)
struct SRC_RECORD *src;
{
unsigned char *obj_offset;
int cnt ;
store_src ( src); /* save start of function */
/* Process the source lines for this function */
/* each offset byte represents a source line */
for ( obj_offset = src->obj_displ , cnt = 0 ; cnt < LINEENTRY ;
++obj_offset, ++src->line_num, ++cnt )
{
if ( *obj_offset)
{
if (*obj_offset == 0xff)
break ; /* end of table */
store_src ( src);
if ( *obj_offset < 0x80 )
src->add_offset += *obj_offset ; /* additional offset */
else
{
/* 15 bit object code offset */
*obj_offset &= 0x7f ; /* mask off flag bit */
src->add_offset += ( *obj_offset++ << 8) ;/* high 7 bits */
src->add_offset += *obj_offset ; /* low 8 bits */
}
}
}
}
store_src ( src)
struct SRC_RECORD *src;
{
struct SRC_DATA *tmp;
tmp = (struct SRC_DATA *) malloc( sizeof(struct SRC_DATA)) ;
if (tmp == NULL)
err_abort( "store_src - out of memory ");
/* copy to memory storage */
tmp->add_offset = src->add_offset ;
tmp->add_segment = src->add_segment ;
tmp->line_num = src->line_num ;
tmp->file_idx = src->file_idx ;
if (tmp->file_idx < max_symbol)
max_symbol = tmp->file_idx; /* global symbols proceed
file names in the string
table */
/* add to linked list */
tmp->next = src_list ;
src_list = tmp ;
++src_count ;
}
print_src_data( map)
FILE *map;
{
struct SRC_DATA **tmp, **idx, *cur;
int src_data_cmp();
char *src_file, *obj_file;
int count ;
/* generate source line data index */
tmp = idx = (struct SRC_DATA **)
malloc( sizeof(struct SRC_DATA *) * (src_count + 1) ) ;
if (idx == NULL)
err_abort("print_src_data - out of memory ");
for ( cur = src_list ; cur != NULL ; cur = cur->next)
{
*tmp++ = cur ;
*tmp = NULL ;
}
qsort( idx, src_count, sizeof(struct SRC_DATA *), src_data_cmp);
for ( tmp = idx; *tmp != NULL ; )
{
src_file = str_idx[ (*tmp)->file_idx ] ;
obj_file = filename( src_file, ".obj");
fprintf( map,"\n\nLine numbers for %s(%s)\n\n",
obj_file, src_file);
free( obj_file); /* release free memory */
/* print line data for this source module */
for ( count = 1 ; (*tmp != NULL) &&
(strcmp( src_file, str_idx[ (*tmp)->file_idx]) == 0 ) ;
++tmp )
{
if (( *(tmp + 1) == NULL) ||
( (*tmp)->add_segment != (*(tmp + 1))->add_segment) ||
( (*tmp)->add_offset != (*(tmp + 1))->add_offset) )
{
fprintf (map, "%6d %04X:%04X%s", (*tmp)->line_num,
(*tmp)->add_segment, (*tmp)->add_offset,
(count % 4) ? "" : "\n" );
++count;
}
}
}
fprintf (map, "\n\n");
free(idx);
}
src_data_cmp ( a, b)
struct SRC_DATA **a, **b;
{
int ret_value;
ret_value = strcmp( str_idx[ (*a)->file_idx], str_idx[ (*b)->file_idx] );
if ( ret_value == 0)
( (*a)->line_num < (*b)->line_num) ?
( ret_value = -1) : (ret_value = 1) ;
return (ret_value);
}
char *filename( path, ext)
char *path, *ext;
{
char *f_path, *bf;
f_path = malloc( strlen(path) + 5); /* get buffer space */
if (f_path == NULL)
err_abort("filename - out of memory ");
strcpy( f_path, path);
if ((bf = strchr( f_path, '.')) != NULL )
*bf = '\0'; /* truncate extension */
strcat( f_path, ext); /* add the extension */
return( f_path);
}
read_strings( dbg)
int dbg ; /* input file handle */
{
char **idx_ptr; /* string index pointer */
char *s_ptr;
int count ;
long position ; /* return value for lseek() */
int error ; /* return value for file operations */
/* Read in strings (symbol names ) */
position = lseek( dbg, (long) dbg_header.start_string * 64, SEEK_SET);
if (position == -1L)
err_abort( dbg_file);
s_ptr = str_buff = malloc( dbg_header.tot_str_lnth); /* get string buffer */
if (str_buff == NULL)
err_abort ("read_strings - out of memory ");
error = read( dbg, str_buff, dbg_header.tot_str_lnth);
if (error == -1)
err_abort (dbg_file);
/* string index buffer */
idx_ptr = str_idx =
(char **) malloc( sizeof(char *) * (dbg_header.num_strings + 2) );
if (str_idx == NULL)
err_abort ("read_strings - out of memory ");
*idx_ptr++ = NULL; /* string indexes are base 1 */
for( count = dbg_header.num_strings ; count ; --count)
{
*idx_ptr++ = s_ptr ; /* current string starting address */
s_ptr += strlen( s_ptr) + 1 ; /* advance to the next string */
}
*idx_ptr = NULL;
}
err_abort(msg)
char *msg;
{
perror(msg); /* display error message */
exit (1); /* abort */
}
/* */

View File

@ -0,0 +1,12 @@
#
# convert a .DBG file to a .MAP file
# Paul McClintock April 22, 1987
#
dbgmap.obj : dbgmap.c
msc dbgmap /Od /Zd;
dbgmap.exe : dbgmap.obj
link dbgmap /line /m;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,876 @@
makefile
# Copyright (C) Manx Software Systems, Inc. 1987. All rights reserved.
# Note: the object files below are in the correct order for linking,
# thus the OBJ macro should be changed with caution. If you are in doubt,
# use the ORD utility to build a correctly ordered list.
OBJ=mode.o circ.o lin.o point.o address.o scr_call.o
CC=cc
AS=as
MODEL=
AMODEL=0
.c.o:
$(CC) +$(MODEL) -n $*.c -o $@
sqz $@
.asm.o:
$(AS) -dMODEL=$(AMODEL) $*.asm -o $@
sqz $@
$(DIR)g$(MODEL).lib: $(OBJ)
del $(DIR)g$(MODEL).lib
lb $(DIR)g$(MODEL).lib $(OBJ)
@echo graphics done
address.asm
; Copyright (C) 1984 by Manx Software Systems, Inc.
; :ts=8
dataseg segment word public 'data'
public $address
$address equ this word ;/* vertical address table */
dw 7920+8192
dw 7920
dw 7840+8192
dw 7840
dw 7760+8192
dw 7760
dw 7680+8192
dw 7680
dw 7600+8192
dw 7600
dw 7520+8192
dw 7520
dw 7440+8192
dw 7440
dw 7360+8192
dw 7360
dw 7280+8192
dw 7280
dw 7200+8192
dw 7200
dw 7120+8192
dw 7120
dw 7040+8192
dw 7040
dw 6960+8192
dw 6960
dw 6880+8192
dw 6880
dw 6800+8192
dw 6800
dw 6720+8192
dw 6720
dw 6640+8192
dw 6640
dw 6560+8192
dw 6560
dw 6480+8192
dw 6480
dw 6400+8192
dw 6400
dw 6320+8192
dw 6320
dw 6240+8192
dw 6240
dw 6160+8192
dw 6160
dw 6080+8192
dw 6080
dw 6000+8192
dw 6000
dw 5920+8192
dw 5920
dw 5840+8192
dw 5840
dw 5760+8192
dw 5760
dw 5680+8192
dw 5680
dw 5600+8192
dw 5600
dw 5520+8192
dw 5520
dw 5440+8192
dw 5440
dw 5360+8192
dw 5360
dw 5280+8192
dw 5280
dw 5200+8192
dw 5200
dw 5120+8192
dw 5120
dw 5040+8192
dw 5040
dw 4960+8192
dw 4960
dw 4880+8192
dw 4880
dw 4800+8192
dw 4800
dw 4720+8192
dw 4720
dw 4640+8192
dw 4640
dw 4560+8192
dw 4560
dw 4480+8192
dw 4480
dw 4400+8192
dw 4400
dw 4320+8192
dw 4320
dw 4240+8192
dw 4240
dw 4160+8192
dw 4160
dw 4080+8192
dw 4080
dw 4000+8192
dw 4000
dw 3920+8192
dw 3920
dw 3840+8192
dw 3840
dw 3760+8192
dw 3760
dw 3680+8192
dw 3680
dw 3600+8192
dw 3600
dw 3520+8192
dw 3520
dw 3440+8192
dw 3440
dw 3360+8192
dw 3360
dw 3280+8192
dw 3280
dw 3200+8192
dw 3200
dw 3120+8192
dw 3120
dw 3040+8192
dw 3040
dw 2960+8192
dw 2960
dw 2880+8192
dw 2880
dw 2800+8192
dw 2800
dw 2720+8192
dw 2720
dw 2640+8192
dw 2640
dw 2560+8192
dw 2560
dw 2480+8192
dw 2480
dw 2400+8192
dw 2400
dw 2320+8192
dw 2320
dw 2240+8192
dw 2240
dw 2160+8192
dw 2160
dw 2080+8192
dw 2080
dw 2000+8192
dw 2000
dw 1920+8192
dw 1920
dw 1840+8192
dw 1840
dw 1760+8192
dw 1760
dw 1680+8192
dw 1680
dw 1600+8192
dw 1600
dw 1520+8192
dw 1520
dw 1440+8192
dw 1440
dw 1360+8192
dw 1360
dw 1280+8192
dw 1280
dw 1200+8192
dw 1200
dw 1120+8192
dw 1120
dw 1040+8192
dw 1040
dw 960+8192
dw 960
dw 880+8192
dw 880
dw 800+8192
dw 800
dw 720+8192
dw 720
dw 640+8192
dw 640
dw 560+8192
dw 560
dw 480+8192
dw 480
dw 400+8192
dw 400
dw 320+8192
dw 320
dw 240+8192
dw 240
dw 160+8192
dw 160
dw 80+8192
dw 80
dw 0+8192
dw 0
dataseg ends
end
circ.asm
; Copyright (C) 1984 by Manx Software Systems, Inc.
; :ts=8
include lmacros.h
dataseg segment word public 'data'
aldx dw 0
aldy dw 0
public _yaspect_,_xaspect_
_yaspect_ dw 5
_xaspect_ dw 6
scale dw 1024
scale2 dw 512
aspect dw 0 ;function computed aspect (scaled)
invasp dw 0 ;reciprocal of aspect (scaled too)
xorg dw 0
yorg dw 0
radius dw 0
dataseg ends
assume ds:dataseg
;--------------------------------------------------------
;procedure circle(x,y,radius)
;
;draws a circle at center (x,y) with aspect ratio
;yaspect/xaspect; radius in column units
;
;Dan Lee 7/1/1982 SourceWare
;Modified from DDJ May '83 for CI C-86 by Davin 6/22/1983
;remodified for Aztec C86, 6/84
;
;--------------------------------------------------------
ifdef FARPROC
extrn $inline:far,$pnt:far
else
extrn $inline:near,$pnt:near
endif
procdef set_asp,<<x_asp,word>,<y_asp,word>>
;set_asp (x_aspect, y_aspect);
mov ax, x_asp
mov [_xaspect_],ax
mov ax, y_asp
mov [_yaspect_],ax
pret
pend set_asp
procdef circle,<<_xorg,word>,<_yorg,word>,<irad,word>>
mov cx,_xorg
mov [xorg],cx
mov dx,_yorg
mov [yorg],dx
mov ax,irad
pop bp
push es
push si
push di ;save register variables
or ax,ax
jnz okrad
jmp single
okrad: mov [radius],ax
mov ax,_yaspect_ ;get yaspect
mul [scale] ;ax=yaspect*scale
shl ax,1
div _xaspect_ ;ax=(yaspect*scale)/xaspect
inc ax
shr ax,1
mov [aspect],ax ;store aspect*scale
mov ax,_xaspect_ ;get xaspect in ax
mul [scale] ;ax=xaspect*scale
shl ax,1
div _yaspect_ ;ax=(xaspect*scale)/yaspect
inc ax
shr ax,1
mov [invasp],ax ;store inv aspect*scale
;
; Plot 0 to 45 degrees.
; Increase y by one unit and
; decrease x by TAN units*inv aspect ratio.
;
mov ax,[radius] ;get radius for initial x
mul [scale] ;ax=radius*scale
xor di,di ;zero initial y value
nlp1: push ax ;save lo word x*scale
push dx ;save hi word x*scale
add ax,[scale2]
adc dx,0
div [scale]
mov [aldx],ax ; aldx,aldy are old relative coord's
mov [aldy],di
pop dx
pop ax
lp1: push ax ;save lo word x*scale
push dx ;save hi word x*scale
add ax,[scale2]
adc dx,0
div [scale]
mov bx,ax ;bx=1st quad x
add ax,[xorg] ;add x origin
push bp
push di ;relative y-coord
push bx ;relative x-coord
mov bp,sp
mov bx,[yorg] ;get y origin
sub bx,di ;and sub y to plot
call pnt1
pop cx ;1st quad x val
pop di
mov [aldx],cx
mov [aldy],di
pop bp
;cx = 1st quad x, di = 1st quad y
inc di ;get new y
mov ax,di ;ax=y
mul [invasp] ;ax=y*inv aspect*scale
div cx ;ax=TAN*inv aspect*scale
xor dx,dx ;zero remainder
mov si,ax ;si=TAN*inv aspect*scale
div [invasp] ;ax=TAN
cmp ax,1 ;TAN=1?
pop dx ;dx=hi word x*scale
pop ax ;ax=lo word x*scale
jae part2 ;yes, go to next sector
neg si ;to decrement x
add ax,si ;new x value
adc dx,-1 ;hi word carry
jmp short lp1 ;plot new point
;
; Plot 45 to 90 degrees.
; Decrease x by one unit and
; increase y by COT units*aspect ratio.
;
part2: mov ax,di ;get next y to plot
mul [scale] ;dx:ax=y*scale
mov di,cx ;di=last x value
dec di ;next x to plot
lp2: push ax ;save lo word y*scale
push dx ;save hi word y*scale
add ax,[scale2] ;'one-half'
adc dx,0
div [scale] ;ax=y
mov bx,ax ;bx=1st quad y co-ord
add ax,[yorg] ;add y origin
mov cx,[xorg] ;cx=x origin
add cx,di ;x to plot
push bp
push bx
push di
mov bp,sp
mov bx,ax
mov ax,cx
call pnt2
pop di
pop bx
mov [aldx],di
mov [aldy],bx
pop bp
or di,di ;90 degrees?
js exit ;yes, exit
dec di ;get new x
mov ax,di ;ax=x
imul [aspect] ;ax=x*aspect*scale
idiv bx ;ax=COT*aspect*scale
mov si,ax ;si=change in y
pop dx ;dx=hi word y*scale
pop ax ;ax=lo word y*scale
xor bx,bx
or si,si ;for sign check
jns skp ;positive
mov bx,-1 ;negative carry
skp: add ax,si ;ax=new x value
adc dx,bx
jmp short lp2 ;plot next point
exit: add sp,4 ;release parms
jmp alldone
pnt1 proc near
;bp points to rel x coord and bp+2 points to rel y coord
;abs coords of point are in ax,bx
mov si,[aldx]
add si,[xorg] ;si is old abs x
mov di,[yorg]
mov cx,[aldy]
sub di,cx ;di is old abs y
call $goinline ;write 1st quad point
sub ax,word ptr [bp] ;get 2nd quad x+origin
sub ax,word ptr [bp]
sub si,[aldx]
sub si,[aldx]
call $goinline ;write 2nd quad point
add bx,word ptr 2[bp] ;get 3rd quad y+origin
add bx,word ptr 2[bp]
add di,[aldy]
add di,[aldy]
call $goinline ;write 3rd quad point
add ax,word ptr [bp]
add ax,word ptr [bp] ;get 4th quad x+origin
add si,[aldx]
add si,[aldx]
call $goinline ;plot 4th quad point
ret
pnt1 endp
pnt2 proc near
mov si,[aldx]
add si,[xorg]
mov di,[yorg]
add di,[aldy]
call $goinline ;write 1st quad point
sub ax,word ptr [bp] ;get 2nd quad x+origin
sub ax,word ptr [bp]
sub si,[aldx]
sub si,[aldx]
call $goinline ;write 2nd quad point
sub bx,word ptr 2[bp] ;get 3rd quad y+origin
sub bx,word ptr 2[bp]
sub di,[aldy]
sub di,[aldy]
call $goinline ;write 3rd quad point
add ax,word ptr [bp]
add ax,word ptr [bp] ;get 4th quad x+origin
add si,[aldx]
add si,[aldx]
call $goinline ;plot 4th quad point
ret
pnt2 endp
single:
mov si,cx
mov di,dx
call $pnt
alldone:
pop di
pop si
pop es
ret
$goinline proc near
push ax
push bx
push si
push di
call $inline ;pops es,di,si
pop di
pop si
pop bx
pop ax
ret
$goinline endp
pend circle
finish
end
lin.asm
; Copyright (C) 1984 by Manx Software Systems, Inc.
; :ts=8
include lmacros.h
dataseg segment word public 'data'
extrn _oldx_:word, _oldy_:word
deltax dw 0
deltay dw 0
yincr dw 0
dataseg ends
assume ds:dataseg
ifdef FARPROC
extrn $pnt:far
else
extrn $pnt:near
endif
public $inline
$inline proc
cmp si,ax
jbe noxchg
xchg si,ax
xchg di,bx
noxchg:
jne novert
jmp vertical
novert:
sub ax,si
mov [deltax],ax
sub bx,di
jnz nohoriz
jmp horizontal
nohoriz:
mov cx,1
jns notneg
neg cx
neg bx
notneg: mov [yincr],cx
mov [deltay],bx
cmp ax,bx
jg case2
mov dx,[deltax]
shl dx,1
mov bx,dx
mov ax,[deltay]
shl ax,1
sub bx,ax
mov ax,dx
sub ax,[deltax]
mov cx,[deltay]
lp1: dec cx
js done
call $pnt
add di,[yincr]
cmp ax,0
jl incr1
inc si
add ax,bx
jmp short lp1
incr1:
add ax,dx
jmp short lp1
case2:
mov dx,[deltay]
shl dx,1 ;dx <- 2 * deltay
mov bx,dx
mov ax,[deltax]
shl ax,1
sub bx,ax ;bx <- 2*deltay - 2 * deltax
mov ax,dx
sub ax,[deltax] ;ax <- 2*deltay - deltax
mov cx,[deltax]
lp2: dec cx
js done
call $pnt
inc si
cmp ax,0
jl incr2
add di,[yincr]
add ax,bx
jmp short lp2
incr2:
add ax,dx
jmp short lp2
vertical: ;si = xval, di,bx = yvals
cmp di,bx
jle yorder
xchg bx,di
yorder:
sub bx,di
vplot:
call $pnt
inc di
dec bx
jns vplot
jmp short done
horizontal: ;ax=deltax, si,di = start point
call $pnt
inc si
dec ax
jns horizontal
;jmp short done
done:
ret
$inline endp
procdef lineto,<<xdest,word>,<ydest,word>>
; lineto (dest_x, dest_y);
push si
push di
push es
mov si,[_oldx_]
mov di,[_oldy_]
mov ax,xdest
mov bx,ydest
mov [_oldx_],ax
mov [_oldy_],bx
call $inline ;pops si,di,es before returning
pop es
pop di
pop si
pret
pend lineto
procdef line,<<srcx,word>,<srcy,word>,<ddstx,word>,<ddsty,word>>
; line (src_x, src_y, dest_x, dest_y);
push si
push di
push es
mov si,srcx
mov di,srcy
mov ax,ddstx
mov bx,ddsty
mov [_oldx_],ax
mov [_oldy_],bx
call $inline
pop es
pop di
pop si
pret
pend line
finish
end
mode.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
extern int _maxx;
extern int _xaspect, _yaspect;
extern char _color;
extern int _plotf,_plottbl[];
mode (val)
{
switch (val) {
case 'l': case 'L': case 3:
scr_call (3);
break;
case 'm': case 'M': case 4:
_plotf = _plottbl[0];
_xaspect = 6;
_yaspect = 5;
_maxx = 319;
scr_call (4);
break;
case 'h': case 'H': case 6:
_plotf = _plottbl[1];
_xaspect = 4;
_yaspect = 1;
_maxx = 639;
scr_call (6);
break;
default:
if (val < 0 || val > 6)
return;
scr_call (val);
break;
}
}
color (c)
{
switch (c) {
case 'w': case 'W': case 'y': case 'Y': case 3:
_color = 3;
break;
case 'm': case 'M': case 'r': case 'R': case 2:
_color = 2;
break;
case 'c': case 'C': case 'g': case 'G': case 1:
_color = 1;
break;
default:
_color = 0;
break;
}
}
palette (c)
{
if (c)
scr_call (11 << 8,1<<8 | 1,0,0);
else
scr_call (11 << 8,1<<8 | 0,0,0);
}
ground (c)
{
scr_call (11 << 8, 0 << 8 | c,0,0);
}
point.asm
; Copyright (C) 1984 by Manx Software Systems, Inc.
; :ts=8
include lmacros.h
dataseg segment para public 'data'
extrn $address:word
public _oldx_,_oldy_,_color_,_maxx_
_oldx_ dw 0
_oldy_ dw 0
_color_ db 1
_maxx_ dw 320
public _plotf_, _plottbl_
public mid,ultra
public clrmsk,colmsk
clrmsk db 00111111b,11001111b,11110011b,11111100b
;/* clrmsk for point mode 0 */
onmask db 10000000b,1000000b,100000b,10000b,1000b,100b,10b,1b
offmask db 01111111b,10111111b,11011111b,11101111b
db 11110111b,11111011b,11111101b,11111110b
colmsk db 0,0,0,0 ;/* color_ masks */
db 1000000b,10000b,100b,1
db 10000000b,100000b,1000b,10b
db 11000000b,110000b,1100b,11b
_plottbl_ dw offset mid ;medium res
dw offset ultra ;high res
_plotf_ dw offset ptquit
dataseg ends
assume ds:dataseg,cs:codeseg
public $pnt
$pnt proc
cmp si,[_maxx_] ;si=x,di=y does not set oldx & oldy
ja quit
cmp si,0
jb quit
cmp di,199
ja quit
cmp di,0
jnb $pnt3
jmp quit
$pnt3:
push ax
push bx
mov bl,[_color_] ;entry #3 si=x,di=y no clipping !
$pnt4:
mov bh,0
;entry #5 si=x,di=y,bx=color_
;
$pnt5: mov ax,0b800h ; set es to point to hires segment
mov es,ax
push di
shl di,1 ;mult y*2 (addr table is 2 bytes wide)
jmp [_plotf_] ;jmp to ptquit, mid or ultra
mid: push si
mov di,$address[di] ;get vert address from table
mov ax,si ;save x in si
and si,3
shr ax,1 ;divide by 4 (4 dots per byte)
shr ax,1
add di,ax ;get addr of byte on screen
sal bl,1 ; color_ table is 4 by 4 so mult color_ * 4
sal bl,1
mov bl,colmsk[si+bx]
mov al,clrmsk[si]
and es:[di],al
or es:[di],bl
pop si
ptquit: pop di
pop bx
pop ax
quit:
ret
ultra: mov di,$address[di]
mov ax,si
push si
and si,7
shr ax,1
shr ax,1
shr ax,1
add di,ax
or bl,bl
jz black
mov al,onmask[si]
or es:[di],al
pop si
jmp short ptquit
black: mov al,offmask[si]
and es:[di],al
pop si
jmp short ptquit
procdef point,<<xcoord,word>,<ycoord,word>>
push si
push di
push es
mov si,xcoord
mov di,ycoord
mov [_oldx_],si ;si=x,di=y sets oldx and oldy
mov [_oldy_],di
call $pnt
pop es
pop di
pop si
pret
pend point
finish
end
scr_call.asm
; Copyright (C) 1984 by Manx Software Systems
; :ts=8
include lmacros.h
;
; scr_call(ax,bx,cx,dx) - issue int 10 with ax,... set to args
;
;
procdef scr_call,<<aax,word>,<bbx,word>,<ccx,word>,<ddx,word>>
push si
push di
mov ax,aax
mov bx,bbx
mov cx,ccx
mov dx,ddx
int 10h
pop di
pop si
pret
pend scr_call
finish
end


File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,117 @@
; Copyright (C) 1984, 1985 by Manx Software Systems
; :ts=8
include lmacros.h
;
; If you want your stack at a fixed place, you may remove the
; "bss cstack..." statement below and change the "mov sp,cstack..."
; to load SP with the value you desire. Note that the setup of
; SS may need to be changed also. If the program is small data
; model, then SS must be equal to DS or pointers to automatic
; variables won't work.
;
; Otherwise, stacksize should be set according to your program's
; requirements.
stacksize equ 2048
;
; dataseg is the data segment address (as a paragraph #)
; this is picked from the -D option of the linker
;
;Dseg equ 040H ;physical addr 0x400, just above the int vectors
dataseg segment word public 'data'
bss cstack:byte,stacksize
public $MEMRY
$MEMRY dw -1
dw -1
public errno_
errno_ dw 0
public _dsval_,_csval_
_dsval_ dw 0
_csval_ dw 0
public _mbot_, _sbot_
_mbot_ dw 0
dw 0
_sbot_ dw 0
dw 0
;
; The variable is used with csav and cret only. Therefore if you do not
; compile the the +c option or +b option you do not need this.
;
public _lowwater_
_lowwater_ dw -1
extrn _Dorg_:byte,_Dend_:byte
extrn _Uorg_:byte,_Uend_:byte
dataseg ends
extrn _Corg_:byte,_Cend_:byte
ifdef FARPROC
extrn main_:far, $fltinit:far
else
extrn main_:near, $fltinit:near
endif
public $begin
$begin proc far
cli
cld
;
; Compute where initialzed data starts (@ next para after code)
;
mov ax,offset _Cend_+15
mov cl,4
shr ax,cl
add ax,seg _Cend_
mov ds,ax ;place where data is in rom
mov bx,dataseg ;place where data is to go in ram
mov es,bx
;
; Note: For hardware reasons the instruction which loads SS should
; be immediatly followed by the load of SP.
;
mov ss,bx
mov sp,offset cstack+stacksize
;
; copy Init data from rom to ram
mov di,0
mov cx,offset _Dend_
inc cx
shr cx,1
jcxz nocopy
mov si,0
rep movsw
nocopy:
;
; clear uninitialized data
mov di,offset _Uorg_
mov cx,offset _Uend_
sub cx,di
inc cx
shr cx,1
jcxz noclear
sub ax,ax
rep stosw
noclear:
;
assume ds:dataseg,es:dataseg
mov ds,bx ;set DS, now DS, SS, ES are equal
mov di,$MEMRY
inc di
and di,0fffeH ;adjust to word boundary
mov $MEMRY,di ;save memory allocation info for sbrk()
mov $MEMRY+2,ds
mov _mbot_,di
mov _mbot_+2,ds
mov _sbot_,0ffffH ;this is the heap limit for sbrk()
mov _sbot_+2,0fff0h
mov _dsval_,ds
mov _csval_,cs ;this is of dubious value in large code
sti
call $fltinit ;setup floating point software/hardware
jnc flt_ok
hlt ;program needs 8087 and one wasn't found
flt_ok:
jmp main_ ;main shouldn't return in ROM based system
$begin endp
codeseg ends
end $begin

View File

@ -0,0 +1,424 @@
makefile
# Copyright (C) Manx Software Systems, Inc. 1987. All rights reserved.
# Note: the object files below are in the correct order for linking,
# thus the OBJ macro should be changed with caution. If you are in doubt,
# use the ORD utility to build a correctly ordered list.
OBJ=cio.o scr_cdel.o scr_cins.o scr_clea.o scr_echo.o scr_eol.o\
scr_eos.o scr_getc.o scr_home.o scr_inve.o scr_ldel.o scr_lins.o\
scr_curs.o scr_loc.o scr_putc.o scr_call.o
CC=cc
AS=as
MODEL=
AMODEL=0
.c.o:
$(CC) +$(MODEL) -n $*.c -o $@
sqz $@
.asm.o:
$(AS) -dMODEL=$(AMODEL) $*.asm -o $@
sqz $@
$(DIR)s$(MODEL).lib: $(OBJ)
del $(DIR)s$(MODEL).lib
lb $(DIR)s$(MODEL).lib $(OBJ)
@echo screen done
cio.c
extern int _attrib;
static cputc(chr)
register int chr;
{
scr_putc(chr);
if (chr == '\n')
scr_putc('\r');
}
scr_puts(str)
register char *str;
{
while(*str)
cputc(*str++);
cputc('\n');
}
scr_printf(fmt,args)
register char *fmt;
unsigned args;
{
format(cputc,fmt,&args);
}
scr_setatr(back,frg,intens,blink)
register int back, frg;
register int intens, blink;
{
register char tmp;
tmp = _attrib;
_attrib = (back << 4) | frg;
if (blink)
_attrib |= 128;
else
_attrib &= 127;
if (intens)
_attrib |= 8;
else
_attrib &= 247;
_attrib &= 255;
return(tmp);
}
scr_getatr()
{
return(_attrib);
}
scr_resatr(atr)
register int atr;
{
register char tmp;
tmp = _attrib;
_attrib = atr;
return(tmp);
}
scr_call.asm
; Copyright (C) 1984 by Manx Software Systems
; :ts=8
include lmacros.h
;
; scr_call(ax,bx,cx,dx) - issue int 10 with ax,... set to args
;
;
procdef scr_call,<<aax,word>,<bbx,word>,<ccx,word>,<ddx,word>>
push si
push di
mov ax,aax
mov bx,bbx
mov cx,ccx
mov dx,ddx
int 10h
pop di
pop si
pret
pend scr_call
finish
end
scr_cdel.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* delete the char. at the cursor and put blank at end of line
*/
#define max_width 80
extern int _attrib;
scr_cdelete()
{
register unsigned ch, x;
int lin, col;
scr_loc(&lin, &col);
for (x = col ; x < max_width-1 ; ++x) {
scr_curs(lin, x+1);
ch = scr_call(0x0800,0,0,0); /* read out current char */
scr_curs(lin, x);
scr_call(0x0900 | (ch&255), ch>>8, 1, 0); /* and shift over */
}
scr_curs(lin, max_width-1);
scr_call(0x920, _attrib, 1, 0); /* put a blank at end of line */
scr_curs(lin, col);
return(0);
}
scr_cins.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* insert a space at the cursor and delete the char. at end of line
*/
#define max_width 80
extern int _attrib;
scr_cinsert()
{
register unsigned ch, z;
int lin, col;
scr_loc(&lin, &col);
for (z = max_width - 1 ; z > col ; --z) {
scr_curs(lin, z-1);
ch = scr_call(0x0800,0,0,0); /* read out current char */
scr_curs(lin, z);
scr_call(0x0900 | (ch&255), ch>>8, 1, 0); /* and move it right */
}
scr_curs(lin, col);
scr_call(0x920,_attrib,1,0);
return(0);
}
scr_clea.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* Clears the screen and homes the cursor
*/
#define max_width 80
#define max_y 25
extern int _attrib;
scr_clear()
{
scr_home();
scr_call(0x920,_attrib,(max_width * max_y),0);
return(0);
}
scr_curs.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* Moves cursor to line lin, position pos
*/
#define max_width 80
scr_curs(lin, col)
register int lin, col;
{
if (col >= max_width)
col = max_width - 1;
if (lin >= 25)
lin = 24;
scr_call(0x200, 0, 0, (lin << 8) | col);
return(0);
}
scr_echo.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* if flg is zero disable echoing of characters
*/
extern int _echo;
scr_echo(flg)
int flg;
{
_echo = flg;
return(0);
}
scr_eol.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* Clear to the end of line
*/
extern int _attrib;
scr_eol()
{
int lin, col;
scr_loc(&lin, &col);
scr_call(0x920, _attrib, 80-col, 0);
return(0);
}
scr_eos.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* clear to end of screen
*/
extern int _attrib;
scr_eos()
{
int lin, col;
scr_loc(&lin, &col);
scr_call(0x920, _attrib, (80-col)+((24-lin)*80), 0);
return(0);
}
scr_getc.asm
; Copyright (C) 1985 by Manx Software Systems
; :ts=8
include lmacros.h
dataseg segment word public 'data'
public _echo_
_echo_ db 0,0
dataseg ends
assume ds:dataseg
ifdef FARPROC
extrn scr_putc_:far
else
extrn scr_putc_:near
endif
;
; scr_getc() - issue int 16 to get keyboard value
; returns normal ASCII chars as their value (0-127)
; special chars are in the range 128 - 255
; cntl-break is returned as -2
;
procdef scr_getc
mov ah,0
int 16h
call mapchar
cmp _echo_,0
jz no_echo
cmp ax,128
jae no_echo
push ax
call scr_putc_
pop ax
no_echo:
pret
pend scr_getc
;
; scr_poll() - polls keyboard for a character
; returns -1 for no character
; otherwise returns the character as above
; Note: this doesn't remove the char from the buffer
;
procdef scr_poll
mov ah,1
int 16h
jnz mapit
mov ax,-1
pret
mapit:
call mapchar
pret
pend scr_poll
;
mapchar proc near
test al,al
jz special
sub ah,ah
ret
special:
xchg al,ah
test al,al
jz ctl_brk
cmp al,3
jne not_nul
sub ax,ax
ret
not_nul:
or al,80H
ret
ctl_brk:
mov ax,-2
ret
mapchar endp
;
finish
end
scr_home.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* Homes the cursor (0, 0)
*/
scr_home()
{
scr_curs(0, 0);
return(0);
}
scr_inve.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* if flg is zero turn on inverse
*/
extern int _attrib;
scr_invers(flg)
int flg;
{
_attrib = flg ? 0x70 : 0x07;
return(0);
}
scr_ldel.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* Deletes line at lin, blank lines at bottom
*/
extern int _attrib;
scr_ldelete()
{
int lin, col;
scr_loc(&lin, &col);
scr_call(0x600 | 1, _attrib<<8, lin<<8, (24<<8) | 79);
scr_curs(lin, 0);
return(0);
}
scr_lins.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* Inserts blank lines at lin, pushing rest down
*/
extern int _attrib;
scr_linsert()
{
int lin, col;
scr_loc(&lin, &col);
scr_call(0x700 | 1, _attrib<<8, lin<<8, (24<<8) | 79);
scr_curs(lin, 0);
return(0);
}
scr_loc.asm
; Copyright (C) 1984 by Manx Software Systems
; :ts=8
;
; scr_loc(lin, col) - place the location of the cursor in line and column
;
include lmacros.h
;
procdef scr_loc,<<lin,ptr>,<col,ptr>>
;
pushds
mov ah,3
mov bh,0
int 10h ; find the location of cursor
ldptr bx,lin,ds ; move address of line into bx
mov 0[bx],dh ; move cursor location into memory
mov byte ptr 1[bx],0
ldptr bx,col,ds ; move addres of col. into bx
mov 0[bx],dl ; move cursor location into memory
mov byte ptr 1[bx],0
popds
pret
pend scr_loc
finish
end
scr_putc.c
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
/*
* display the character at the cursor
*/
int _attrib = 0x07;
scr_putc(c)
register int c;
{
c &= 255;
if (c >= 0x20)
scr_call(0x0900 | c, _attrib,1,0);
scr_call(0x0e00 | c, _attrib);
return c;
}


View File

@ -0,0 +1,743 @@
makefile
OBJ=agetc.o aputc.o fdopen.o fgets.o fopen.o fprintf.o fputs.o fread.o\
fscanf.o fseek.o fwrite.o getbuff.o getc.o getchar.o gets.o getw.o\
mktemp.o perror.o printf.o putc.o putchar.o puterr.o puts.o putw.o\
scanf.o setbuf.o tmpfile.o tmpnam.o ungetc.o assert.o
MOBJ=fprintf.o fscanf.o printf.o scanf.o
CC=cc
AS=as
MODEL=
AMODEL=0
.c.o:
$(CC) +$(MODEL) -n $*.c -o $@
sqz $@
.asm.o:
$(AS) -dMODEL=$(AMODEL) $*.asm -o $@
sqz $@
bld bldl bldld bldlc: $(OBJ)
@echo stdio done
math: $(MOBJ)
@echo math stdio done
agetc.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
int _agetc_mask = 0xff;
agetc(ptr)
register FILE *ptr;
{
register int c;
top:
if ((c = getc(ptr)) != EOF) {
switch (c &= _agetc_mask) {
case 0x1a:
ptr->_flags |= _EOF;
return EOF;
case '\r':
case 0:
goto top;
}
}
return c;
}
aputc.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
aputc(c,ptr)
register int c; register FILE *ptr;
{
if (c == '\n')
if (putc('\r',ptr) == EOF)
return EOF;
return putc(c,ptr);
}
assert.c
#include <stdio.h>
void _assert(char *expr, char *filename, unsigned int linenumber)
{
fprintf(stderr, "Assert(%s) failed at line %u in file %s.\n",
expr, linenumber, filename);
abort();
}
fdopen.c
/* Copyright (C) 1984 by Manx Software Systems */
#include "stdio.h"
FILE *
fdopen(fd,mode)
char *mode;
{
register FILE *fp;
FILE *newstream();
if ((fp = newstream()) == NULL)
return NULL;
fp->_unit = fd;
fp->_flags = _BUSY;
return fp;
}
fgets.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
char *fgets(s, n, fp)
char *s; FILE *fp;
{
register c;
register char *cp;
cp = s;
while (--n > 0 && (c = agetc(fp)) != EOF) {
*cp++ = c;
if (c == '\n')
break;
}
*cp = 0;
if (c == EOF && cp == s)
return NULL;
return(s);
}
fopen.c
/* Copyright (C) 1981,1982,1983,1984 by Manx Software Systems */
#include "stdio.h"
#include "fcntl.h"
#include "errno.h"
extern int errno;
static struct modes {
char fmode[3];
int omode;
} modes[] = {
"r", O_RDONLY,
"r+", O_RDWR,
"w", (O_WRONLY|O_CREAT|O_TRUNC),
"w+", (O_RDWR|O_CREAT|O_TRUNC),
"a", (O_WRONLY|O_CREAT|O_APPEND),
"a+", (O_RDWR|O_CREAT|O_APPEND),
"x", (O_WRONLY|O_CREAT|O_EXCL),
"x+", (O_RDWR|O_CREAT|O_EXCL),
"", 0,
};
FILE *
fopen(name,mode)
char *name,*mode;
{
register FILE *fp;
FILE *newstream(), *freopen();
if ((fp = newstream()) == NULL)
return NULL;
return freopen(name, mode, fp);
}
FILE *
freopen(name, mode, fp)
char *name,*mode; FILE *fp;
{
register struct modes *mp;
register int fd;
fclose(fp);
for (mp = modes ; ; ++mp) {
if (*mp->fmode == 0) {
errno = EINVAL;
return NULL;
}
if (strcmp(mp->fmode, mode) == 0)
break;
}
/*
Don't try to optimize the next 3 lines. Since _unit is a char,
assigning to it in the if statement will cause the -1 test to fail
on unsigned char machines.
*/
if ((fd = open(name, mp->omode)) == -1)
return (NULL);
fp->_unit = fd;
fp->_flags = _BUSY;
return fp;
}
fprintf.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
static FILE *Stream;
fprintf(stream,fmt,args)
FILE *stream; char *fmt; unsigned args;
{
int fpsub();
Stream = stream;
return format(fpsub,fmt,&args);
}
static
fpsub(c)
{
return aputc(c,Stream);
}
fputs.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
fputs(s,fp)
register char *s;
FILE *fp;
{
while ( *s )
if (aputc(*s++,fp) == EOF)
return(EOF);
return 0;
}
fread.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
fread(buffer,size,number,stream)
register char *buffer; unsigned size; int number;
FILE *stream;
{
int total;
register int c,i;
for ( total = 0 ; total < number ; ++total ) {
for ( i = size ; i ; --i ) {
if ( (c = getc(stream)) == EOF )
return total;
*buffer++ = c;
}
}
return total;
}
fscanf.c
/* Copyright (C) 1982 by Manx Software Systems */
#include "stdio.h"
static gchar();
static int scnlast;
static FILE *scnfp;
fscanf(fp, fmt, args)
FILE *fp; char *fmt; int *args;
{
int gchar();
scnfp = fp;
scnlast = 0;
return scanfmt(gchar, fmt, &args);
}
static gchar(what)
{
if (what == 0) {
if (feof(scnfp))
scnlast = EOF;
else
scnlast = agetc(scnfp);
} else
scnlast = ungetc(scnlast, scnfp);
return scnlast;
}
fseek.c
/* Copyright (c) 1981, 1982 by Manx Software Systems */
#include "stdio.h"
fseek(fp,pos,mode)
register FILE *fp;
long pos;
{
register int i;
long curpos, lseek();
fp->_flags &= ~_EOF;
if (fp->_flags & _DIRTY) {
if (flsh_(fp,-1))
return EOF;
} else if (mode == 1 && fp->_bp)
pos -= fp->_bend - fp->_bp;
fp->_bp = fp->_bend = NULL;
if (lseek(fp->_unit, pos, mode) < 0)
return EOF;
return 0;
}
long ftell(fp)
register FILE *fp;
{
long pos, lseek();
pos = lseek(fp->_unit, 0L, 1); /* find out where we are */
if (fp->_flags & _DIRTY)
pos += fp->_bp - fp->_buff;
else if (fp->_bp)
pos -= fp->_bend - fp->_bp;
return pos;
}
fwrite.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
fwrite(buffer,size,number,stream)
register char *buffer; unsigned size,number;
FILE *stream;
{
register unsigned i,max;
max = size * number;
for ( i = 0 ; i < max ; ++i ) {
if ( putc(*buffer++,stream) == EOF )
return 0;
}
return number;
}
getbuff.c
/* Copyright (C) 1983 by Manx Software Systems */
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
FILE Cbuffs[MAXSTREAM] = {
{ 0,0,0, _BUSY,0,0,1 },
{ 0,0,0, _BUSY,1,0,1 },
{ 0,0,0, _BUSY,2,0,1 },
{ 0,0,0, _BUSY,3,0,1 },
{ 0,0,0, _BUSY,4,0,1 },
};
FILE *
newstream()
{
register FILE *fp;
fp = Cbuffs;
while (fp->_flags)
if (++fp >= &Cbuffs[MAXSTREAM])
return NULL;
return fp;
}
getbuff(ptr)
register FILE *ptr;
{
char *buffer, *malloc();
if (isatty(ptr->_unit)) {
smlbuff:
ptr->_buflen = 1;
ptr->_buff = &ptr->_bytbuf;
return;
}
if ((buffer = malloc(BUFSIZ)) == NULL)
goto smlbuff;
ptr->_buflen = BUFSIZ;
ptr->_flags |= _ALLBUF;
ptr->_buff = buffer;
return;
}
getc.c
/* Copyright (C) 1982 by Manx Software Systems */
#include "stdio.h"
getc(ptr)
register FILE *ptr;
{
register int len;
if (ptr->_bp >= ptr->_bend) {
if (ptr->_flags&(_EOF|_IOERR))
return EOF;
ptr->_flags &= ~_DIRTY;
if (ptr->_buff == NULL)
getbuff(ptr);
if ((len = read(ptr->_unit,ptr->_buff,ptr->_buflen)) <= 0) {
ptr->_flags |= len==0 ? _EOF : _IOERR;
return EOF;
}
ptr->_bend = (ptr->_bp = ptr->_buff) + len;
}
return *ptr->_bp++ & 255;
}
getchar.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
#undef getchar
getchar()
{
return agetc(stdin);
}
gets.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
#undef getchar
char *gets(line)
char *line;
{
register char *cp;
register int i;
cp = line;
while ((i = getchar()) != EOF && i != '\n')
*cp++ = i;
*cp = 0;
if (i == EOF && cp == line)
return NULL;
return line;
}
getw.c
/* Copyright (C) 1982 by Manx Software Systems */
#include "stdio.h"
getw(stream)
FILE *stream;
{
register int x1,x2;
if ((x1 = getc(stream)) == EOF || (x2 = getc(stream)) == EOF)
return EOF;
return (x2<<8) | x1;
}
mktemp.c
#ifdef DOS11
#include <fcntl.h>
#endif
char *
mktemp(template)
char *template;
{
register char *cp;
register unsigned val;
extern unsigned _dsval;
#ifdef DOS11
int file;
#endif
cp = template;
cp += strlen(cp);
for (val = _dsval ; ; )
if (*--cp == 'X') {
*cp = val%10 + '0';
val /= 10;
} else if (*cp != '.')
break;
if (*++cp == '.') /* allow for "abcd.XXX" type file names */
++cp;
if (*cp != 0) {
*cp = 'A';
#ifdef DOS11
while ((file = open(template, O_RDONLY)) >= 0) {
close(file);
#else
while (access(template, 0) == 0) {
#endif
if (*cp == 'Z') {
*template = 0;
break;
}
++*cp;
}
} else {
#ifdef DOS11
if ((file = open(template, O_RDONLY)) >= 0) {
close(file);
#else
if (access(template, 0) == 0) {
#endif
*template = 0;
}
}
return template;
}
perror.c
#include <stdio.h>
#include <errno.h>
perror (s)
char *s;
{
if (errno < 0 || errno > sys_nerr)
return -1;
if (s)
fprintf (stderr, "%s: ", s);
fprintf (stderr, "%s\n", sys_errlist[errno]);
return 0;
}
printf.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
printf(fmt,args)
char *fmt; unsigned args;
{
extern int putchar();
format(putchar,fmt,&args);
}
putc.c
/* Copyright (C) 1981,1982,1983,1984 by Manx Software Systems */
#include "stdio.h"
putc(c,ptr)
int c; register FILE *ptr;
{
if (ptr->_bp >= ptr->_bend)
return flsh_(ptr,c&0xff);
return (*ptr->_bp++ = c) & 0xff;
}
static closall() /* called by exit to close any open files */
{
register FILE *fp;
for ( fp = Cbuffs ; fp < Cbuffs+MAXSTREAM ; )
fclose(fp++);
}
fclose(ptr)
register FILE *ptr;
{
register int err;
err = 0;
if (!ptr)
return -1;
if ( ptr->_flags ) {
if (ptr->_flags&_DIRTY) /* if modifed flush buffer */
err = flsh_(ptr,-1);
err |= close(ptr->_unit);
if (ptr->_flags&_ALLBUF)
free(ptr->_buff);
if (ptr->_flags&_TEMP) { /* temp file, delete it */
unlink(ptr->_tmpname);
free(ptr->_tmpname);
}
}
ptr->_buff =
ptr->_bend = /* nothing in buffer */
ptr->_bp = 0;
ptr->_flags = 0;
return err;
}
flsh_(ptr,data)
register FILE *ptr;
{
register int size;
extern int (*cls_)();
cls_ = closall;
if (ptr->_flags & _IOERR)
return EOF;
if (ptr->_flags & _DIRTY) {
size = ptr->_bp - ptr->_buff;
if (write(ptr->_unit, ptr->_buff, size) != size) {
ioerr:
ptr->_flags |= _IOERR;
ptr->_bend = ptr->_bp = NULL;
return EOF;
}
}
if (data == -1) {
ptr->_flags &= ~_DIRTY;
ptr->_bend = ptr->_bp = NULL;
return 0;
}
if (ptr->_buff == NULL)
getbuff(ptr);
if (ptr->_buflen == 1) { /* unbuffered I/O */
if (write(ptr->_unit, &data, 1) != 1)
goto ioerr;
return data;
}
ptr->_bp = ptr->_buff;
ptr->_bend = ptr->_buff + ptr->_buflen;
ptr->_flags |= _DIRTY;
return (*ptr->_bp++ = data) & 0xff;
}
putchar.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
#undef putchar
putchar(c)
{
return aputc(c,stdout);
}
puterr.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
puterr(c)
{
return aputc(c, stderr);
}
puts.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
puts(str)
register char *str;
{
while (*str)
if (putchar(*str++) == -1)
return -1;
return putchar('\n');
}
putw.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
#include "stdio.h"
putw(w,stream)
register unsigned w;
FILE *stream;
{
if ( putc(w,stream) < 0 )
return EOF;
else if ( putc((w>>8),stream) < 0 )
return EOF;
return w;
}
scanf.c
/* Copyright (C) 1982 by Manx Software Systems */
#include "stdio.h"
static gchar();
static int scnlast;
scanf(fmt, args)
char *fmt; int *args;
{
int gchar();
scnlast = 0;
return scanfmt(gchar, fmt, &args);
}
static gchar(what)
{
if (what == 0) {
if (feof(stdin))
scnlast = EOF;
else
scnlast = agetc(stdin);
} else
scnlast = ungetc(scnlast, stdin);
return scnlast;
}
setbuf.c
/* Copyright (C) 1981,1982 by Manx Software Systems and Thomas Fenwick */
#include "stdio.h"
setbuf(stream, buffer)
register FILE *stream; char *buffer;
{
if (stream->_buff)
return;
if (buffer) {
stream->_buff = buffer;
stream->_buflen = BUFSIZ;
} else {
stream->_buff = &stream->_bytbuf;
stream->_buflen = 1;
}
}
tmpfile.c
#include <stdio.h>
/* returns a pointer for a temp file which is automatically deleted
when the program exits; the file is opened for update */
FILE *
tmpfile ()
{
register char *cp;
register FILE *fp;
char *tmpnam(), *malloc();
cp = tmpnam (NULL);
if ( (fp = fopen (cp, "w+")) == NULL )
perror (cp);
else {
if ((fp->_tmpname = malloc(strlen(cp)+1)) == NULL) {
fclose(fp);
unlink(cp);
return NULL;
}
strcpy(fp->_tmpname,cp);
fp->_flags |= _TEMP;
}
return fp;
}
tmpnam.c
#include <stdio.h>
static char work[] = "AAAAA";
char *
tmpnam(s)
char *s;
{
static char tmpbuf[L_tmpnam];
register char *cp;
if (s == NULL)
s = tmpbuf;
for (;;) {
strcpy(s,P_tmpdir);
strcat(s,work);
strcat(s,"XXX.XXX");
for (cp = work ; *cp ; ++cp)
if (*cp == 'Z')
*cp = 'A';
else {
++*cp;
break;
}
if (mktemp(s))
break;
}
return s;
}
ungetc.c
/* Copyright (c) 1981, 1982 by Manx Software Systems */
#include "stdio.h"
ungetc(c,ptr)
int c; register FILE *ptr;
{
if (c == EOF || ptr->_bp <= ptr->_buff)
return EOF;
*--ptr->_bp = c;
return c;
}


View File

@ -0,0 +1,322 @@
term.mk
OBJ=term.o pcio.o
term.exe: $(OBJ)
ln -o term.exe $(OBJ) -ls -lc
term.c
#define XOFF 0x13
#define XON 0x11
main(argc, argv)
char **argv;
{
register int speed, channel;
printf("Manx term 4.10a (Use F1 to exit)\n");
channel = 1;
if (argc > 1 && argv[1][0]=='-') {
channel = argv[1][1] - '0';
if (channel < 1 || channel > 2) {
printf("Invalid unit #.\n");
printf("Usage: term [-1 | -2] [speed]\n");
exit(1);
}
--argc;
++argv;
}
speed = 0;
if (argc > 1)
speed = atoi(argv[1]);
term(speed, channel);
comrest();
}
#undef putchar
putchar(c)
{
scr_putc(c);
if (c == '\n')
scr_putc('\r');
return c;
}
#define INQSIZ 256 /* these sizes must be powers of two */
#define OUTQSIZ 16
unsigned char inqh, inqt, outqh, outqt;
unsigned char inpq[INQSIZ], outq[OUTQSIZ];
int inqcnt;
char mode, stopped, xoffsent;
term(speed, channel)
{
/*
* Inpq is the queue of characters from the com line, waiting to go to
* the console. Outq is from the console, waiting to go to the com line
*/
register int c, row;
cominit(speed, channel);
for (;;) {
if (scr_poll() != -1) {
c = scr_getc();
if (c == (59|0x80)) /* check for F1 to exit */
return c;
if (c == (83|0x80))
c = 0x7f; /* map DEL key to ascii DEL */
outq[outqh] = c;
outqh = outqh+1 & OUTQSIZ-1;
}
if (inqh != inqt) {
c = inpq[inqt] & 0x7f; /* strip parity */
++inqt;
--inqcnt;
switch (mode) {
case 1:
mode = 0;
switch (c) {
#ifdef DOWNLOAD
case 02: case 03: /* initiate upload/download sequence */
download();
continue;
#endif
case 'Q': /* insert a blank @ cursor pos */
scr_cinsert();
continue;
case 'W': /* delete the char @ cursor pos */
scr_cdelete();
continue;
case 'E': /* insert a blank line @ cursor pos */
scr_linsert();
continue;
case 'R': /* delete the line @ cursor pos */
scr_ldelete();
continue;
case 'T': /* clear to end of line */
scr_eol();
continue;
case '*': /* home cursor & clear screen */
scr_clear();
continue;
case '=': /* cursor move sequence */
mode = 2;
continue;
}
/* fall thru into normal character processing */
case 0:
if (c == 0x1b)
mode = 1;
else if (c == 032)
scr_clear();
else
scr_putc(c);
break;
case 2: /* row character for cursor move */
row = c - 32;
mode = 3;
continue;
case 3: /* column character for cursor move */
c -= 32;
scr_curs(row, c);
mode = 0;
continue;
}
}
if (inqcnt > 200 && !stopped) {
if (comput(XOFF) == 0)
stopped = xoffsent = 1;
} else if (xoffsent && inqcnt < 30) {
if (comput(XON) == 0)
stopped = xoffsent = 0;
} else if (outqt != outqh && comput(outq[outqt]) == 0) {
stopped = 0;
outqt = outqt+1 & OUTQSIZ-1;
}
}
}
pcio.asm
;:ts=8
;
; IBM PC Support routines
;
include lmacros.h
dataseg segment word public 'data'
BASE equ 3f8H
DATA dw BASE+0 ;data register
INTENAB dw BASE+1 ;interrupt enable
DIVLAT dw BASE+0 ;divisor latch (least sig. byte)
INTID dw BASE+2 ;interrupt identification
LINECTL dw BASE+3 ;line control
MODCTL dw BASE+4 ;modem control
LINSTAT dw BASE+5 ;line status
MODSTAT dw BASE+6 ;modem status
INTNUM db 12 ;COM1 interrupt vector #
INTMASK db 10H ;bit mask for 8259.
INTCTL equ 20h ;8259 control register
INTCHIP equ 21h ;8259 mask register
extrn inqh_:byte, inqt_:byte, inqcnt_:word
extrn inpq_:byte
vec_save dd ?
intr_reg db ?
intr_chp db ?
dataseg ends
assume ds:dataseg
data_add dw ? ;codesegment variable for location of dataseg in 'C'
procdef comput,<<outvalue,word>>
mov dx,LINSTAT
in al,dx
and ax,20H ;is the transmitter ready?
jz notready ;not yet
mov bx,sp
mov al,byte ptr outvalue
mov dx,DATA
out dx,al ;output the data
sub ax,ax
pret
notready:
mov ax,-1
pret
pend comput
procdef cominit,<<speed,word>,<channel,word>>
cmp channel,1
je skipfix
;
; we are using SERIAL2, adjust I/O ports, and Int vectors
;
mov bx,offset DATA
mov al,2
fixloop:
mov byte ptr 1[bx],al
add bx,2
cmp bx,offset MODSTAT
jbe fixloop
dec INTNUM ;serial2 uses IRQ3
shr INTMASK,1
skipfix:
mov data_add,ds ;mov 'C' dataseg address to var.
push es
mov ah,35h ;ask DOS for current int vector
mov al,INTNUM
int 21h
mov word ptr vec_save,bx
mov word ptr vec_save+2,es
mov ah,25h ;ask DOS to set new int vector
mov al,INTNUM
push ds
mov dx,cs
mov ds,dx
mov dx,offset intsr ;addr of interupt service in DS:DX
int 21h
pop ds
pop es
mov dx,INTENAB ;get contents of interupt enable reg.
in al,dx
mov intr_reg,al ;sav contents of interupt enable reg.
mov al,0 ;disable interupts for now
out dx,al
mov dx,INTCHIP ;get contents of interupt chip
in al,dx
mov intr_chp,al ;sav contents of interupt chip
mov cl,INTMASK
not cl
and al,cl
out dx,al ;turn on interupt chip
cmp speed,0
je nosetup
mov al,80H
mov dx,LINECTL
out dx,al
mov ax,0c200H
mov dx,1 ;dividend = 0x1c200
div speed ;compute baud rate divisor
mov dx,DIVLAT
out dx,al ;setup com port to given baud rate
mov al,ah
inc dx ;second byte of divisor latch
out dx,al
nosetup:
mov al,03H ;set 8 data, 1 stop, no parity
mov dx,LINECTL
out dx,al
inc dx
mov al,0bh ;turn on DTR, RTS and enable ints
out dx,al
mov al,020h ;send EOI to 8259
out INTCTL,al
mov dx,DATA
in al,dx ;just in case one was waiting for us
mov dx,INTENAB ;now turn on 8250 interupts
mov al,01H ;enable data ready intr.
out dx,al
pret
pend cominit
procdef comrest
mov al,intr_reg
mov dx,INTENAB
out dx,al
mov al,intr_chp
mov dx,INTCHIP
out dx,al
;
push ds
mov ah,25h ;ask DOS to restore old int vector
mov al,INTNUM
lds dx,vec_save
int 21H
pop ds
pret
pend comrest
public intsr
intsr proc far
push ds
push ax
push dx
push bx
mov ds,data_add
mov dx,DATA
in al,dx ;yes, get the byte
sub bx,bx
mov bl,inqh_
mov byte ptr inpq_[bx],al ;mov char. into cue
inc bl ;increment cue head will wrap at 255
cmp bl,inqt_
je no_overflow
mov inqh_,bl
inc inqcnt_
no_overflow:
;
mov al,020h ;send EOI to 8259
out INTCTL,al
pop bx
pop dx
pop ax
pop ds
iret
intsr endp
finish
end


View File

@ -0,0 +1,12 @@
@echo off
if "%CLIB%" == "" goto START
goto END
This is a modified version of the AZTEC Batch which should
run on either a floppy or a hard drive...
:START
set CLIB=\AZTECC86\LIB\;
set INCLUDE=\AZTECC86\INCLUDE\;
set PATH=\AZTECC86\BIN;%PATH%;
:END

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,13 @@
#include <stdio.h>
#include <stdlib.h>
main(int argc, char **argv)
{
if (argc > 1) {
unlink(argv[1]);
}
exit(0);
}

108
Manx Aztec C86 v42b/CRCLIST Normal file
View File

@ -0,0 +1,108 @@
arcv.com: crc=495a
as.exe: crc=a3ee
assert.h: crc=bf7e
build.arc: crc=c424
c.exe: crc=d6c9
c.lib: crc=265b
c86.lib: crc=7fda
cc.exe: crc=7004
cgen.exe: crc=97ff
cl.lib: crc=f2f6
clc.lib: crc=e39f
cld.lib: crc=c049
cnm.exe: crc=d526
color.h: crc=de55
cpm86.arc: crc=5dd7
cpp.exe: crc=0e57
crc.exe: crc=80f8
crt0.obj: crc=d6c2
ctags.com: crc=79e7
ctoeng.com: crc=9147
ctype.h: crc=8342
db.exe: crc=1c83
dbg-read.me: crc=c436
dbgmap.c: crc=5a54
dbgmap.exe: crc=2ba7
dbgmap.mak: crc=2cef
diff.exe: crc=d1ca
dioctl.h: crc=90b8
dos20.arc: crc=c381
engtoc.com: crc=0d08
errno.h: crc=014d
exmpl.c: crc=cee0
fcntl.h: crc=95b9
float.h: crc=1234
g.arc: crc=3e60
g.lib: crc=040c
gl.lib: crc=1ebe
glc.lib: crc=1fde
gld.lib: crc=403f
grep.exe: crc=72d9
hd.com: crc=fdf3
hex86.exe: crc=9c02
initsdb.com: crc=7972
install.com: crc=2c0f
io.h: crc=3b0f
lb.exe: crc=31fc
lcrom.o: crc=fc29
ldrom.o: crc=f2b0
libc.h: crc=012d
limits.h: crc=1c7b
lmacros.h: crc=eb95
ln.exe: crc=7fec
locale.h: crc=3313
lrom.o: crc=fc29
ls.com: crc=7593
m.lib: crc=67ca
m87.lib: crc=12c9
m87l.lib: crc=cb9b
m87lc.lib: crc=4eef
m87ld.lib: crc=bac7
m87s.lib: crc=8a41
m87sl.lib: crc=9ab3
m87slc.lib: crc=aec9
m87sld.lib: crc=c568
make.exe: crc=9530
math.arc: crc=c003
math.h: crc=39ae
mch86.arc: crc=941d
memory.h: crc=e0dd
misc.arc: crc=c805
ml.lib: crc=e082
mlc.lib: crc=c28a
mld.lib: crc=f003
model.h: crc=9339
obd.exe: crc=6448
obj.exe: crc=49c2
ord.exe: crc=90b8
ovbgn.o: crc=c959
ovld.o: crc=bfc0
ovldpath.o: crc=b36d
prof.exe: crc=9031
proto.exe: crc=c4a7
read.me: crc=1d4f
rom.asm: crc=418c
rom.o: crc=f2b0
s.arc: crc=0b60
s.lib: crc=9721
sdb.exe: crc=e875
setjmp.h: crc=cca9
sgtty.h: crc=070f
signal.h: crc=2087
sl.lib: crc=fd2c
slc.lib: crc=f5e0
sld.lib: crc=1b69
sqz.exe: crc=5071
stat.h: crc=28b4
stdarg.h: crc=aee1
stddef.h: crc=73dd
stdio.arc: crc=5c57
stdio.h: crc=f090
stdlib.h: crc=2e8a
stksiz.c: crc=026f
string.h: crc=9d60
term.arc: crc=66f2
term.exe: crc=9692
time.h: crc=1d84
unpack.bat: crc=9388
z.exe: crc=8863

View File

@ -0,0 +1,9 @@
main()
{
char buffer[100];
printf("Please enter your name: ");
gets(buffer);
printf("Hello %s, welcome to the growing family of AZTEC C users.\n",
buffer);
}

View File

@ -0,0 +1,10 @@
/* Copyright Manx Software Systems, Inc. 1987. All rights reserved */
#ifndef assert
#ifndef NDEBUG
void _assert(char *expr, char *filename, unsigned int lineno);
#define assert(x) if (!(x)) _assert(#x, __FILE__, __LINE__); else;
#else
#define assert(x)
#endif
#endif

View File

@ -0,0 +1,13 @@
#define BLACK 0
#define BLUE 1
#define GREEN 2
#define CYAN 3
#define RED 4
#define MAGENTA 5
#define YELLOW 6
#define WHITE 7
#define BLINK 1
#define NO_BLINK 0
#define HIGH 1
#define LOW 0

View File

@ -0,0 +1,23 @@
/* Copyright Manx Software Systems, Inc. 1984. All rights reserved */
#ifndef __CTP
extern char ctp_[];
#define isalpha(x) (ctp_[(x)+1]&0x03)
#define isupper(x) (ctp_[(x)+1]&0x01)
#define islower(x) (ctp_[(x)+1]&0x02)
#define isdigit(x) (ctp_[(x)+1]&0x04)
#define isxdigit(x) (ctp_[(x)+1]&0x08)
#define isalnum(x) (ctp_[(x)+1]&0x07)
#define isspace(x) (ctp_[(x)+1]&0x10)
#define ispunct(x) (ctp_[(x)+1]&0x40)
#define iscntrl(x) (ctp_[(x)+1]&0x20)
#define isprint(x) (ctp_[(x)+1]&0xc7)
#define isgraph(x) (ctp_[(x)+1]&0x47)
#define isascii(x) (((x)&0x80)==0)
#define toascii(x) ((x)&127)
#define _tolower(x) ((x)|0x20)
#define _toupper(x) ((x)&0x5f)
#define __CTP
#endif

View File

@ -0,0 +1,26 @@
/* Copyright (C) 1983 by Manx Software Systems */
#define TIOCGETP 0 /* read contents of tty control structure */
#define TIOCSETP 1 /* set contents of tty control structure */
#define TIOCSETN 1 /* ditto only don't wait for output to flush */
/* special codes for MSDOS 2.x only */
#define TIOCREAD 2 /* read control info from device */
#define TIOCWRITE 3 /* write control info to device */
#define TIOCDREAD 4 /* same as 2 but for drives */
#define TIOCDWRITE 5 /* same as 3 but for drives */
#define GETISTATUS 6 /* get input status */
#define GETOSTATUS 7 /* get output status */
struct sgttyb {
short sg_flags; /* control flags */
char sg_erase; /* ignored */
char sg_kill; /* ignored */
};
/* settings for flags */
#define RAW 0x20 /* no echo or mapping of input/output BDOS(6) */
/* Refer to the MSDOS technical reference for detailed information on
* the remaining flags.
*/

View File

@ -0,0 +1,29 @@
extern int errno;
extern char *sys_errlist[];
extern int sys_nerr;
/* MsDos return codes */
#define EINVAL 1
#define ENOENT 2
#define ENOTDIR 3
#define EMFILE 4
#define EACCES 5
#define EBADF 6
#define EARENA 7
#define ENOMEM 8
#define EFAULT 9
#define EINVENV 10
#define EBADFMT 11
#define EINVACC 12
#define EINVDAT 13
#define ENODEV 15
#define ERMCD 16
#define EXDEV 17
#define ENOMORE 18
/* additional codes used by Aztec C */
#define EEXIST 19
#define ENOTTY 20
/* used by the math library */
#define ERANGE 21
#define EDOM 22

View File

@ -0,0 +1,13 @@
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_DENYRW 0x10
#define O_DENYW 0x20
#define O_DENYR 0x30
#define O_DENYN 0x40
#define O_INHER 0x80
#define O_COMP 0x00
#define O_CREAT 0x0100
#define O_TRUNC 0x0200
#define O_EXCL 0x0400
#define O_APPEND 0x0800

View File

@ -0,0 +1,32 @@
/* Copyright Manx Software Systems, Inc. 1987. All rights reserved */
#define FLT_RADIX 2
#define FLT_MANT_DIG 24
#define FLT_EPSILON 1.19209290e-7F
#define FLT_DIG 6
#define FLT_MIN_EXP -125
#define FLT_MIN 1.17549435e-38F
#define FLT_MIN_10_EXP -37
#define FLT_MAX_EXP 128
#define FLT_MAX 3.40282347e+38F
#define FLT_MAX_10_EXP 38
#define DBL_MANT_DIG 53
#define DBL_EPSILON 2.2204460492503131e-16
#define DBL_DIG 15
#define DBL_MIN_EXP -1021
#define DBL_MIN 2.225073858507201e-308
#define DBL_MIN_10_EXP -307
#define DBL_MAX_EXP 1024
#define DBL_MAX 1.797693134862316e+308
#define DBL_MAX_10_EXP 308
#define LDBL_MANT_DIG 53
#define LDBL_EPSILON 2.2204460492503131e-16
#define LDBL_DIG 15
#define LDBL_MIN_EXP -1021
#define LDBL_MIN 2.225073858507201e-308
#define LDBL_MIN_10_EXP -307
#define LDBL_MAX_EXP 1024
#define LDBL_MAX 1.797693134862316e+308
#define LDBL_MAX_10_EXP 308

View File

@ -0,0 +1,82 @@
/* Copyright (C) 1982 by Manx Software Systems */
/*
* if MAXCHAN is changed then the initialization of chantab in croot.c
* should be adjusted so that it initializes EXACTLY MAXCHAN elements of
* the array. If this is not done, the I/O library may exhibit
* strange behavior.
*/
#define MAXCHAN 11 /* maximum number of I/O channels */
/*
* argument to device routines.
* this is a typedef to allow future redeclaration to guarantee
* enough space to store either a pointer or an integer.
*/
typedef char *_arg;
/*
* device control structure
*/
struct device {
char d_read;
char d_write;
char d_ioctl; /* used by character special devices (eg CON:) */
char d_seek; /* used by random I/O devices (eg: a file) */
int (*d_open)(); /* for special open handling */
};
/*
* device table, contains names and pointers to device entries
*/
struct devtabl {
char *d_name;
struct device *d_dev;
_arg d_arg;
};
/*
* channel table: relates fd's to devices
*/
struct channel {
char c_read;
char c_write;
char c_ioctl;
char c_seek;
int (*c_close)();
_arg c_arg;
} ;
extern struct channel chantab[MAXCHAN];
struct fcb {
char f_driv;
char f_name[8];
char f_type[3];
char f_ext;
char f_resv[2];
char f_rc;
char f_sydx[16];
char f_cr;
unsigned f_record; char f_overfl;
};
struct fcbtab {
struct fcb fcb;
char offset;
char flags;
char user;
};
#define OPNFIL 15
#define CLSFIL 16
#define DELFIL 19
#define READSQ 20
#define WRITSQ 21
#define MAKFIL 22
#define SETDMA 26
#define GETUSR 32
#define READRN 33
#define WRITRN 34
#define FILSIZ 35
#define SETREC 36
#define Wrkbuf ((char *)0x80)

View File

@ -0,0 +1,49 @@
/* Copyright (C) 1981, 1982 by Manx Software Systems */
#define fgetc getc
#define fputc putc
extern int errno;
#define FLT_FAULT 0 /* vector for floating-point faults */
extern int (*Sysvec[])();
#define NULL (void *)0
#define EOF -1
#define BUFSIZ 1024
#define MAXSTREAM 20
#define _BUSY 0x01
#define _ALLBUF 0x02
#define _DIRTY 0x04
#define _EOF 0x08
#define _IOERR 0x10
#define _TEMP 0x20 /* temporary file (delete on close) */
typedef struct {
char *_bp; /* current position in buffer */
char *_bend; /* last character in buffer + 1 */
char *_buff; /* address of buffer */
char _flags; /* open mode, etc. */
char _unit; /* token returned by open */
char _bytbuf; /* single byte buffer for unbuffer streams */
int _buflen; /* length of buffer */
char *_tmpname; /* name of file for temporaries */
} FILE;
extern FILE Cbuffs[];
extern char *Stdbufs; /* free list of buffers */
FILE *fopen();
long ftell();
#define stdin (&Cbuffs[0])
#define stdout (&Cbuffs[1])
#define stderr (&Cbuffs[2])
#define getchar() agetc(stdin)
#define putchar(c) aputc(c, stdout)
#define feof(fp) (((fp)->_flags&_EOF)!=0)
#define ferror(fp) (((fp)->_flags&_IOERR)!=0)
#define clearerr(fp) ((fp)->_flags &= ~(_IOERR|_EOF))
#define fileno(fp) ((fp)->_unit)
#define fflush(fp) flsh_(fp,-1)
#define P_tmpdir ""
#define L_tmpnam 40

View File

@ -0,0 +1,21 @@
/* Copyright Manx Software Systems, Inc. 1987. All rights reserved */
#ifndef __LIMITS
#define CHAR_BIT 8
#define SCHAR_MIN -128
#define SCHAR_MAX 127
#define CHAR_MIN -128
#define CHAR_MAX 127
#define UCHAR_MAX 255
#define SHRT_MIN 0x8000
#define SHRT_MAX 0x7fff
#define USHRT_MAX 0xffffU
#define INT_MIN 0x8000
#define INT_MAX 0x7fff
#define UINT_MAX 0xffffU
#define LONG_MIN 0x80000000L
#define LONG_MAX 0x7fffffffL
#define ULONG_MAX 0xffffffffU
#define __LIMITS
#endif

View File

@ -0,0 +1,210 @@
nlist
; Copyright (C) 1985 by Manx Software Systems, Inc.
; :ts=8
ifndef MODEL
MODEL equ 0
endif
if MODEL and 1
largecode
FARPROC equ 1
FPTRSIZE equ 4
else
FPTRSIZE equ 2
endif
if MODEL and 2
LONGPTR equ 1
endif
;this macro to be used on returning
;restores bp and registers
pret macro
if havbp
pop bp
endif
ret
endm
internal macro pname
public pname
pname proc
endm
intrdef macro pname
public pname
ifdef FARPROC
pname label far
else
pname label near
endif
endm
procdef macro pname, args
public pname&_
ifdef FARPROC
_arg = 6
pname&_ proc far
else
_arg = 4
pname&_ proc near
endif
ifnb <args>
push bp
mov bp,sp
havbp = 1
decll <args>
else
havbp = 0
endif
endm
entrdef macro pname, args
public pname&_
ifdef FARPROC
_arg = 6
pname&_:
else
_arg = 4
pname&_:
endif
ifnb <args>
if havbp
push bp
mov bp,sp
else
error must declare main proc with args, if entry has args
endif
decll <args>
endif
endm
;this macro equates 'aname' to arg on stack
decl macro aname, type
;;'byte' or anything else
havtyp = 0
ifidn <type>,<byte>
aname equ byte ptr _arg[bp]
_arg = _arg + 2
havtyp = 1
endif
ifidn <type>,<dword>
aname equ dword ptr _arg[bp]
_arg = _arg + 4
havtyp = 1
endif
ifidn <type>,<cdouble>
aname equ qword ptr _arg[bp]
_arg = _arg + 8
havtyp = 1
endif
ifidn <type>, <ptr>
ifdef LONGPTR
aname equ dword ptr _arg[bp]
_arg = _arg + 4
else
aname equ word ptr _arg[bp]
_arg = _arg + 2
endif
havtyp = 1
endif
ifidn <type>, <fptr>
ifdef FARPROC
aname equ dword ptr _arg[bp]
_arg = _arg + 4
else
aname equ word ptr _arg[bp]
_arg = _arg + 2
endif
havtyp = 1
endif
ifidn <type>, <word>
aname equ word ptr _arg[bp]
_arg = _arg + 2
havtyp = 1
endif
ife havtyp
error -- type is unknown.
endif
endm
;this macro loads an arg pointer into DEST, with optional SEGment
ldptr macro dest, argname, seg
ifdef LONGPTR
ifnb <seg> ;;get segment if specified
ifidn <seg>,<es>
les dest,argname
else
ifidn <seg>,<ds>
lds dest,argname
else
mov dest, word ptr argname
mov seg, word ptr argname[2]
endif
endif
else
ifidn <dest>,<si> ;;si gets seg in ds
lds si, argname
else
ifidn <dest>,<di> ;;or, es:di
les di, argname
else
garbage error: no seg for long pointer
endif
endif
endif
else
mov dest, word ptr argname ;;get the pointer
ENDIF
ENDM
decll macro list
IRP i,<list>
decl i
ENDM
ENDM
pend macro pname
pname&_ endp
endm
retptrm macro src,seg
mov ax, word ptr src
ifdef LONGPTR
mov dx, word ptr src+2
endif
endm
retptrr macro src,seg
mov ax,src
ifdef LONGPTR
ifnb <seg>
mov dx, seg
endif
endif
endm
retnull macro
ifdef LONGPTR
sub dx,dx
endif
sub ax,ax
endm
pushds macro
ifdef LONGPTR
push ds
endif
endm
popds macro
ifdef LONGPTR
pop ds
endif
endm
finish macro
codeseg ends
endm
list
codeseg segment byte public 'code'
assume cs:codeseg

View File

@ -0,0 +1,11 @@
/* Copyright Manx Software Systems, Inc. 1987. All rights reserved */
#ifndef LC_ALL
#define LC_ALL 0
#define LC_COLLATE 1
#define LC_CTYPE 2
#define LC_NUMERIC 3
#define LC_TIME 4
char *setlocale(int category, const char *locale);
#endif

View File

@ -0,0 +1,24 @@
/* Copyright Manx Software Systems, Inc. 1984. All rights reserved */
#ifndef __NOPROTO__
double sin(double), cos(double), tan(double), cotan(double);
double asin(double), acos(double), atan(double), atan2(double,double);
double ldexp(double,int), frexp(double, int *), modf(double, double *);
double floor(double), ceil(double), fabs(double), fmod(double,double);
double log(double), log10(double), exp(double), sqrt(double);
double pow(double,double), sinh(double), cosh(double), tanh(double);
#else
double sin(), cos(), tan(), cotan();
double asin(), acos(), atan(), atan2();
double ldexp(), frexp(), modf();
double floor(), ceil(), fabs(), fmod();
double log(), log10(), exp(), sqrt();
double pow(), sinh(), cosh(), tanh();
#endif
#ifndef HUGE_VAL
#define HUGE_VAL 1.79e+308
#define LOGHUGE 709.778
#define TINY_VAL 2.2e-308
#define LOGTINY -708.396
#endif

View File

@ -0,0 +1,2 @@
extern char *memcpy(), *memchr(), *memccpy(), memset();
extern int memcmp();

View File

@ -0,0 +1,7 @@
#if (sizeof(int (*)()) == 4)
#define _LARGECODE
#endif
#if (sizeof(char *) == 4)
#define _LARGEDATA
#endif

View File

@ -0,0 +1,9 @@
/* Copyright Manx Software Systems, Inc. 1984. All rights reserved */
#ifndef __JBUFSIZE
#define __JBUFSIZE (6*sizeof(char *))
typedef char jmp_buf[__JBUFSIZE];
int setjmp(jmp_buf env);
void longjmp(jmp_buf env, int val);
#endif

View File

@ -0,0 +1,19 @@
/* Copyright (C) 1983 by Manx Software Systems */
#define TIOCGETP 0 /* read contents of tty control structure */
#define TIOCSETP 1 /* set contents of tty control structure */
#define TIOCSETN 1 /* ditto only don't wait for output to flush */
struct sgttyb {
char sg_erase; /* ignored */
char sg_kill; /* ignored */
short sg_flags; /* control flags */
};
/* settings for flags */
#define _VALID 0x3a
#define RAW 0x20 /* no echo or mapping of input/output BDOS(6) */
#define CRMOD 0x10 /* map input CR to NL, output NL to CR LF */
#define ECHO 0x08 /* ignored unless CBREAK is set */
#define CBREAK 0x02 /* input using BDOS(1), unless echo off then */
/* same as RAW */

View File

@ -0,0 +1,32 @@
/* Copyright Manx Software Systems, Inc. 1987. All rights reserved */
#ifndef _NUMSIG
#define SIGINT 1
#define SIGTERM 2
#define SIGABRT 3
#define SIGFPE 4
#define SIGILL 5
#define SIGSEGV 6
#define _NUMSIG 6
#define _FSTSIG 1
#ifndef __NOPROTO__
#define SIG_DFL ((void (*)(int))0)
#define SIG_IGN ((void (*)(int))1)
#define SIG_ERR ((void (*)(int))-1)
void (*signal(int sig, void (*func)(int)))(int);
int raise(int sig);
#else
#define SIG_DFL ((void (*)())0)
#define SIG_IGN ((void (*)())1)
#define SIG_ERR ((void (*)())-1)
void (*signal())();
int raise();
#endif
#endif

View File

@ -0,0 +1,29 @@
/* Copyright (C) 1984 by Manx Software Systems */
struct stat {
char st_attr;
long st_mtime;
long st_size;
};
/* settings of the st_attr field */
#define ST_RDONLY 0x01 /* read only file */
#define ST_HIDDEN 0x02 /* hidden file */
#define ST_SYSTEM 0x04 /* system file */
#define ST_VLABEL 0x08 /* volume label */
#define ST_DIRECT 0x10 /* file is a sub-directory */
#define ST_ARCHIV 0x20 /* set when file has been written and closed */
/* the format of the st_mtime field is:
< year > < month> < day > < hours > < minutes > < sec/2 >
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
where:
year is from 0-119 for 1980-2099
month is 1-12
day is 1-31
hours is 0-23
minutes is 0-59
sec/2 is 0-29
*/

View File

@ -0,0 +1,6 @@
/* Copyright Manx Software Systems, Inc. 1987. All rights reserved */
typedef char *va_list;
#define va_start(ap, parmN) ((ap) = (char *)(&parmN + 1))
#define va_arg(ap, type) ((ap) += sizeof(type), ((type *)(ap))[-1])
#define va_end(ap)

View File

@ -0,0 +1,14 @@
/* Copyright Manx Software Systems, Inc. 1987. All rights reserved */
#ifndef __DEFS
extern char __offtemp[];
typedef int ptrdiff_t;
typedef unsigned int size_t;
#define NULL ((void *)0)
#define offsetof(type, ident) ((char *)((type *)__offtemp)->ident - __offtemp)
extern int errno;
#define __DEFS
#endif

View File

@ -0,0 +1,74 @@
/* Copyright Manx Software Systems, Inc. 1982-1987. All rights reserved */
#ifndef _BUSY
#define fgetc getc
#define fputc putc
#define NULL ((void *)0)
#define EOF -1
#define BUFSIZ 1024
#define MAXSTREAM 20
#define _BUSY 0x01
#define _ALLBUF 0x02
#define _DIRTY 0x04
#define _EOF 0x08
#define _IOERR 0x10
#define _TEMP 0x20 /* temporary file (delete on close) */
#define _IOFBF 0x00
#define _IOLBF 0x40
#define _IONBF 0x80
typedef struct {
char *_bp; /* current position in buffer */
char *_bend; /* last character in buffer + 1 */
char *_buff; /* address of buffer */
char _flags; /* open mode, etc. */
char _unit; /* token returned by open */
char _bytbuf; /* single byte buffer for unbuffer streams */
int _buflen; /* length of buffer */
char *_tmpname; /* name of file for temporaries */
} FILE;
extern FILE Cbuffs[];
#ifndef __NOPROTO__
FILE *fopen(char *name, char *mode);
FILE *freopen(char *name, char *mode, FILE *stream);
FILE *fdopen(int fd, char *mode);
int fseek(FILE *stream, long pos, int whence);
long ftell(FILE *stream);
int remove(const char *filename);
#else
FILE *fopen(), *freopen(), *fdopen();
long ftell();
#endif
#define stdin (&Cbuffs[0])
#define stdout (&Cbuffs[1])
#define stderr (&Cbuffs[2])
#ifdef MSDOS
#define stdaux (&Cbuffs[3])
#define stdprt (&Cbuffs[4])
#endif
#define getchar() agetc(stdin)
#define putchar(c) aputc(c, stdout)
#define feof(fp) (((fp)->_flags&_EOF)!=0)
#define ferror(fp) (((fp)->_flags&_IOERR)!=0)
#define clearerr(fp) ((fp)->_flags &= ~(_IOERR|_EOF))
#define fileno(fp) ((fp)->_unit)
#define fflush(fp) flsh_(fp,-1)
#define P_tmpdir ""
#define L_tmpnam 40
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define TMP_MAX 26
#endif

View File

@ -0,0 +1,57 @@
/* Copyright Manx Software Systems, Inc. 1988. All rights reserved */
typedef unsigned int size_t;
#ifndef __NOPROTO__
double atof(const char *nptr);
int atoi(const char *nptr);
long int atol(const char *nptr);
double strtod(const char *nptr, char *endptr);
long int strtol(char *nptr, char *endptr, int base);
unsigned long int stroul(char *nptr, char *endptr, int base);
int rand(void);
void srand(unsigned int seed);
void *calloc(size_t nmemb, size_t size);
void *malloc(size_t size);
void *realloc(void *ptr, size_t);
void abort(void);
int atexit(void (*func)(void));
int exit(int status);
char *getenv(const char *name);
int system(const char *string);
void *bsearch(const void *key, const void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *));
int abs(int j);
#else
double atof();
int atoi();
long int atol();
double strtod();
long int strtol();
unsigned long stroul();
int rand();
void srand();
void *calloc(), *malloc();
void *realloc(), abort();
int atexit();
int exit();
char *getenv();
int system();
void *bsearch();
int abs();
#endif
#if __STDC__ != 1
char *stricmp(const char *string1, const char *string2);
#ifdef __NOPROTO__
char *strrev(const char *string1);
char *strlwr(const char *string1);
#else
char *strrev();
char *strlwr();
#endif
#endif

View File

@ -0,0 +1,48 @@
/* Copyright Manx Software Systems, Inc. 1987. All rights reserved */
#ifndef __NOPROTO__
void *memcpy(void *s1, const void *s2, unsigned int n);
void *memmove(void *s1, const void *s2, unsigned int n);
char *strcpy(char *s1, const char *s2);
char *strncpy(char *s1, const char *s2, unsigned int n);
char *strcat(char *s1, const char *s2);
char *strncat(char *s1, const char *s2, unsigned int n);
int memcmp(const void *s1, const void *s2, unsigned int n);
int strcmp(const char *s1, const char *s2);
int strcoll(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, unsigned int n);
unsigned int strxfrm(char *s1, const char *s2, unsigned int n);
void *memchr(const void *s, int c, unsigned int n);
char *strchr(const char *s, int c);
unsigned int strcspn(const char *s1, const char *s2);
char *strpbrk(const char *s1, const char *s2);
char *strrchr(const char *s, int c);
unsigned int strspn(const char *s1, const char *s2);
char *strstr(const char *s1, const char *s2);
char *strtok(char *s1, const char *s2);
void *memset(void *s, int c, unsigned int n);
char *strerror(int errnum);
unsigned int strlen(const char *s);
#else
void *memcpy();
void *memmove();
char *strcpy();
char *strncpy();
char *strcat();
char *strncat();
int memcmp();
int strcmp();
int strncmp();
void *memchr();
char *strchr();
unsigned int strcspn();
char *strpbrk();
char *strrchr();
unsigned int strspn();
char *strstr();
char *strtok();
void *memset();
char *strerror();
unsigned int strlen();
#endif

View File

@ -0,0 +1,34 @@
/* Copyright Manx Software Systems, Inc. 1984-1987. All rights reserved */
#ifndef CLK_TCK
#define CLK_TCK 100
typedef long time_t;
typedef long clock_t;
struct tm {
short tm_sec;
short tm_min;
short tm_hour;
short tm_mday;
short tm_mon;
short tm_year;
short tm_wday;
short tm_yday;
short tm_isdst;
short tm_hsec;
};
#ifndef __NOPROTO__
clock_t clock(void);
time_t time(time_t *timer);
struct tm *gmtime(time_t *timer), *localtime(time_t *timer);
char *asctime(struct tm *timeptr), *ctime(time_t *timer);
#else
clock_t clock();
time_t time();
struct tm *gmtime(), *localtime();
char *asctime(), *ctime();
#endif
#endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
main()
{
char buffer[100];
printf("Please enter your name: ");
gets(buffer);
printf("Hello %s, welcome to the growing family of AZTEC C users.\n",
buffer);
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More