Manx Aztec C v3.40a

This commit is contained in:
davidly 2024-07-01 06:45:15 -07:00
parent 0c6670167f
commit 71c84496e9
182 changed files with 20029 additions and 0 deletions

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,30 @@
#include <stdio.h>
#define DIGITS_TO_FIND 200 /*9009*/
int main() {
int N = DIGITS_TO_FIND;
int x = 0;
int a[ DIGITS_TO_FIND ];
int n;
for (n = N - 1; n > 0; --n) {
a[n] = 1;
}
a[1] = 2, a[0] = 0;
while (N > 9) {
n = N--;
while (--n) {
a[n] = x % n;
x = 10 * a[n-1] + x/n;
}
printf("%d", x);
}
printf( "\ndone\n" );
return 0;
}

View File

@ -0,0 +1,35 @@
/* sieve.c */
/* Eratosthenes Sieve Prime Number Program in C from Byte Jan 1983
to compare the speed. */
#include <stdio.h>
#define TRUE 1
#define FALSE 0
#define SIZE 8190
typedef int bool;
char flags[SIZE+1];
int main()
{
int i,k;
int prime,count,iter;
for (iter = 1; iter <= 10; iter++) { /* do program 10 times */
count = 0; /* initialize prime counter */
for (i = 0; i <= SIZE; i++) /* set all flags TRUE */
flags[i] = TRUE;
for (i = 0; i <= SIZE; i++) {
if (flags[i]) { /* found a prime */
prime = i + i + 3; /* twice index + 3 */
for (k = i + prime; k <= SIZE; k += prime)
flags[k] = FALSE; /* kill all multiples */
count++; /* primes found */
}
}
}
printf("%d primes.\n",count); /*primes found in 10th pass */
return 0;
}

View File

@ -0,0 +1,169 @@
#include <stdio.h>
#ifdef AZTEC86
#include <stdlib.h>
#endif
#ifdef HISOFTC
#include <stdlib.h>
#endif
#ifdef INTELC
#include <stdlib.h>
#endif
#ifdef WATCOM
#include <malloc.h>
#include <process.h>
#endif
#ifdef powerc
#define allocs 50
#else
#ifdef HISOFTC
#define allocs 66 /* not enough RAM with hisoft to go higher */
#else
/* most c runtimes work up to 69, but use 66 to have a consistent benchmark */
#define allocs 66
#endif
#endif
int logging = 1;
char * memset_x( p, v, c ) char * p; int v; int c;
{
unsigned char * pc = (unsigned char *) p;
unsigned char val = (unsigned char) ( v & 0xff );
int i;
if ( 0 == p )
{
printf( "request to memset a null pointer\n" );
exit( 1 );
}
if ( logging )
#ifdef CPMTIME
printf( " memset p %u, v %d, val %x, c %d\n", p, v, val, c );
#else
#ifdef HISOFTC
printf( " memset p %u, v %d, val %x, c %d\n", p, v, val, c );
#else
printf( " memset p %p, v %d, val %x, c %d\n", p, v, val, c );
#endif
#endif
for ( i = 0; i < c; i++ )
*pc++ = val;
return p;
}
void chkmem( p, v, c ) char * p; int v; int c;
{
unsigned char * pc = (unsigned char *) p;
unsigned char val = (unsigned char) ( v & 0xff );
int i;
if ( 0 == p )
{
printf( "request to chkmem a null pointer\n" );
exit( 1 );
}
for ( i = 0; i < c; i++ )
{
if ( *pc != val )
{
#ifdef CPMTIME
printf( "memory isn't as expected! p %u, v %d, c %d, *pc %d\n",p, v, c, *pc );
#else
printf( "memory isn't as expected! p %p, v %d, c %d, *pc %d\n",p, v, c, *pc );
#endif
exit( 1 );
}
pc++;
}
}
int main( argc, argv ) int argc; char * argv[];
{
int i, cb, c_cb, j;
char * pc;
char * ap[ allocs ];
logging = ( argc > 1 );
pc = argv[ 0 ]; /* evade compiler warning */
for ( j = 0; j < 10; j++ )
{
if ( logging )
printf( "in alloc mode\n" );
for ( i = 0; i < allocs; i++ )
{
cb = 8 + ( i * 10 );
c_cb = cb + 5;
if ( logging )
printf( " i, cb: %d %d\n", i, cb );
pc = (char *) calloc( c_cb, 1 );
chkmem( pc, 0, c_cb );
memset_x( pc, 0xcc, c_cb );
ap[ i ] = (char *) malloc( cb );
memset_x( ap[ i ], 0xaa, cb );
chkmem( pc, 0xcc, c_cb );
free( pc );
}
if ( logging )
printf( "in free mode, even first\n" );
for ( i = 0; i < allocs; i += 2 )
{
cb = 8 + ( i * 10 );
c_cb = cb + 3;
if ( logging )
printf( " i, cb: %d %d\n", i, cb );
pc = (char *) calloc( c_cb, 1 );
chkmem( pc, 0, c_cb );
memset_x( pc, 0xcc, c_cb );
chkmem( ap[ i ], 0xaa, cb );
memset_x( ap[ i ], 0xff, cb );
free( ap[ i ] );
chkmem( pc, 0xcc, c_cb );
free( pc );
}
if ( logging )
printf( "in free mode, now odd\n" );
for ( i = 1; i < allocs; i += 2 )
{
cb = 8 + ( i * 10 );
c_cb = cb + 7;
if ( logging )
printf( " i, cb: %d %d\n", i, cb );
pc = (char *) calloc( c_cb, 1 );
chkmem( pc, 0, c_cb );
memset_x( pc, 0xcc, c_cb );
chkmem( ap[ i ], 0xaa, cb );
memset_x( ap[ i ], 0xff, cb );
free( ap[ i ] );
chkmem( pc, 0xcc, c_cb );
free( pc );
}
}
printf( "success\n" );
return 0;
}

View File

@ -0,0 +1,527 @@
/*
This version builds with old compilers including:
Aztec C 1.06 for 8080 & Z80 on CP/M.
Microsoft C Compiler V1.04 for 8086 on DOS. (This is Lattice C)
Microsoft C Compiler V2.03 for 8086 on DOS. (Still Lattice C)
Microsoft C Compiler V3.00 for 8086 on DOS.
QuickC 1.0
Turbo C 2.0
The syntax is old and reminds me of 7th grade summer vacation.
Much of this code is awkward to satisfy the lowest common denominator of many compilers.
unsigned long isn't supported in many older compilers, so long is used instead.
Early DOS and CP/M require register variabes to be int, not char or other types.
The perf improvement of using register-int instead of stack-char is worth it.
*/
#define LINT_ARGS
#include <stdio.h>
#ifdef DOSTIME
#include <time.h>
#include <dos.h>
#endif
#define true 1
#define false 0
/* Function Pointers are the fastest implementation for almost every compiler */
#define UseFunPointers 1
#define UseWinner2 2
#define UseLookForWinner 3
#define WinMethod UseFunPointers
#define ABPrune true /* alpha beta pruning */
#define WinLosePrune true /* stop early on win/lose */
#define ScoreWin 6
#define ScoreTie 5
#define ScoreLose 4
#define ScoreMax 9
#define ScoreMin 2
#define DefaultIterations 10
#define PieceX 1
#define PieceO 2
#define PieceBlank 0
typedef char ttype; /* 8-bit and 16-bit cpus do best with char aside from register in locals */
int g_Iterations = DefaultIterations;
ttype g_board[ 9 ];
#if WinMethod == UseFunPointers
ttype pos0func()
{
/* using "register int" instead of "ttype" for x is faster on 8086 and Z80 */
register int x = g_board[0];
if ( ( x == g_board[1] && x == g_board[2] ) ||
( x == g_board[3] && x == g_board[6] ) ||
( x == g_board[4] && x == g_board[8] ) )
return x;
return PieceBlank;
}
ttype pos1func()
{
register int x = g_board[1];
if ( ( x == g_board[0] && x == g_board[2] ) ||
( x == g_board[4] && x == g_board[7] ) )
return x;
return PieceBlank;
}
ttype pos2func()
{
register int x = g_board[2];
if ( ( x == g_board[0] && x == g_board[1] ) ||
( x == g_board[5] && x == g_board[8] ) ||
( x == g_board[4] && x == g_board[6] ) )
return x;
return PieceBlank;
}
ttype pos3func()
{
register int x = g_board[3];
if ( ( x == g_board[4] && x == g_board[5] ) ||
( x == g_board[0] && x == g_board[6] ) )
return x;
return PieceBlank;
}
ttype pos4func()
{
register int x = g_board[4];
if ( ( x == g_board[0] && x == g_board[8] ) ||
( x == g_board[2] && x == g_board[6] ) ||
( x == g_board[1] && x == g_board[7] ) ||
( x == g_board[3] && x == g_board[5] ) )
return x;
return PieceBlank;
}
ttype pos5func()
{
register int x = g_board[5];
if ( ( x == g_board[3] && x == g_board[4] ) ||
( x == g_board[2] && x == g_board[8] ) )
return x;
return PieceBlank;
}
ttype pos6func()
{
register int x = g_board[6];
if ( ( x == g_board[7] && x == g_board[8] ) ||
( x == g_board[0] && x == g_board[3] ) ||
( x == g_board[4] && x == g_board[2] ) )
return x;
return PieceBlank;
}
ttype pos7func()
{
register int x = g_board[7];
if ( ( x == g_board[6] && x == g_board[8] ) ||
( x == g_board[1] && x == g_board[4] ) )
return x;
return PieceBlank;
}
ttype pos8func()
{
register int x = g_board[8];
if ( ( x == g_board[6] && x == g_board[7] ) ||
( x == g_board[2] && x == g_board[5] ) ||
( x == g_board[0] && x == g_board[4] ) )
return x;
return PieceBlank;
}
typedef ttype pfunc_t();
pfunc_t * winner_functions[9] =
{
pos0func,
pos1func,
pos2func,
pos3func,
pos4func,
pos5func,
pos6func,
pos7func,
pos8func
};
#endif
#if WinMethod == UseWinner2
ttype winner2( move ) ttype move;
{
register int x; /* faster than ttype x on the stack */
switch( move ) /* msc v3 from 1985 generates a jump table! */
{
case 0:
{
x = g_board[ 0 ];
if ( ( ( x == g_board[1] ) && ( x == g_board[2] ) ) ||
( ( x == g_board[3] ) && ( x == g_board[6] ) ) ||
( ( x == g_board[4] ) && ( x == g_board[8] ) ) )
return x;
break;
}
case 1:
{
x = g_board[ 1 ];
if ( ( ( x == g_board[0] ) && ( x == g_board[2] ) ) ||
( ( x == g_board[4] ) && ( x == g_board[7] ) ) )
return x;
break;
}
case 2:
{
x = g_board[ 2 ];
if ( ( ( x == g_board[0] ) && ( x == g_board[1] ) ) ||
( ( x == g_board[5] ) && ( x == g_board[8] ) ) ||
( ( x == g_board[4] ) && ( x == g_board[6] ) ) )
return x;
break;
}
case 3:
{
x = g_board[ 3 ];
if ( ( ( x == g_board[4] ) && ( x == g_board[5] ) ) ||
( ( x == g_board[0] ) && ( x == g_board[6] ) ) )
return x;
break;
}
case 4:
{
x = g_board[ 4 ];
if ( ( ( x == g_board[0] ) && ( x == g_board[8] ) ) ||
( ( x == g_board[2] ) && ( x == g_board[6] ) ) ||
( ( x == g_board[1] ) && ( x == g_board[7] ) ) ||
( ( x == g_board[3] ) && ( x == g_board[5] ) ) )
return x;
break;
}
case 5:
{
x = g_board[ 5 ];
if ( ( ( x == g_board[3] ) && ( x == g_board[4] ) ) ||
( ( x == g_board[2] ) && ( x == g_board[8] ) ) )
return x;
break;
}
case 6:
{
x = g_board[ 6 ];
if ( ( ( x == g_board[7] ) && ( x == g_board[8] ) ) ||
( ( x == g_board[0] ) && ( x == g_board[3] ) ) ||
( ( x == g_board[4] ) && ( x == g_board[2] ) ) )
return x;
break;
}
case 7:
{
x = g_board[ 7 ];
if ( ( ( x == g_board[6] ) && ( x == g_board[8] ) ) ||
( ( x == g_board[1] ) && ( x == g_board[4] ) ) )
return x;
break;
}
case 8:
{
x = g_board[ 8 ];
if ( ( ( x == g_board[6] ) && ( x == g_board[7] ) ) ||
( ( x == g_board[2] ) && ( x == g_board[5] ) ) ||
( ( x == g_board[0] ) && ( x == g_board[4] ) ) )
return x;
break;
}
}
return PieceBlank;
} /*winner2*/
#endif
#if WinMethod == UseLookForWinner
ttype LookForWinner()
{
register int p = g_board[0]; /* faster as register int than ttype on 8086 and Z80 */
if ( PieceBlank != p )
{
if ( p == g_board[1] && p == g_board[2] )
return p;
if ( p == g_board[3] && p == g_board[6] )
return p;
}
p = g_board[3];
if ( PieceBlank != p && p == g_board[4] && p == g_board[5] )
return p;
p = g_board[6];
if ( PieceBlank != p && p == g_board[7] && p == g_board[8] )
return p;
p = g_board[1];
if ( PieceBlank != p && p == g_board[4] && p == g_board[7] )
return p;
p = g_board[2];
if ( PieceBlank != p && p == g_board[5] && p == g_board[8] )
return p;
p = g_board[4];
if ( PieceBlank != p )
{
if ( ( p == g_board[0] ) && ( p == g_board[8] ) )
return p;
if ( ( p == g_board[2] ) && ( p == g_board[6] ) )
return p;
}
return PieceBlank;
} /*LookForWinner*/
#endif
int g_IMoves = 0;
ttype MinMax( alpha, beta, depth, move ) ttype alpha; ttype beta; ttype depth; ttype move;
{
ttype pieceMove, score; /* better perf with char than int. out of registers so use stack */
register int p, value; /* better perf with these as an int on Z80, 8080, and 8086 */
g_IMoves++;
if ( depth >= 4 )
{
#if WinMethod == UseFunPointers
p = ( * winner_functions[ move ] )();
#endif
#if WinMethod == UseWinner2
p = winner2( move );
#endif
#if WinMethod == UseLookForWinner
p = LookForWinner();
#endif
if ( PieceBlank != p )
{
if ( PieceX == p )
return ScoreWin;
return ScoreLose;
}
if ( 8 == depth )
return ScoreTie;
}
if ( depth & 1 )
{
value = ScoreMin;
pieceMove = PieceX;
}
else
{
value = ScoreMax;
pieceMove = PieceO;
}
for ( p = 0; p < 9; p++ )
{
if ( PieceBlank == g_board[ p ] )
{
g_board[p] = pieceMove;
score = MinMax( alpha, beta, depth + 1, p );
g_board[p] = PieceBlank;
if ( depth & 1 )
{
#if WinLosePrune /* #if statements must be in first column for MS C 1.0 */
if ( ScoreWin == score )
return ScoreWin;
#endif
if ( score > value )
{
value = score;
#if ABPrune
if ( value >= beta )
return value;
if ( value > alpha )
alpha = value;
#endif
}
}
else
{
#if WinLosePrune
if ( ScoreLose == score )
return ScoreLose;
#endif
if ( score < value )
{
value = score;
#if ABPrune
if ( value <= alpha )
return value;
if ( value < beta )
beta = value;
#endif
}
}
}
}
return value;
} /*MinMax*/
long g_Moves = 0;
int FindSolution( position ) ttype position;
{
register int i;
for ( i = 0; i < 9; i++ )
g_board[ i ] = PieceBlank;
g_board[ position ] = PieceX;
for ( i = 0; i < g_Iterations; i++ )
{
g_IMoves = 0;
MinMax( ScoreMin, ScoreMax, 0, position );
g_Moves += g_IMoves; /* do the 4-byte long addition once per loop to save work */
}
return 0;
} /*FindSolution*/
#ifdef CPMTIME
struct CPMTimeValue
{
int h, m, s, l;
};
void print_time_now()
{
/* This CP/M BDOS call of 105 is only implemented in NTVCM -- it's not a standard CP/M 2.2 call */
struct CPMTimeValue t;
t.h = t.m = t.s = t.l = 0;
bdos( 105, &t );
printf( "current time: %02d:%02d:%02d.%02d\n", t.h, t.m, t.s, t.l );
} /*print_time_now*/
long get_ms()
{
/* This CP/M BDOS call of 105 is only implemented in NTVCM -- it's not a standard CP/M 2.2 call */
long h, m, s, l;
struct CPMTimeValue t;
t.h = t.m = t.s = t.l = 0;
bdos( 105, &t );
h = t.h;
m = t.m;
s = t.s;
l = t.l;
return h * 3600000 + m * 60000 + s * 1000 + l * 10;
} /*get_ms*/
#else /* no elif with old compilers */
#ifdef DOSTIME
void print_time_now()
{
/* Make a DOS interrupt call to get the time */
union REGS wrIn, wrOut;
wrIn.h.ah = 0x2c;
intdos( &wrIn, &wrOut );
printf( "current time: %02d:%02d:%02d.%02d\n", wrOut.h.ch, wrOut.h.cl, wrOut.h.dh, wrOut.h.dl );
fflush( stdout );
} /*print_time_now*/
long get_ms()
{
/* this function takes about 3 milliseconds on the original IBM PC */
long h, m, s, l;
union REGS wrIn, wrOut;
wrIn.h.ah = 0x2c;
intdos( &wrIn, &wrOut );
h = wrOut.h.ch;
m = wrOut.h.cl;
s = wrOut.h.dh;
l = wrOut.h.dl;
return h * 3600000 + m * 60000 + s * 1000 + l * 10;
} /*get_ms*/
#else
/* must do this on actual CP/M machines */
int print_time_now() { return 0; }
long get_ms() { return 0; }
#endif
#endif
int main( argc, argv ) int argc; char * argv[];
{
long start_time, end_time;
if ( 2 == argc )
sscanf( argv[ 1 ], "%d", &g_Iterations ); /* no atoi in MS C 1.0 */
start_time = get_ms();
FindSolution( 0 );
FindSolution( 1 );
FindSolution( 4 );
end_time = get_ms();
printf( "runtime in ms: %ld\n", end_time - start_time );
printf( "move count: %ld\n", g_Moves ); /* 6493 * g_Iterations */
printf( "iteration count: %d\n", g_Iterations );
printf( "method: %s\n",
( WinMethod == UseFunPointers ) ? "function pointers" :
( WinMethod == UseWinner2 ) ? "winner2" :
( WinMethod == UseLookForWinner ) ? "look for winner" :
"invalid method" );
return 0;
} /*main*/

View File

@ -0,0 +1,4 @@
ntvdm -e:include=c:\include,path=c:\bin -r:.. ..\bin\cc -DAZTEC86 +F +A %1.c
del ctmp* 1>nul 2>nul
ntvdm -r:.. -e:lib=c:\lib ..\bin\ln %1 c:\lib\m.lib c:\lib\c.lib

View File

@ -0,0 +1,59 @@
Dear Aztec C user:
Here are some changes made to the package since the release doc was
printed. They are divided into two sections 3.40a and 3.40b.
Version 3.40a:
C driver: the -n option for the linker should be -N. This is a doc
error.
Linker: the CLIB environment variable may now be a list of path
prefixes, separated by semicolons or spaces.
When using the -l option and the CLIB environment variable, the linker
will NOT search the current directory unless explicitly specified by an empty
prefix.
For example:
CLIB=/path1/;/path2/; will search path1 first, then path2,
then the current directory.
CLIB=;/path1/;;/path2/ will cause a search of the current
directory, then path1, then the current directory
again, then path2.
New linker search algorithm. The linker will now search for your object
file in 3 different ways. 1) it will take the name you give and search the
current directory. if not found then 2) it will append .o (if no extension was
given) and search again. If still not found, then 3) it will take the name,
append .o if none given, and search the path given in the CLIB variable. If
still not found then an error message is given and the linker will quit.
Stksiz.c: stksiz.c has been changed to add a variable that is used by
the stack overflow checking logic. If you are using stksiz.c, you will need to
use the version supplied in this release and make any changes required for your
own use.
Differences between v3.40A and v3.40B:
v3.40B contains some fixes to the libraries, utilities, and the linker.
These changes do NOT affect the documentation in any way.
NOTE: The sign-on messages which contain the version of the compiler,
assembler, linker, and utilities, are changed ONLY when the software changes.
(For example, in version 3.40B the linker will sign on as 3.40B while the
compiler and assembler will sign on as 3.40A.)
They changes are as follows:
1) gchar is no longer multiply defined when scanf and fscanf are
used together.
2) cswit is no longer undefined when linking with third-party libraries.
3) malloc now works properly in large data programs.
4) obj -s and -u command now works correctly.
5) obj now ignores sdb info (no need to use -n upon compilation)
6) ord now works with large code files.
7) hex86 options -j and -e can now be used together.
We hope you enjoy using the MANX Aztec C system. Please read the release
doc as it contains a lot of useful information. Any problems with our software
can be reported via our tech line from 9am-6pm EST or by mail. The phone number
and address as well as some info to have handy can be found towards the end of
the release doc.

View File

@ -0,0 +1,5 @@
Dear Aztec C86 user,
Sdb has been modified. The new crc is 2c7a. Please ignore the one in the
crclist.
Thank you.
.

View File

@ -0,0 +1,136 @@
Copyright (c) 1985-1997 Jim Lopushinsky
email: jimlop@ix.netcom.com
This is my original documentation:
Dec 10, 1985
Jim Lopushinsky
CPM.EXE allows execution of CP/M-86 .CMD files under MS-DOS and PC-DOS.
A>CPM <cpm-86 file name> <paramaters>
To run CP/M-80 .COM files, run the Z80 emulator under the CPM emulator:
A>CPM Z80 <cpm-80 file name> <paramaters>
Don't try running any funny CP/M stuff that calls the BIOS disk I/O
functions directly. It won't work. Other than that, virtually any
CP/M-86 .CMD program will be successfully executed. Note that programs
which make use of MP/M or Concurrent extended functions will not work.
All functions except one are totally machine independent, and should
run on any hardware configuration of MS-DOS version 3.0 or greater.
The only exception: There is no DOS function call for printer status,
and the CP/M printer status request is translated to INT 17H. This
should work fine on any PC or PC Clone.
Nov 30/97:
ANSI.SYS is required if you plan to run .CMD files that use IBM CP/M-86
version 1.1 or newer (or CCPM, CDOS etc) escape sequences. The following
CP/M escape sequences are converted to ANSI escape sequences:
ESC A cursor up
ESC B cursor down
ESC C cursor forward
ESC D cursor back
ESC E clear screen and cursor home
ESC H cursor home
ESC K clear to end of line from cursor position
ESC Y set cursor position
ESC : program function key
ESC a set video mode
ESC b set forground color
ESC c set background color
ESC j save cursor position
ESC k restore cursor position
ESC m cursor on
ESC n cursor off
ESC p reverse video on
ESC q reverse video off
ESC r intensity on
ESC s blink on
ESC t blink off
ESC u intensity off
WordStar key translations are preformed based on an IBM compatible keyboard
as follows:
ALT-X ^KX Save and exit
Up Arrow ^E Cursor up
Down Arrow ^X Cursor down
Left Arrow ^S Cursor left
Right Arrow ^D Cursor right
Page Up ^R Scroll screen up
Page Down ^C Scroll screen down
Insert ^V Toggle insert mode
Delete ^G Delete character at cursor
Home ^QS Beginning of line
End ^QD End of line
Ctrl-Page Down ^QC End of document
Ctrl-Page Up ^QR Beginning of document
------------------------------
Configuration options:
You will need a hex editor to change configuration. Search for the
string "USER OPTIONS" in CPM.EXE. Currently, the following options
can be changed:
BDOS call frequencies.
Offset 655 hex. 0 = no frequencies, 1 = tabulate CP/M BDOS call
frequencies. Default = off. If this option is set, after any CP/M-86
CMD file terminates, run CPMFREQ.EXE and examine CPMFREQ.TXT.
CPMFREQ.EXE requires CPM.TXT and CPMFREQ.DAT. CPMFREQ.DAT is produced
by the CP/M emulator.
WordStar key translation.
Offset 685 hex. 0 = no translation, 1 = translate to WS key sequences.
Default = on.
IBM-PC CP/M-86 screen escape sequences.
Offset 6B5 hex. 0 = no translation, 1 = translate CP/M-86 screen codes
to ANSI. Default = on. ANSI.SYS required if enabled.
BDOS version.
Offset 6E5 hex. This is a BCD value for the BDOS version that CP/M
function 12 returns. Default value = 31 hex. Change to 22 hex for
CP/M-86.
CP/M compatibility.
Offset 715 hex. 0 = CP/M compatible, 1 = CCP/M, CDOS compatible.
Default = 0 (CP/M compatible). This changes how BDOS functions 31
(get_DBP) and 53 (mc_max) operate:
CP/M compatible: Function 31 (get DBP) returns SPT (sectors per
track) as the number of logical 128 byte sectors.
Function 53 (get max memory) does not allocate
the memory.
CCP/M compatible: Function 31 (get DBP) returns SPT as the number
of physical sectors.
Function 53 (get max memory) allocates the memory.
-------------------------------
Revision history:
12/10/85 Initial version
10/06/96 1.1 Added option to record frequency of CP/M BDOS calls.
11/03/97 1.2 Implemented segment relocation fixups. Now DRC.CMD works.
11/30/97 1.3 Implemented Wordstar key translation for IBM keyboard.
Implemented CP/M-86 for IBM-PC screen escape sequences.
Translates to ANSI. ANSI.SYS required.

Binary file not shown.

View File

@ -0,0 +1,256 @@
0 System Reset
1 Console Input
2 Console Output
3 Auxillary Input
4 Auxillary Output
5 List Output
6 Direct Console I/O
7 Auxillary Input Status
8 Auxillary Output Status
9 Print String
10 Read Console Buffer
11 Get Console Status
12 Return Version Number
13 Reset Disk System
14 Select Disk
15 Open File
16 Close File
17 Search for First
18 Search for Next
19 Delete File
20 Read Sequential
21 Write Sequential
22 Make File
23 Rename File
24 Return Login Vector
25 Return Current Disk
26 Set DMA Address
27 Get Addr (Alloc)
28 Write Protect Disk
29 Get R/O Vector
30 Set File Attributes
31 Get Addr (DBP)
32 Set/Get User Code
33 Read Random
34 Write Random
35 Compute File Size
36 Set Random Record
37 Reset Drive
38 Access Drive
39 Free Drive
40 Write Random w/Zero Fill
41 Test and Write Record
42 Lock Record
43 Unlock Record
44 Set Multi-sector Cnt
45 Set BDOS Error Mode
46 Get Disk Free Space
47 Chain to Program
48 Flush Buffers
49 Get/Set SCB
50 Direct Bios Calls
51 Set DMA Segment
52 Return Addr DMA
53 Allocate Max Memory
54 Max Allocate Specific Memory
55 Allocate Memory Segment
56 Allocate Specific Memory
57 Free Specified Mem Segment
58 Free All Memory
59 Load Overlay
60 Call RSX
61
62
63
64 Login
65 Logoff
66 Send Message
67 Receive Message
68 Get Network Status
69 Get Config Table Addr
70
71
72
73
74
75
76
77
78
79
80
81
82
83 Get System Time
84 Set System Time
85 Get System Date
86 Set System Date
87 Allocate system Flag
88 Free system Flag
89 Allocate SYSDAT Buffer
90 Lock physical Drive
91 Unlock physical Drive
92 Scan Path for Exec File
93 Load and Execute Command
94 Get/Set Process Exit Code
95 Set Country Code
96 Return Country Info
97
98 Free Blocks
99 Truncate File
100 Set Directory Label
101 Return Dir Label Data
102 Read File Date Stamps
103 Write File XFCB
104 Set Date and Time
105 Get Date and Time
106 Set Default Password
107 Return Serial Number
108 Get/Set Return Code
109 Get/Set Console Mode
110 Get/Set Output Delim
111 Print Block
112 List Block
113 MSDOS File Functions
114
115
116 Set File Time/Date Stamps
117
118
119
120
121
122
123
124
125
126
127
128 Allocate Memory Segment
129 Allocate Memory Segment
130 Free Memory Segment
131 Poll a Device
132 Wait for a system Flag
133 Set a system Flag
134 Make Queue
135 Open Queue
136 Delete Queue
137 Queue Read
138 Cond Queue Read
139 Queue Write
140 Cond Queue Write
141 Delay Specified Ticks
142 Call Dispatcher
143 Terminate Calling Process
144 Create a Process
145 Set Priority
146 Attach Console
147 Detach Console
148 Set Default Console
149 Assign Console to Process
150 Execute Command Line
151 Resident Procedure Library
152 Parse Filename
153 Return Def Console
154 Return Addr SysDat Segment
155 Get System Time and Day
156 Return Addr Process Descriptor
157 Terminate Process
158 Attach Def List Device
159 Detach Def List Device
160 Set Default List Device
161 Cond Attach Def List Device
162 Cond Attach Def Console
163 Return OS Release/Version
164 Return Default List Device
165 Attach Default Aux Device
166 Detach Aux Device
167 Cond Attach Def Aux Device
168 Set Default Aux Device
169 Return Default Aux Device
170
171
172 Block Read Aux Device
173 Block Write Aux Device
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255

Binary file not shown.

View File

@ -0,0 +1,12 @@
A CP/M-86 and CP/M-80 emulator for MS-DOS.
All normall CP/M-86 stuff should run including
CMD files with overlays. Use CPM <cmd file>
<paramaters>. If the .CMD file is not found in
the current directory, the DOS path will be
searched. For CP/M-80, run the Z80 emulator
under the CP/M-86 emulator:
CPM Z80 <cp/m-80 com file> <paramaters>.
All CP/M-80 .COM files must be renamed to
.CPM. Z80.CMD will also run under a vanilla
CP/M-86, Concurrent DOS, or other system that
can execute .CMD files.

View File

@ -0,0 +1,176 @@
.z80
;QTERM overlay for IBM PC compatible running Jim Lopushinsky's
;CP/M-80 emulator. Note: this may even work in MYZ80, altho
;I haven't tried it.
aseg
basep equ 0 ;base of 8250
datap equ basep ;data input/output register
inte equ basep+1 ;interrupt enable register
intid equ basep+2 ;interrupt id register
linec equ basep+3 ;line control register
modemc equ basep+4 ;modem control register
linest equ basep+5 ;line status register
modemst equ basep+6 ;modem status register
divl equ basep ;divisor low register
divh equ basep+1 ;divisor high register
printc equ 109h ;print character in C
;modem input status routine
org 110h
in a,(linest)
and 1
ret
;read modem character
org 120h
in a,(datap)
ret
;modem output status
org 130h
in a,(linest)
and 20h
ret
;write modem character
org 140h
out (datap),a
ret
;start break
org 150h
in a,(linec)
or 40h
out (linec),a
ret
;end break
org 160h
in a,(linec)
and 0bfh
out (linec),a
ret
;drop dtr
org 170h
ld a,2
out (modemc),a
ret
;restore dtr
org 180h
ld a,3
out (modemc),a
ret
;set baud rate
org 190h
ld c,linec
in e,(c)
set 7,e
out (c),e
out (divl),a
res 7,e
out (c),e
ret
;baud rate table
org 1a0h
db 3,0ffh ;38400
db 6,0ffh ;19200
db 12,0ffh ;9600
db 24,0ffh ;4800
db 48,0ffh ;2400
db 96,0ffh ;1200
db 192,0ffh ;600
db 0,0 ;300 - not available
;set communications mode
org 1b0h
out (linec),a
ret
;communication mode table
org 1c0h
db 22h ;7n1
db 23h ;8n1
db 26h ;7n2
db 27h ;8n2
db 1ah ;7e1
db 1bh ;8e1
db 1eh ;7e2
db 1fh ;8e2
db 0ah ;7o1
db 0bh ;8o1
db 0eh ;7o2
db 0fh ;8o2
db 0 ;reserved
db 8 ;protocol transfer size
db 3 ;processor speed
db 27 ;escape character
;signon message
org 1d0h
db 'Z80 emulator - IBM PC',0
;clear screen string
org 1f0h
db 27,'E',0
;cursor position
org 200h
push hl
ld c,27
call printc
ld c,'Y'
call printc
pop hl
ld a,h
push hl
add a,20h
ld c,a
call printc
pop hl
ld a,l
add a,20h
ld c,a
jp printc
;terminal capability bitmap
org 22fh
db 43h ;end highlight, start highlight, clear to eol
;terminal capability strings
db 27,'q',0 ;end reverse video
org 238h
db 27,'p',0 ;start reverse video
org 260h
db 27,'K',0 ;clear to end of line
;entry subroutine
org 270h
ret
;exit subroutine
org 273h
ret
;user subroutine
org 276h
ret
;keyboard mapping
org 279h
ret
end

Binary file not shown.

View File

@ -0,0 +1,45 @@
Copyright (c) 1985-1997 Jim Lopushinsky
email: jimlop@ix.netcom.com
This is my original documentation:
Dec 10, 1985
Jim Lopushinsky
Z80.CMD allows execution of CP/M-80 .COM files under CP/M-86 and CPCDOS.
CP/M-80 .COM files must be renamed to .CPM files. That is, NSWP.COM is
renamed to NSWP.CPM.
A>Z80 <cpm-80 file name> <paramaters>
Don't try running any funny CP/M stuff that calls the BIOS disk I/O
functions directly. It won't work. Other than that, virtually any
CP/M-80 program will be successfully executed. Note that programs
which make use of MP/M or Concurrent extended functions will not work.
Z80 emulates the entire Z80 instruction set, and builds the CP/M-80
environment. The execution speed on a 5 MHZ 8088 is about 1/8 the
true execution speed on a 4 MHZ Z80.
Nov 30, 1997:
Z80F.CMD is a version assembled with the freq flag set on (see below).
11/20/85 Initial version
09/08/96 1.1 Added option to record frequency of Z80 instructions.
Use Z80F.CMD and after any CP/M-80 .CPM file terminates,
run Z80FREQ.EXE and examine Z80FREQ.TXT. Z80FREQ.EXE
requires Z80.TXT, Z80CB.TXT, Z80ED.TXT, Z80XD.TXT,
Z80XDCB.TXT and Z80FREQ.DAT. Z80FREQ.DAT is produced
by the Z80 emulator.
11/30/97 1.3 IN and OUT instructions are rerouted to COM 1 with a zero base.
To change to a different COM port, you need a hex editor.
Edit Z80.CMD (or Z80F.CMD) and change the value at offset
E1 hex. Valid values are ASCII 1, 2, 3 or 4.
A QTERM overlay is included (QTIBM.MAC). See the instructions
supplied with QTERM for implemetation.

View File

@ -0,0 +1,256 @@
00 NOP
01 LD BC,nnnn
02 LD (BC),A
03 INC BC
04 INC B
05 DEC B
06 LD B,nn
07 RLCA
08 EX AF,AF'
09 ADD HL,BC
0A LD A,(BC)
0B DEC BC
0C INC C
0D DEC C
0E LD C,nn
0F RRCA
10 DJNZ dd
11 LD DE,nnnn
12 LD DE,A
13 INC DE
14 INC D
15 DEC D
16 LD D,nn
17 RLA
18 JR dd
19 ADD HL,DE
1A LD A,DE
1B DEC DE
1C INC E
1D DEC E
1E LD E,nn
1F RRA
20 JR NZ,dd
21 LD HL,nnnn
22 LD (nnnn),HL
23 INC HL
24 INC H
25 DEC H
26 LD H,nn
27 DAA
28 JR Z,dd
29 ADD HL,HL
2A LD HL,(nnnn)
2B DEC HL
2C INC L
2D DEC L
2E LD L,nn
2F CPL
30 JR NC,dd
31 LD SP,nnnn
32 LD (nnnn),A
33 INC SP
34 INC (HL)
35 DEC (HL)
36 LD (HL),nn
37 SCF
38 JR C,dd
39 ADD HL,SP
3A LD A,(nnnn)
3B DEC SP
3C INC A
3D DEC A
3E LD A,nn
3F CCF
40 LD B,B
41 LD B,C
42 LD B,D
43 LD B,E
44 LD B,H
45 LD B,L
46 LD B,(HL)
47 LD B,A
48 LD C,B
49 LD C,C
4A LD C,D
4B LD C,E
4C LD C,H
4D LD C,L
4E LD C,(HL)
4F LD C,A
50 LD D,B
51 LD D,C
52 LD D,D
53 LD D,E
54 LD D,H
55 LD D,L
56 LD D,(HL)
57 LD D,A
58 LD E,B
59 LD E,C
5A LD E,D
5B LD E,E
5C LD E,H
5D LD E,L
5E LD E,(HL)
5F LD E,A
60 LD H,B
61 LD H,C
62 LD H,D
63 LD H,E
64 LD H,H
65 LD H,L
66 LD H,(HL)
67 LD H,A
68 LD L,B
69 LD L,C
6A LD L,D
6B LD L,E
6C LD L,H
6D LD L,L
6E LD L,(HL)
6F LD L,A
70 LD (HL),B
71 LD (HL),C
72 LD (HL),D
73 LD (HL),E
74 LD (HL),H
75 LD (HL),L
76 HALT
77 LD (HL),A
78 LD A,B
79 LD A,C
7A LD A,D
7B LD A,E
7C LD A,H
7D LD A,L
7E LD A,(HL)
7F LD A,A
80 ADD A,B
81 ADD A,C
82 ADD A,D
83 ADD A,E
84 ADD A,H
85 ADD A,L
86 ADD A,(HL)
87 ADD A,A
88 ADC A,B
89 ADC A,C
8A ADC A,D
8B ADC A,E
8C ADC A,H
8D ADC A,L
8E ADC A,(HL)
8F ADC A,A
90 SUB B
91 SUB C
92 SUB D
93 SUB E
94 SUB H
95 SUB L
96 SUB (HL)
97 SUB A
98 SBC A,B
99 SBC A,C
9A SBC A,D
9B SBC A,E
9C SBC A,H
9D SBC A,L
9E SBC A,(HL)
9F SBC A,A
A0 AND B
A1 AND C
A2 AND D
A3 AND E
A4 AND H
A5 AND L
A6 AND (HL)
A7 AND A
A8 XOR B
A9 XOR C
AA XOR D
AB XOR E
AC XOR H
AD XOR L
AE XOR (HL)
AF XOR A
B0 OR B
B1 OR C
B2 OR D
B3 OR E
B4 OR H
B5 OR L
B6 OR (HL)
B7 OR A
B8 CP B
B9 CP C
BA CP D
BB CP E
BC CP H
BD CP L
BE CP (HL)
BF CP A
C0 RET NZ
C1 POP BC
C2 JP NZ,nnnn
C3 JP nnnn
C4 CALL NZ,nnnn
C5 PUSH BC
C6 ADD A,nn
C7 RST 0
C8 RET Z
C9 RET
CA JP Z,nnnn
CB
CC CALL Z,nnnn
CD CALL nnnn
CE ADC A,nn
CF RST 8
D0 RET NC
D1 POP DE
D2 JP NC,nnnn
D3 OUT (nn),A
D4 CALL NC,nnnn
D5 PUSH DE
D6 SUB nn
D7 RST 10H
D8 RET C
D9 EXX
DA JP C,nnnn
DB IN A,(nn)
DC CALL C,nnnn
DD
DE SBC A,nn
DF RST 18H
E0 RET PO
E1 POP HL
E2 JP PO,nnnn
E3 EX (SP),HL
E4 CALL PO,nnnn
E5 PUSH HL
E6 AND nn
E7 RST 20H
E8 RET PE
E9 JP (HL)
EA JP PE,nnnn
EB EX DE,HL
EC CALL PE,nnnn
ED
EE XOR nn
EF RST 28H
F0 RET P
F1 POP AF
F2 JP P,nnnn
F3 DI
F4 CALL P,nnnn
F5 PUSH AF
F6 OR nn
F7 RST 30H
F8 RET M
F9 LD SP,HL
FA JP M,nnnn
FB EI
FC CALL M,nnnn
FD
FE CP nn
FF RST 38H

View File

@ -0,0 +1,256 @@
00 RLC B
01 RLC C
02 RLC D
03 RLC E
04 RLC H
05 RLC L
06 RLC (HL)
07 RLC A
08 RRC B
09 RRC C
0A RRC D
0B RRC E
0C RRC H
0D RRC L
0E RRC (HL)
0F RRC A
10 RL B
11 RL C
12 RL D
13 RL E
14 RL H
15 RL L
16 RL (HL)
17 RL A
18 RR B
19 RR C
1A RR D
1B RR E
1C RR H
1D RR L
1E RR (HL)
1F RR A
20 SLA B
21 SLA C
22 SLA D
23 SLA E
24 SLA H
25 SLA L
26 SLA (HL)
27 SLA A
28 SRA B
29 SRA C
2A SRA D
2B SRA E
2C SRA H
2D SRA L
2E SRA (HL)
2F SRA A
30 SLIA B
31 SLIA C
32 SLIA D
33 SLIA E
34 SLIA H
35 SLIA L
36 SLIA (HL)
37 SLIA A
38 SRL B
39 SRL C
3A SRL D
3B SRL E
3C SRL H
3D SRL L
3E SRL (HL)
3F SRL A
40 BIT 0,B
41 BIT 0,C
42 BIT 0,D
43 BIT 0,E
44 BIT 0,H
45 BIT 0,L
46 BIT 0,(HL)
47 BIT 0,A
48 BIT 1,B
49 BIT 1,C
4A BIT 1,D
4B BIT 1,E
4C BIT 1,H
4D BIT 1,L
4E BIT 1,(HL)
4F BIT 1,A
50 BIT 2,B
51 BIT 2,C
52 BIT 2,D
53 BIT 2,E
54 BIT 2,H
55 BIT 2,L
56 BIT 2,(HL)
57 BIT 2,A
58 BIT 3,B
59 BIT 3,C
5A BIT 3,D
5B BIT 3,E
5C BIT 3,H
5D BIT 3,L
5E BIT 3,(HL)
5F BIT 3,A
60 BIT 4,B
61 BIT 4,C
62 BIT 4,D
63 BIT 4,E
64 BIT 4,H
65 BIT 4,L
66 BIT 4,(HL)
67 BIT 4,A
68 BIT 5,B
69 BIT 5,C
6A BIT 5,D
6B BIT 5,E
6C BIT 5,H
6D BIT 5,L
6E BIT 5,(HL)
6F BIT 5,A
70 BIT 6,B
71 BIT 6,C
72 BIT 6,D
73 BIT 6,E
74 BIT 6,H
75 BIT 6,L
76 BIT 6,(HL)
77 BIT 6,A
78 BIT 7,B
79 BIT 7,C
7A BIT 7,D
7B BIT 7,E
7C BIT 7,H
7D BIT 7,L
7E BIT 7,(HL)
7F BIT 7,A
80 RES 0,B
81 RES 0,C
82 RES 0,D
83 RES 0,E
84 RES 0,H
85 RES 0,L
86 RES 0,(HL)
87 RES 0,A
88 RES 1,B
89 RES 1,C
8A RES 1,D
8B RES 1,E
8C RES 1,H
8D RES 1,L
8E RES 1,(HL)
8F RES 1,A
90 RES 2,B
91 RES 2,C
92 RES 2,D
93 RES 2,E
94 RES 2,H
95 RES 2,L
96 RES 2,(HL)
97 RES 2,A
98 RES 3,B
99 RES 3,C
9A RES 3,D
9B RES 3,E
9C RES 3,H
9D RES 3,L
9E RES 3,(HL)
9F RES 3,A
A0 RES 4,B
A1 RES 4,C
A2 RES 4,D
A3 RES 4,E
A4 RES 4,H
A5 RES 4,L
A6 RES 4,(HL)
A7 RES 4,A
A8 RES 5,B
A9 RES 5,C
AA RES 5,D
AB RES 5,E
AC RES 5,H
AD RES 5,L
AE RES 5,(HL)
AF RES 5,A
B0 RES 6,B
B1 RES 6,C
B2 RES 6,D
B3 RES 6,E
B4 RES 6,H
B5 RES 6,L
B6 RES 6,(HL)
B7 RES 6,A
B8 RES 7,B
B9 RES 7,C
BA RES 7,D
BB RES 7,E
BC RES 7,H
BD RES 7,L
BE RES 7,(HL)
BF RES 7,A
C0 SET 0,B
C1 SET 0,C
C2 SET 0,D
C3 SET 0,E
C4 SET 0,H
C5 SET 0,L
C6 SET 0,(HL)
C7 SET 0,A
C8 SET 1,B
C9 SET 1,C
CA SET 1,D
CB SET 1,E
CC SET 1,H
CD SET 1,L
CE SET 1,(HL)
CF SET 1,A
D0 SET 2,B
D1 SET 2,C
D2 SET 2,D
D3 SET 2,E
D4 SET 2,H
D5 SET 2,L
D6 SET 2,(HL)
D7 SET 2,A
D8 SET 3,B
D9 SET 3,C
DA SET 3,D
DB SET 3,E
DC SET 3,H
DD SET 3,L
DE SET 3,(HL)
DF SET 3,A
E0 SET 4,B
E1 SET 4,C
E2 SET 4,D
E3 SET 4,E
E4 SET 4,H
E5 SET 4,L
E6 SET 4,(HL)
E7 SET 4,A
E8 SET 5,B
E9 SET 5,C
EA SET 5,D
EB SET 5,E
EC SET 5,H
ED SET 5,L
EE SET 5,(HL)
EF SET 5,A
F0 SET 6,B
F1 SET 6,C
F2 SET 6,D
F3 SET 6,E
F4 SET 6,H
F5 SET 6,L
F6 SET 6,(HL)
F7 SET 6,A
F8 SET 7,B
F9 SET 7,C
FA SET 7,D
FB SET 7,E
FC SET 7,H
FD SET 7,L
FE SET 7,(HL)
FF SET 7,A

View File

@ -0,0 +1,256 @@
00 IN0 B,(nn)
01 OUT0 (nn),B
02
03
04 TST B
05
06
07
08 IN0 C,(nn)
09 OUT0 (nn),C
0A
0B
0C TST C
0D
0E
0F
10 IN0 D,(nn)
11 OUT0 (nn),D
12
13
14 TST D
15
16
17
18 IN0 E,(nn)
19 OUT0 (nn),E
1A
1B
1C TST E
1D
1E
1F
20 IN0 H,(nn)
21 OUT0 (nn),H
22
23
24 TST H
25
26
27
28 IN0 L,(nn)
29 OUT0 (nn),L
2A
2B
2C TST L
2D
2E
2F
30 IN0 (nn)
31
32
33
34 TST (HL)
35
36
37
38 IN0 A,(nn)
39 OUT0 (nn),A
3A
3B
3C TST A
3D
3E
3F
40 IN B,(C)
41 OUT (C),B
42 SBC HL,BC
43 LD (nnnn),BC
44 NEG
45 RETN
46 IM 0
47 LD I,A
48 IN C,(C)
49 OUT (C),C
4A ADC HL,BC
4B LD BC,(nnnn)
4C MULT BC
4D RETI
4E
4F LD R,A
50 IN D,(C)
51 OUT (C),D
52 SBC HL,DE
53 LD (nnnn),DE
54
55
56 IM 1
57 LD A,I
58 IN E,(C)
59 OUT (C),E
5A ADC HL,DE
5B LD DE,(nnnn)
5C MULT DE
5D
5E IM 2
5F LD A,R
60 IN H,(C)
61 OUT (C),H
62 SBC HL,HL
63 LD (nnnn),HL
64 TST nn
65
66
67 RRD
68 IN L,(C)
69 OUT (C),L
6A ADC HL,HL
6B LD HL,(nnnn)
6C MULT HL
6D
6E
6F RLD
70 IN (C)
71 OUT (C),0
72 SBC HL,SP
73 LD (nnnn),SP
74 TSTIO nn
75
76 SLP
77
78 IN A,(C)
79 OUT (C),A
7A ADC HL,SP
7B LD SP,(nnnn)
7C MULT SP
7D
7E
7F
80
81
82
83 OTIM
84
85
86
87
88
89
8A
8B OTDM
8C
8D
8E
8F
90
91
92
93 OTIMR
94
95
96
97
98
99
9A
9B OTDMR
9C
9D
9E
9F
A0 LDI
A1 CPI
A2 INI
A3 OUTI
A4
A5
A6
A7
A8 LDD
A9 CPD
AA IND
AB OUTD
AC
AD
AE
AF
B0 LDIR
B1 CPIR
B2 INIR
B3 OTIR
B4
B5
B6
B7
B8 LDDR
B9 CPDR
BA INDR
BB OTDR
BC
BD
BE
BF
C0
C1
C2
C3
C4
C5
C6
C7
C8
C9
CA
CB
CC
CD
CE
CF
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
DA
DB
DC
DD
DE
DF
E0
E1
E2
E3
E4
E5
E6
E7
E8
E9
EA
EB
EC
ED
EE
EF
F0
F1
F2
F3
F4
F5
F6
F7
F8
F9
FA
FB
FC
FD
FE
FF

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,256 @@
00
01
02
03
04
05
06
07
08
09 ADD IX,BC
0A
0B
0C
0D
0E
0F
10
11
12
13
14
15
16
17
18
19 ADD IX,DE
1A
1B
1C
1D
1E
1F
20
21 LD IX,nnnn
22 LD (nnnn),IX
23 INC IX
24 INC HX
25 DEC HX
26 LD HX,nn
27
28
29 ADD IX,IX
2A LD IX,(nnnn)
2B DEC IX
2C INC LX
2D DEC LX
2E LD LX,nn
2F
30
31
32
33
34 INC (IX+dd)
35 DEC (IX+dd)
36 LD (IX+dd),nn
37
38
39 ADD IX,SP
3A
3B
3C
3D
3E
3F
40
41
42
43
44 LD B,HX
45 LD B,LX
46 LD B,(IX+dd)
47
48
49
4A
4B
4C LD C,HX
4D LD C,LX
4E LD C,(IX+dd)
4F
50
51
52
53
54 LD D,HX
55 LD D,LX
56 LD D,(IX+dd)
57
58
59
5A
5B
5C LD E,H
5D LD E,L
5E LD E,(IX+dd)
5F
60 LD HX,B
61 LD HX,C
62 LD HX,D
63 LD HX,E
64 LD HX,HX
65 LD HX,LX
66 LD H,(IX+dd)
67 LD HX,A
68 LD LX,B
69 LD LX,C
6A LD LX,D
6B LD LX,E
6C LD LX,HX
6D LD LX,LX
6E LD L,(IX+dd)
6F LD LX,A
70 LD (IX+dd),B
71 LD (IX+dd),C
72 LD (IX+dd),D
73 LD (IX+dd),E
74 LD (IX+dd),H
75 LD (IX+dd),L
76
77 LD (IX+dd),A
78
79
7A
7B
7C LD A,HX
7D LD A,LX
7E LD A,(IX+dd)
7F
80
81
82
83
84 ADD A,HX
85 ADD A,LX
86 ADD A,(IX)
87
88
89
8A
8B
8C ADC A,HX
8D ADC A,LX
8E ADC A,(IX)
8F
90
91
92
93
94 SUB HX
95 SUB LX
96 SUB (IX+dd)
97
98
99
9A
9B
9C SBC A,HX
9D SBC A,LX
9E SBC A,(IX+dd)
9F
A0
A1
A2
A3
A4 AND HX
A5 AND LX
A6 AND (IX+dd)
A7
A8
A9
AA
AB
AC XOR HX
AD XOR LX
AE XOR (IX+dd)
AF
B0
B1
B2
B3
B4 OR HX
B5 OR LX
B6 OR (IX+dd)
B7
B8
B9
BA
BB
BC CP HX
BD CP LX
BE CP (IX+dd)
BF
C0
C1
C2
C3
C4
C5
C6
C7
C8
C9
CA
CB
CC
CD
CE
CF
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
DA
DB
DC
DD
DE
DF
E0
E1 POP IX
E2
E3 EX (SP),IX
D4
E5 PUSH IX
E6
E7
E8
E9 JP (IX)
EA
EB
EC
ED
EE
EF
F0
F1
F2
F3
F4
F5
F6
F7
F8
F9 LD SP,IX
FA
FB
FC
FD
FE
FF

View File

@ -0,0 +1,256 @@
00 RLC (IX+dd)->B
01 RLC (IX+dd)->C
02 RLC (IX+dd)->D
03 RLC (IX+dd)->E
04 RLC (IX+dd)->H
05 RLC (IX+dd)->L
06 RLC (IX+dd)
07 RLC (IX+dd)->A
08 RRC (IX+dd)->B
09 RRC (IX+dd)->C
0A RRC (IX+dd)->D
0B RRC (IX+dd)->E
0C RRC (IX+dd)->H
0D RRC (IX+dd)->L
0E RRC (IX+dd)
0F RRC (IX+dd)->A
10 RL (IX+dd)->B
11 RL (IX+dd)->C
12 RL (IX+dd)->D
13 RL (IX+dd)->E
14 RL (IX+dd)->H
15 RL (IX+dd)->L
16 RL (IX+dd)
17 RL (IX+dd)->A
18 RR (IX+dd)->B
19 RR (IX+dd)->C
1A RR (IX+dd)->D
1B RR (IX+dd)->E
1C RR (IX+dd)->H
1D RR (IX+dd)->L
1E RR (IX+dd)
1F RR (IX+dd)->A
20 SLA (IX+dd)->B
21 SLA (IX+dd)->C
22 SLA (IX+dd)->D
23 SLA (IX+dd)->E
24 SLA (IX+dd)->H
25 SLA (IX+dd)->L
26 SLA (IX+dd)
27 SLA (IX+dd)->A
28 SRA (IX+dd)->B
29 SRA (IX+dd)->C
2A SRA (IX+dd)->D
2B SRA (IX+dd)->E
2C SRA (IX+dd)->H
2D SRA (IX+dd)->L
2E SRA (IX+dd)
2F SRA (IX+dd)->A
30 SLIA (IX+dd)->B
31 SLIA (IX+dd)->C
32 SLIA (IX+dd)->D
33 SLIA (IX+dd)->E
34 SLIA (IX+dd)->H
35 SLIA (IX+dd)->L
36 SLIA (IX+dd)
37 SLIA (IX+dd)->A
38 SRL (IX+dd)->B
39 SRL (IX+dd)->C
3A SRL (IX+dd)->D
3B SRL (IX+dd)->E
3C SRL (IX+dd)->H
3D SRL (IX+dd)->L
3E SRL (IX+dd)
3F SRL (IX+dd)->A
40 BIT 0,(IX+dd)
41 BIT 0,(IX+dd)
42 BIT 0,(IX+dd)
43 BIT 0,(IX+dd)
44 BIT 0,(IX+dd)
45 BIT 0,(IX+dd)
46 BIT 0,(IX+dd)
47 BIT 0,(IX+dd)
48 BIT 1,(IX+dd)
49 BIT 1,(IX+dd)
4A BIT 1,(IX+dd)
4B BIT 1,(IX+dd)
4C BIT 1,(IX+dd)
4D BIT 1,(IX+dd)
4E BIT 1,(IX+dd)
4F BIT 1,(IX+dd)
50 BIT 2,(IX+dd)
51 BIT 2,(IX+dd)
52 BIT 2,(IX+dd)
53 BIT 2,(IX+dd)
54 BIT 2,(IX+dd)
55 BIT 2,(IX+dd)
56 BIT 2,(IX+dd)
57 BIT 2,(IX+dd)
58 BIT 3,(IX+dd)
59 BIT 3,(IX+dd)
5A BIT 3,(IX+dd)
5B BIT 3,(IX+dd)
5C BIT 3,(IX+dd)
5D BIT 3,(IX+dd)
5E BIT 3,(IX+dd)
5F BIT 3,(IX+dd)
60 BIT 4,(IX+dd)
61 BIT 4,(IX+dd)
62 BIT 4,(IX+dd)
63 BIT 4,(IX+dd)
64 BIT 4,(IX+dd)
65 BIT 4,(IX+dd)
66 BIT 4,(IX+dd)
67 BIT 4,(IX+dd)
68 BIT 5,(IX+dd)
69 BIT 5,(IX+dd)
6A BIT 5,(IX+dd)
6B BIT 5,(IX+dd)
6C BIT 5,(IX+dd)
6D BIT 5,(IX+dd)
6E BIT 5,(IX+dd)
6F BIT 5,(IX+dd)
70 BIT 6,(IX+dd)
71 BIT 6,(IX+dd)
72 BIT 6,(IX+dd)
73 BIT 6,(IX+dd)
74 BIT 6,(IX+dd)
75 BIT 6,(IX+dd)
76 BIT 6,(IX+dd)
77 BIT 6,(IX+dd)
78 BIT 7,(IX+dd)
79 BIT 7,(IX+dd)
7A BIT 7,(IX+dd)
7B BIT 7,(IX+dd)
7C BIT 7,(IX+dd)
7D BIT 7,(IX+dd)
7E BIT 7,(IX+dd)
7F BIT 7,(IX+dd)
80 RES 0,(IX+dd)->B
81 RES 0,(IX+dd)->C
82 RES 0,(IX+dd)->D
83 RES 0,(IX+dd)->E
84 RES 0,(IX+dd)->H
85 RES 0,(IX+dd)->L
86 RES 0,(IX+dd)
87 RES 0,(IX+dd)->A
88 RES 1,(IX+dd)->B
89 RES 1,(IX+dd)->C
8A RES 1,(IX+dd)->D
8B RES 1,(IX+dd)->E
8C RES 1,(IX+dd)->H
8D RES 1,(IX+dd)->L
8E RES 1,(IX+dd)
8F RES 1,(IX+dd)->A
90 RES 2,(IX+dd)->B
91 RES 2,(IX+dd)->C
92 RES 2,(IX+dd)->D
93 RES 2,(IX+dd)->E
94 RES 2,(IX+dd)->H
95 RES 2,(IX+dd)->L
96 RES 2,(IX+dd)
97 RES 2,(IX+dd)->A
98 RES 3,(IX+dd)->B
99 RES 3,(IX+dd)->C
9A RES 3,(IX+dd)->D
9B RES 3,(IX+dd)->E
9C RES 3,(IX+dd)->H
9D RES 3,(IX+dd)->L
9E RES 3,(IX+dd)
9F RES 3,(IX+dd)->A
A0 RES 4,(IX+dd)->B
A1 RES 4,(IX+dd)->C
A2 RES 4,(IX+dd)->D
A3 RES 4,(IX+dd)->E
A4 RES 4,(IX+dd)->H
A5 RES 4,(IX+dd)->L
A6 RES 4,(IX+dd)
A7 RES 4,(IX+dd)->A
A8 RES 5,(IX+dd)->B
A9 RES 5,(IX+dd)->C
AA RES 5,(IX+dd)->D
AB RES 5,(IX+dd)->E
AC RES 5,(IX+dd)->H
AD RES 5,(IX+dd)->L
AE RES 5,(IX+dd)
AF RES 5,(IX+dd)->A
B0 RES 6,(IX+dd)->B
B1 RES 6,(IX+dd)->C
B2 RES 6,(IX+dd)->D
B3 RES 6,(IX+dd)->E
B4 RES 6,(IX+dd)->H
B5 RES 6,(IX+dd)->L
B6 RES 6,(IX+dd)
B7 RES 6,(IX+dd)->A
B8 RES 7,(IX+dd)->B
B9 RES 7,(IX+dd)->C
BA RES 7,(IX+dd)->D
BB RES 7,(IX+dd)->E
BC RES 7,(IX+dd)->H
BD RES 7,(IX+dd)->L
BE RES 7,(IX+dd)
BF RES 7,(IX+dd)->A
C0 SET 0,(IX+dd)->B
C1 SET 0,(IX+dd)->C
C2 SET 0,(IX+dd)->D
C3 SET 0,(IX+dd)->E
C4 SET 0,(IX+dd)->H
C5 SET 0,(IX+dd)->L
C6 SET 0,(IX+dd)
C7 SET 0,(IX+dd)->A
C8 SET 1,(IX+dd)->B
C9 SET 1,(IX+dd)->C
CA SET 1,(IX+dd)->D
CB SET 1,(IX+dd)->E
CC SET 1,(IX+dd)->H
CD SET 1,(IX+dd)->L
CE SET 1,(IX+dd)
CF SET 1,(IX+dd)->A
D0 SET 2,(IX+dd)->B
D1 SET 2,(IX+dd)->C
D2 SET 2,(IX+dd)->D
D3 SET 2,(IX+dd)->E
D4 SET 2,(IX+dd)->H
D5 SET 2,(IX+dd)->L
D6 SET 2,(IX+dd)
D7 SET 2,(IX+dd)->A
D8 SET 3,(IX+dd)->B
D9 SET 3,(IX+dd)->C
DA SET 3,(IX+dd)->D
DB SET 3,(IX+dd)->E
DC SET 3,(IX+dd)->H
DD SET 3,(IX+dd)->L
DE SET 3,(IX+dd)
DF SET 3,(IX+dd)->A
E0 SET 4,(IX+dd)->B
E1 SET 4,(IX+dd)->C
E2 SET 4,(IX+dd)->D
E3 SET 4,(IX+dd)->E
E4 SET 4,(IX+dd)->H
E5 SET 4,(IX+dd)->L
E6 SET 4,(IX+dd)
E7 SET 4,(IX+dd)->A
E8 SET 5,(IX+dd)->B
E9 SET 5,(IX+dd)->C
EA SET 5,(IX+dd)->D
EB SET 5,(IX+dd)->E
EC SET 5,(IX+dd)->H
ED SET 5,(IX+dd)->L
EE SET 5,(IX+dd)
EF SET 5,(IX+dd)->A
F0 SET 6,(IX+dd)->B
F1 SET 6,(IX+dd)->C
F2 SET 6,(IX+dd)->D
F3 SET 6,(IX+dd)->E
F4 SET 6,(IX+dd)->H
F5 SET 6,(IX+dd)->L
F6 SET 6,(IX+dd)
F7 SET 6,(IX+dd)->A
F8 SET 7,(IX+dd)->B
F9 SET 7,(IX+dd)->C
FA SET 7,(IX+dd)->D
FB SET 7,(IX+dd)->E
FC SET 7,(IX+dd)->H
FD SET 7,(IX+dd)->L
FE SET 7,(IX+dd)
FF SET 7,(IX+dd)->A

View File

@ -0,0 +1,8 @@
#ifndef NDEBUG
#ifndef stderr
#include <stdio.h>
#endif
#define assert(x) if (!(x)) {fprintf(stderr,"Assertion failed: x, file %s, line %d\n",__FILE__,__LINE__); exit(1);}
#else
#define assert(x)
#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,20 @@
/* Copyright (C) 1984 by Manx Software Systems */
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)

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,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,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,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,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 @@
double sin(), cos(), tan(), cotan();
double asin(), acos(), atan(), atan2();
double ldexp(), frexp(), modf();
double floor(), ceil(), fabs();
double log(), log10(), exp(), sqrt(), pow();
double sinh(), cosh(), tanh();
#define HUGE_VAL 1.79e+308
#define LOGHUGE 709.778
#define TINY_VAL 2.2e-308
#define LOGTINY -708.396

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,4 @@
/* Copyright (C) 1983 by Manx Software Systems */
#define JBUFSIZE (6*sizeof(char *))
typedef char jmp_buf[JBUFSIZE];

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,15 @@
/* Copyright (C) 1985 by Manx Software Systems, Inc. */
#define SIG_DFL ((void (*)())0)
#define SIG_IGN ((void (*)())1)
#define SIG_ERR ((void (*)())-1)
#define SIGINT 1
#define SIGTERM 2
#define SIGABRT 3
#define SIGFPE 4
#define SIGILL 5
#define SIGSEGV 6
#define _NUMSIG 6
#define _FSTSIG 1

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,46 @@
/* Copyright (C) 1982, 1984 by Manx Software Systems */
#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) */
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[];
FILE *fopen(), *freopen();
FILE *fdopen();
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,22 @@
/* Copyright (C) 1984, 1985 by Manx Software Systems */
#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;
};
struct tm *gmtime(), *localtime();
char *asctime(), *ctime();
time_t time();

View File

@ -0,0 +1,55 @@
/* regs.h for aztec.c (C) Copyright Bill Buckels 2008. All rights reserved. */
#ifndef REGS_DEFINED
/* word registers */
/* different than M$oft so don't mix the two */
struct WORDREGS {
unsigned int ax;
unsigned int bx;
unsigned int cx;
unsigned int dx;
unsigned int si;
unsigned int di;
unsigned int ds;
unsigned int es;
};
/* byte registers */
/* I made these the same as M$oft since
the first 6 word regs are the same between the two */
struct BYTEREGS {
unsigned char al, ah;
unsigned char bl, bh;
unsigned char cl, ch;
unsigned char dl, dh;
};
/* general purpose registers union -
* overlays the corresponding word and byte registers.
*/
union REGS {
struct WORDREGS x;
struct BYTEREGS h;
};
/* segment registers */
/* different than M$oft so don't mix the two */
struct SREGS {
unsigned int cs;
unsigned int ss;
unsigned int ds;
unsigned int es;
};
/* the following makes it a little easier
to port code from M$soft and Turbo C
over to Aztec C unless you want to be
an Aztec C purist */
#define int86(x,y,z) sysint(x,y,z)
#define REGS_DEFINED 1
#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.

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.

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