├── ASM ├── 80X86.MIT ├── AR.C ├── AR.EXE ├── ASM.ARC ├── ASM.EXE ├── ASM.H ├── ASM.LIB ├── ASM1.C ├── ASM2.C ├── ASM3.C ├── ASM4.C ├── ASMARC.LST ├── ASMCAL.BAT ├── ASMLIB.LST ├── CALIB.BAT ├── CHKLIST.MS ├── CMIT.C ├── CMIT.EXE ├── DUMP.C ├── DUMP.EXE ├── HISTORY.TXT ├── MANUAL.pdf ├── MIT.H ├── NOTICE.H ├── OBJ1.H ├── OBJ2.H ├── OBJ3.H ├── README.TXT └── STDIO.H ├── C ├── AR.C ├── AR.EXE ├── CC.EXE ├── CC.H ├── CC1.C ├── CC2.C ├── CC3.C ├── CC4.C ├── CCC.BAT ├── CHKLIST.MS ├── CLIB.ARC ├── CLIB.LIB ├── CLIBARC.LST ├── DISK.BAT ├── HISTORY ├── NEWVER.BAT ├── NOTICE.H ├── READ.ME └── STDIO.H ├── LICENSE ├── README.MD ├── SW-TC ├── ALIB.BAT ├── AR.C ├── AR.EXE ├── CHKLIST.MS ├── CLIB.BAT ├── MTEST.EXE ├── MTEST.MAP ├── READ.ME ├── SW-ARC.LST ├── SW-LIB.LST ├── SW.ARC ├── SW.H ├── SWC.LIB ├── SWL.LIB ├── SWM.LIB ├── SWS.LIB ├── WTEST.EXE └── WTEST.MAP ├── SW ├── CHKLIST.MS ├── DISK.BAT ├── MTEST.EXE ├── NEWVER.BAT ├── READ.ME ├── SW-ARC.LST ├── SW-LIB.LST ├── SW.ARC ├── SW.LIB └── WTEST.EXE ├── TOOLS ├── BUF.C ├── CANT.C ├── CATSUB.C ├── CHG.C ├── CHG.EXE ├── CHKLIST.MS ├── CNT.C ├── CNT.EXE ├── CPT.C ├── CPT.EXE ├── CPY.C ├── CPY.EXE ├── DICT ├── DIGIT.C ├── DISK.BAT ├── DTB.C ├── DTB.EXE ├── EDT.C ├── EDT.EXE ├── EDT2.C ├── ERROR.C ├── ETB.C ├── ETB.EXE ├── FMT.C ├── FMT.EXE ├── FMT2.C ├── FMT3.C ├── FND.C ├── FND.EXE ├── FNT.C ├── FNT.EXE ├── GETWRD.C ├── HISTORY ├── INDEX.C ├── LST.C ├── LST.EXE ├── MAKSET.C ├── MAKSUB.C ├── MANUAL.ZIP ├── MRG.C ├── MRG.EXE ├── ORDER ├── OUT.C ├── PAGE.C ├── PAT.C ├── PRINTF.C ├── PROOF.BAT ├── PRT.C ├── PRT.EXE ├── READ.ME ├── SAME.C ├── SCOPY.C ├── SETTAB.C ├── SRT.C ├── SRT.EXE ├── STDIO.H ├── STP.C ├── STP.EXE ├── STRIP.C ├── TABPOS.C ├── TOOLS.H ├── TRIM.C ├── TRN.C ├── TRN.EXE └── XINDEX.C └── VAL ├── SRC ├── ASMSUBS.C ├── DEFINES.H ├── DICTARY.C ├── ENDLINK.C ├── EXECFILE.C ├── FILES.C ├── FIXUP.C ├── GLOBALS.H ├── INITLINK.C ├── LANGEXT.H ├── LIBRARY.C ├── LINKERIO.C ├── LIST.C ├── MAIN.C ├── MAP.C ├── MEMORY.C ├── OBJECT.C ├── ORDER.C ├── STRING.C ├── SUBS.H ├── TIMER.C ├── TMODULE.C ├── TOKEN.C ├── TYPES.H ├── USERINP.C ├── VAL.C ├── VAL.EXE ├── VAL.HLP ├── VAL.TXT └── VALTECH.TXT ├── VAL.EXE ├── VAL.HLP └── VAL.TXT /ASM/AR.C: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/ASM/AR.C -------------------------------------------------------------------------------- /ASM/AR.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/ASM/AR.EXE -------------------------------------------------------------------------------- /ASM/ASM.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/ASM/ASM.EXE -------------------------------------------------------------------------------- /ASM/ASM.H: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/ASM/ASM.H -------------------------------------------------------------------------------- /ASM/ASM.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/ASM/ASM.LIB -------------------------------------------------------------------------------- /ASM/ASMARC.LST: -------------------------------------------------------------------------------- 1 | ADD32.C 2 | ADD64.C 3 | AND32.C 4 | ATOFT.C 5 | ATOLB.C 6 | ATOP.C 7 | CMP32.C 8 | CMP64.C 9 | CPL32.C 10 | DIV32.C 11 | EQ32.C 12 | EXTEND.C 13 | FILE.C 14 | FT2D.C 15 | FT2S.C 16 | FTADD.C 17 | FTNORMAL.C 18 | FTSUB.C 19 | GE32.C 20 | GT32.C 21 | INC32.C 22 | INT.C 23 | ITOFT.C 24 | LE32.C 25 | LNEG32.C 26 | LSH32.C 27 | LSH64.C 28 | LT32.C 29 | LTOX.C 30 | MESS.C 31 | MIT.C 32 | MOD32.C 33 | MOV32.C 34 | MOV80.C 35 | MUL32.C 36 | NE32.C 37 | NEG32.C 38 | OR32.C 39 | PUTOBJ.C 40 | REQ.C 41 | RSH32.C 42 | RSH64.C 43 | SCAN.C 44 | SUB32.C 45 | SUB64.C 46 | WAITING.C 47 | XOR32.C 48 | -------------------------------------------------------------------------------- /ASM/ASMCAL.BAT: -------------------------------------------------------------------------------- 1 | cc %1 -m -a -p 2 | if errorlevel 1 goto exit 3 | asm %1 4 | if errorlevel 1 goto exit 5 | del %1.asm 6 | pause ^C to skip LINK step 7 | link /MAP asm1 asm2 asm3 asm4 80X86,asm,asm,asm.lib \sc\clib 8 | :exit 9 | -------------------------------------------------------------------------------- /ASM/ASMLIB.LST: -------------------------------------------------------------------------------- 1 | ASMLIB 2 | yes 3 | +ADD32& 4 | +ADD64& 5 | +AND32& 6 | +ATOFT& 7 | +ATOLB& 8 | +ATOP& 9 | +CMP32& 10 | +CMP64& 11 | +CPL32& 12 | +DIV32& 13 | +EQ32& 14 | +EXTEND& 15 | +FILE& 16 | +FT2D& 17 | +FT2S& 18 | +FTADD& 19 | +FTNORMAL& 20 | +FTSUB& 21 | +GE32& 22 | +GT32& 23 | +INC32& 24 | +INT& 25 | +ITOFT& 26 | +LE32& 27 | +LNEG32& 28 | +LSH32& 29 | +LSH64& 30 | +LT32& 31 | +LTOX& 32 | +MESS& 33 | +MIT& 34 | +MOD32& 35 | +MOV32& 36 | +MOV80& 37 | +MUL32& 38 | +NE32& 39 | +NEG32& 40 | +OR32& 41 | +PUTOBJ& 42 | +REQ& 43 | +RSH32& 44 | +RSH64& 45 | +SCAN& 46 | +SUB32& 47 | +SUB64& 48 | +WAITING& 49 | +XOR32; 50 | -------------------------------------------------------------------------------- /ASM/CALIB.BAT: -------------------------------------------------------------------------------- 1 | cc %1 -m -a -p %2 %3 2 | if errorlevel 1 goto end 3 | masm %1; 4 | if errorlevel 1 goto end 5 | del %1.asm 6 | lib asm -+%1; 7 | del asm.bak 8 | :end 9 | 10 | -------------------------------------------------------------------------------- /ASM/CHKLIST.MS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/ASM/CHKLIST.MS -------------------------------------------------------------------------------- /ASM/CMIT.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/ASM/CMIT.EXE -------------------------------------------------------------------------------- /ASM/DUMP.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/ASM/DUMP.EXE -------------------------------------------------------------------------------- /ASM/HISTORY.TXT: -------------------------------------------------------------------------------- 1 | Small Assembler Revision History 2 | 3 | -- included in version 1.1 4 | 5 | 1 Pad location counter in listing with leading zeroes. 6 | 2 Add 80186, 80286, and 80386 instructions to instruction set. 7 | 3 Add 8087, 80287, and 80387 instructions to instruction set. 8 | 4 Add support for floating point and packed decimal constants in 9 | DD, DQ, and DT directives. 10 | 11 | -- included in version 1.2 12 | 13 | 5 Revise DUMP to perform formatted dumps of object libraries too. At this 14 | stage the directory at the end of a library is still not yet formatted. 15 | 6 A forward reference in a PUBLIC directive to a PROC caused the 16 | referenced PROC to generate a "Redundant Definition" error. Also, 17 | subsequent forward references to the same PROC generated "Bad 18 | Expression" errors. 19 | 7 Made PROCs report "Phase Error" messages as labels do. 20 | 8 Dropped EXT.H in favor of individually naming external references in files 21 | ASM2.C, ASM3.C, and ASM4.C. This reduces the number of global symbols in 22 | each file so as to avoid overflowing the global symbol table in Small C. 23 | 24 | - Tried making the assembler run faster by skipping the MIT lookups on pass 25 | 2. The MIT subscript and opnds[] values resulting from pass 1 were 26 | written to an intermediate file which was read during pass 2 instead of 27 | performing the complicated MIT lookups and mappings. The result was no 28 | measurable improvement in speed. Replacing the file with an array also 29 | failed to produce a speed improvement. This effort was an attempt to get 30 | some of the advantages of using intermediate code without having to 31 | rewrite major portions of the assembler. I abandoned the idea after its 32 | dismal showing, however. 33 | 34 | 9 Revised ASMCAL.BAT to correctly name the assembler's own library file, 35 | ASM.LIB, in the link step. Also changed the assembly step to invoke ASM 36 | instead of MASM. Also revised READ.ME comments about ASMCAL.BAT to better 37 | describe its operation and to warn you to run CMIT to create the first 38 | 80X86.OBJ file. 39 | 40 | 10 Corrected a problem that caused ASM to generate a FIXUPP record with the 41 | FIX386 code following the first LEDATA record in the object file, if the 42 | LEDATA record overflowed. This prevented ASM's being able to properly 43 | assemble ASM2. Also made ASM properly toggle between FIXUPP and FIX386 44 | records when the ASO prefix changes the default address size attribute. 45 | 46 | 11 Corrected a problem which caused ASM not to recognize instructions with 47 | memory-only operands if the reference is indirect. 48 | 49 | 12 Revised function dosegment(), in file ASM2.C, to detect when a segment 50 | or class name redefines another symbol. A "Redundant Definition" error 51 | is generated in these cases. 52 | 53 | 13 Revised function dogroup(), in file ASM2.C, to recognize forward 54 | references to segments. 55 | 56 | 14 MASM takes a segment-override prefix to imply a memory reference; thus, 57 | it sees ES:63H as though it were ES:[63H]. ASM now does the same, rather 58 | than generate "- Segment Error." 59 | -------------------------------------------------------------------------------- /ASM/MANUAL.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/ASM/MANUAL.pdf -------------------------------------------------------------------------------- /ASM/MIT.H: -------------------------------------------------------------------------------- 1 | /* 2 | ** mit.h -- machine instruction table 3 | */ 4 | 5 | extern unsigned 6 | mntbl[], /* table of mnemonic indexes */ 7 | optbl[], /* table of operand indexes */ 8 | mitbl[], /* table of machine instr indexes */ 9 | mncnt, /* entries in mnemonic table */ 10 | opcnt, /* entries in operand table */ 11 | micnt; /* entries in machine instr table */ 12 | 13 | extern unsigned char 14 | mitbuf[], /* instruction syntax buffer */ 15 | otnext[], /* operand-type mapping link */ 16 | otmap []; /* operand-type mapping value */ 17 | 18 | extern unsigned /* reside in mit.c */ 19 | looks, /* number of looks to find it */ 20 | hashval; /* global hash value for speed */ 21 | 22 | -------------------------------------------------------------------------------- /ASM/NOTICE.H: -------------------------------------------------------------------------------- 1 | /* 2 | ** notice.h -- signon notice 3 | */ 4 | #define VERSION "Version 1.2, Revision Level 14\n" 5 | #define CRIGHT1 "Copyright 1988 J. E. Hendrix\n\n" 6 | -------------------------------------------------------------------------------- /ASM/OBJ1.H: -------------------------------------------------------------------------------- 1 | /* 2 | ** obj1.h -- first header for .OBJ file processing 3 | */ 4 | 5 | #define FSIZE (100*7) /* fixup buffer size (max*avg) */ 6 | #define OSIZE 1027 /* obuf[] size - DON'T INCREASE! */ 7 | #define OFREE ((OSIZE - 1) - onext) /* obuf[] space remaining */ 8 | -------------------------------------------------------------------------------- /ASM/OBJ2.H: -------------------------------------------------------------------------------- 1 | /* 2 | ** obj2.h -- second header for .OBJ file processing 3 | */ 4 | 5 | /* 6 | ** SEGDEF Parameters 7 | */ 8 | #define A_ABS 0 /* ablolute segment */ 9 | #define A_BYTE 1 /* byte aligned */ 10 | #define A_WORD 2 /* word aligned */ 11 | #define A_PARA 3 /* paragraph aligned */ 12 | #define A_PAGE 4 /* page aligned */ 13 | 14 | #define C_NOT 0 /* does not combine */ 15 | #define C_PUBLIC 2 /* concatenates */ 16 | #define C_STACK 5 /* concatenates */ 17 | #define C_COMMON 6 /* overlaps */ 18 | 19 | #define B_NOTBIG 0 /* not a big (64k) segment */ 20 | #define B_BIG 1 /* is a big (64k) segment */ 21 | 22 | /* 23 | ** FIXUPP Parameters 24 | */ 25 | #define F_M_SELF 0 /* self-rel fixup mode */ 26 | #define F_M_SEGMENT 1 /* segment-rel fixup mode */ 27 | 28 | #define F_L_LO 0 /* fix lo-byte */ 29 | #define F_L_OFF 1 /* fix offset */ 30 | #define F_L_BASE 2 /* fix base */ 31 | #define F_L_PTR 3 /* fix pointer */ 32 | #define F_L_HI 4 /* fix hi-byte */ 33 | 34 | #define F_F_SI 0 /* frame given by segment index */ 35 | #define F_F_GI 1 /* frame given by group index */ 36 | #define F_F_EI 2 /* frame given by external index */ 37 | #define F_F_LOC 4 /* frame is that of the location being fixed */ 38 | #define F_F_TAR 5 /* frame is determined by the target */ 39 | #define F_F_TH0 8 /* frame given by thread 0 */ 40 | #define F_F_TH1 9 /* frame given by thread 1 */ 41 | #define F_F_TH2 10 /* frame given by thread 2 */ 42 | #define F_F_TH3 11 /* frame given by thread 3 */ 43 | 44 | #define F_T_SID 0 /* target given by segment index + displ */ 45 | #define F_T_GID 1 /* target given by group index + displ */ 46 | #define F_T_EID 2 /* target given by external index + displ */ 47 | #define F_T_SI0 4 /* target given by segment index alone */ 48 | #define F_T_GI0 5 /* target given by group index alone */ 49 | #define F_T_EI0 6 /* target given by external index alone */ 50 | #define F_T_TH0 8 /* target given by thread 0 */ 51 | #define F_T_TH1 9 /* target given by thread 1 */ 52 | #define F_T_TH2 10 /* target given by thread 2 */ 53 | #define F_T_TH3 11 /* target given by thread 3 */ 54 | 55 | /* 56 | ** THREAD Parameters 57 | */ 58 | #define T_T_TH0 0 /* define thread 0 */ 59 | #define T_T_TH1 1 /* define thread 1 */ 60 | #define T_T_TH2 2 /* define thread 2 */ 61 | #define T_T_TH3 3 /* define thread 3 */ 62 | 63 | #define T_M_T_SI 0 /* target given by segment index */ 64 | #define T_M_T_GI 1 /* target given by group index */ 65 | #define T_M_T_EI 2 /* target given by external index */ 66 | #define T_M_F_SI 16 /* frame given by segment index */ 67 | #define T_M_F_GI 17 /* frame given by group index */ 68 | #define T_M_F_EI 18 /* frame given by external index */ 69 | #define T_M_F_LOC 20 /* frame is that of the location being fixed */ 70 | #define T_M_F_TAR 21 /* frame is determined by the target */ 71 | 72 | /* 73 | ** MODEND Attribute 74 | */ 75 | #define M_A_NN 0 /* non-main module, no start addr */ 76 | #define M_A_NA 1 /* non-main module, start addr */ 77 | #define M_A_MN 2 /* main module, no start addr */ 78 | #define M_A_MA 3 /* main module, start addr */ 79 | -------------------------------------------------------------------------------- /ASM/OBJ3.H: -------------------------------------------------------------------------------- 1 | /* 2 | ** obj3.h -- third header for .OBJ file processing 3 | */ 4 | 5 | /* 6 | ** record-type codes 7 | */ 8 | #define EOBJ 0x00 /* end of obj file */ 9 | #define BLKDEF 0x7A /* start of a program block */ 10 | #define BLKEND 0x7C /* end of a program block */ 11 | #define COMENT 0x88 /* comment record */ 12 | #define THEADR 0x80 /* t-module header record */ 13 | #define MODEND 0x8A /* module end record */ 14 | #define MOD386 0x8B /* module end record (386) */ 15 | #define EXTDEF 0x8C /* ext ref declaration record */ 16 | #define TYPDEF 0x8E /* variable type definition */ 17 | #define PUBDEF 0x90 /* public declaration record */ 18 | #define PUB386 0x91 /* public declaration record (386) */ 19 | #define LINNUM 0x94 /* source code line number */ 20 | #define LNAMES 0x96 /* list of names record */ 21 | #define SEGDEF 0x98 /* segment definition record */ 22 | #define SEG386 0x99 /* segment definition record (386) */ 23 | #define GRPDEF 0x9A /* group definition record */ 24 | #define FIXUPP 0x9C /* fixup record */ 25 | #define FIX386 0x9D /* fixup record (386) */ 26 | #define LEDATA 0xA0 /* logical enumerated data record */ 27 | #define LED386 0xA1 /* logical enumerated data record (386) */ 28 | #define LIDATA 0xA2 /* logical iterated data record */ 29 | #define LID386 0xA3 /* logical iterated data record (386) */ 30 | #define LHEADR 0xF0 /* library Header */ 31 | #define LFOOTR 0xF1 /* library Footer */ 32 | 33 | #define MAXCONT 512 /* maximum size of contents field */ 34 | #define MAXSYM 40 /* maximum symbol length allowed in OBJ file */ 35 | #define ONES -1 /* all one bits */ 36 | 37 | -------------------------------------------------------------------------------- /ASM/STDIO.H: -------------------------------------------------------------------------------- 1 | /* 2 | ** STDIO.H -- Standard Small C Definitions. 3 | */ 4 | #define stdin 0 /* file descriptor for standard input file */ 5 | #define stdout 1 /* file descriptor for standard output file */ 6 | #define stderr 2 /* file descriptor for standard error file */ 7 | #define stdaux 3 /* file descriptor for standard auxiliary port */ 8 | #define stdprn 4 /* file descriptor for standard printer */ 9 | #define FILE char /* supports "FILE *fp;" declarations */ 10 | #define ERR (-2) /* return value for errors */ 11 | #define EOF (-1) /* return value for end-of-file */ 12 | #define YES 1 /* true */ 13 | #define NO 0 /* false */ 14 | #define NULL 0 /* zero */ 15 | #define CR 13 /* ASCII carriage return */ 16 | #define LF 10 /* ASCII line feed */ 17 | #define BELL 7 /* ASCII bell */ 18 | #define SPACE ' ' /* ASCII space */ 19 | #define NEWLINE LF /* Small C newline character */ 20 | 21 | -------------------------------------------------------------------------------- /C/AR.C: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/C/AR.C -------------------------------------------------------------------------------- /C/AR.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/C/AR.EXE -------------------------------------------------------------------------------- /C/CC.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/C/CC.EXE -------------------------------------------------------------------------------- /C/CC.H: -------------------------------------------------------------------------------- 1 | /* 2 | ** CC.H -- Symbol Definitions for Small-C compiler. 3 | */ 4 | 5 | /* 6 | ** machine dependent parameters 7 | */ 8 | #define BPW 2 /* bytes per word */ 9 | #define LBPW 1 /* log2(BPW) */ 10 | #define SBPC 1 /* stack bytes per character */ 11 | #define ERRCODE 7 /* op sys return code */ 12 | 13 | /* 14 | ** symbol table format 15 | */ 16 | #define IDENT 0 17 | #define TYPE 1 18 | #define CLASS 2 19 | #define SIZE 3 20 | #define OFFSET 5 21 | #define NAME 7 22 | 23 | #define SYMAVG 12 24 | #define SYMMAX 16 25 | 26 | /* 27 | ** symbol table parameters 28 | */ 29 | #define NUMLOCS 25 30 | #define STARTLOC symtab 31 | #define ENDLOC (symtab+NUMLOCS*SYMAVG) 32 | #define NUMGLBS 200 33 | #define STARTGLB ENDLOC 34 | #define ENDGLB (ENDLOC+(NUMGLBS-1)*SYMMAX) 35 | #define SYMTBSZ 3050 /* (NUMLOCS*SYMAVG + NUMGLBS*SYMMAX) */ 36 | 37 | /* 38 | ** system wide name size (for symbols) 39 | */ 40 | #define NAMESIZE 9 41 | #define NAMEMAX 8 42 | 43 | /* 44 | ** values for "IDENT" 45 | */ 46 | #define LABEL 0 47 | #define VARIABLE 1 48 | #define ARRAY 2 49 | #define POINTER 3 50 | #define FUNCTION 4 51 | 52 | /* 53 | ** values for "TYPE" 54 | ** high order 14 bits give length of object 55 | ** low order 2 bits make type unique within length 56 | */ 57 | /* LABEL 0 */ 58 | #define CHR ( 1 << 2) 59 | #define INT (BPW << 2) 60 | #define UCHR (( 1 << 2) + 1) 61 | #define UINT ((BPW << 2) + 1) 62 | #define UNSIGNED 1 63 | 64 | /* 65 | ** values for "CLASS" 66 | */ 67 | /* LABEL 0 */ 68 | #define AUTOMATIC 1 69 | #define STATIC 2 70 | #define EXTERNAL 3 71 | #define AUTOEXT 4 72 | 73 | /* 74 | ** segment types 75 | */ 76 | #define DATASEG 1 77 | #define CODESEG 2 78 | 79 | /* 80 | ** "switch" table 81 | */ 82 | #define SWSIZ (2*BPW) 83 | #define SWTABSZ (90*SWSIZ) 84 | 85 | /* 86 | ** "while" queue 87 | */ 88 | #define WQTABSZ 30 89 | #define WQSIZ 3 90 | #define WQMAX (wq+WQTABSZ-WQSIZ) 91 | 92 | /* 93 | ** field offsets in "while" queue 94 | */ 95 | #define WQSP 0 96 | #define WQLOOP 1 97 | #define WQEXIT 2 98 | 99 | /* 100 | ** literal pool 101 | */ 102 | #define LITABSZ 2000 103 | #define LITMAX (LITABSZ-1) 104 | 105 | /* 106 | ** input line 107 | */ 108 | #define LINEMAX 127 109 | #define LINESIZE 128 110 | 111 | /* 112 | ** entries in staging buffer 113 | */ 114 | #define STAGESIZE 200 115 | 116 | /* 117 | ** macro (#define) pool 118 | */ 119 | #define MACNBR 300 120 | #define MACNSIZE (MACNBR*(NAMESIZE+2)) 121 | #define MACNEND (macn+MACNSIZE) 122 | #define MACQSIZE (MACNBR*7) 123 | #define MACMAX (MACQSIZE-1) 124 | 125 | /* 126 | ** statement types 127 | */ 128 | #define STIF 1 129 | #define STWHILE 2 130 | #define STRETURN 3 131 | #define STBREAK 4 132 | #define STCONT 5 133 | #define STASM 6 134 | #define STEXPR 7 135 | #define STDO 8 136 | #define STFOR 9 137 | #define STSWITCH 10 138 | #define STCASE 11 139 | #define STDEF 12 140 | #define STGOTO 13 141 | #define STLABEL 14 142 | 143 | /* 144 | ** p-code symbols 145 | ** 146 | ** legend: 147 | ** 1 = primary register (pr in comments) 148 | ** 2 = secondary register (sr in comments) 149 | ** b = byte 150 | ** f = jump on false condition 151 | ** l = current literal pool label number 152 | ** m = memory reference by label 153 | ** n = numeric constant 154 | ** p = indirect reference thru pointer in sr 155 | ** r = repeated r times 156 | ** s = stack frame reference 157 | ** u = unsigned 158 | ** w = word 159 | ** _ (tail) = another p-code completes this one 160 | */ 161 | 162 | /* compiler-generated */ 163 | #define ADD12 1 /* add sr to pr */ 164 | #define ADDSP 2 /* add to stack pointer */ 165 | #define AND12 3 /* AND sr to pr */ 166 | #define ANEG1 4 /* arith negate pr */ 167 | #define ARGCNTn 5 /* pass arg count to function */ 168 | #define ASL12 6 /* arith shift left sr by pr into pr */ 169 | #define ASR12 7 /* arith shift right sr by pr into pr */ 170 | #define CALL1 8 /* call function thru pr */ 171 | #define CALLm 9 /* call function directly */ 172 | #define BYTE_ 10 /* define bytes (part 1) */ 173 | #define BYTEn 11 /* define byte of value n */ 174 | #define BYTEr0 12 /* define r bytes of value 0 */ 175 | #define COM1 13 /* ones complement pr */ 176 | #define DBL1 14 /* double pr */ 177 | #define DBL2 15 /* double sr */ 178 | #define DIV12 16 /* div pr by sr */ 179 | #define DIV12u 17 /* div pr by sr unsigned */ 180 | #define ENTER 18 /* set stack frame on function entry */ 181 | #define EQ10f 19 /* jump if (pr == 0) is false */ 182 | #define EQ12 20 /* set pr TRUE if (sr == pr) */ 183 | #define GE10f 21 /* jump if (pr >= 0) is false */ 184 | #define GE12 22 /* set pr TRUE if (sr >= pr) */ 185 | #define GE12u 23 /* set pr TRUE if (sr >= pr) unsigned */ 186 | #define POINT1l 24 /* point pr to function's literal pool */ 187 | #define POINT1m 25 /* point pr to mem item thru label */ 188 | #define GETb1m 26 /* get byte into pr from mem thru label */ 189 | #define GETb1mu 27 /* get unsigned byte into pr from mem thru label */ 190 | #define GETb1p 28 /* get byte into pr from mem thru sr ptr */ 191 | #define GETb1pu 29 /* get unsigned byte into pr from mem thru sr ptr */ 192 | #define GETw1m 30 /* get word into pr from mem thru label */ 193 | #define GETw1n 31 /* get word of value n into pr */ 194 | #define GETw1p 32 /* get word into pr from mem thru sr ptr */ 195 | #define GETw2n 33 /* get word of value n into sr */ 196 | #define GT10f 34 /* jump if (pr > 0) is false */ 197 | #define GT12 35 /* set pr TRUE if (sr > pr) */ 198 | #define GT12u 36 /* set pr TRUE if (sr > pr) unsigned */ 199 | #define WORD_ 37 /* define word (part 1) */ 200 | #define WORDn 38 /* define word of value n */ 201 | #define WORDr0 39 /* define r words of value 0 */ 202 | #define JMPm 40 /* jump to label */ 203 | #define LABm 41 /* define label m */ 204 | #define LE10f 42 /* jump if (pr <= 0) is false */ 205 | #define LE12 43 /* set pr TRUE if (sr <= pr) */ 206 | #define LE12u 44 /* set pr TRUE if (sr <= pr) unsigned */ 207 | #define LNEG1 45 /* logical negate pr */ 208 | #define LT10f 46 /* jump if (pr < 0) is false */ 209 | #define LT12 47 /* set pr TRUE if (sr < pr) */ 210 | #define LT12u 48 /* set pr TRUE if (sr < pr) unsigned */ 211 | #define MOD12 49 /* modulo pr by sr */ 212 | #define MOD12u 50 /* modulo pr by sr unsigned */ 213 | #define MOVE21 51 /* move pr to sr */ 214 | #define MUL12 52 /* multiply pr by sr */ 215 | #define MUL12u 53 /* multiply pr by sr unsigned */ 216 | #define NE10f 54 /* jump if (pr != 0) is false */ 217 | #define NE12 55 /* set pr TRUE if (sr != pr) */ 218 | #define NEARm 56 /* define near pointer thru label */ 219 | #define OR12 57 /* OR sr onto pr */ 220 | #define POINT1s 58 /* point pr to stack item */ 221 | #define POP2 59 /* pop stack into sr */ 222 | #define PUSH1 60 /* push pr onto stack */ 223 | #define PUTbm1 61 /* put pr byte in mem thru label */ 224 | #define PUTbp1 62 /* put pr byte in mem thru sr ptr */ 225 | #define PUTwm1 63 /* put pr word in mem thru label */ 226 | #define PUTwp1 64 /* put pr word in mem thru sr ptr */ 227 | #define rDEC1 65 /* dec pr (may repeat) */ 228 | #define REFm 66 /* finish instruction with label */ 229 | #define RETURN 67 /* restore stack and return */ 230 | #define rINC1 68 /* inc pr (may repeat) */ 231 | #define SUB12 69 /* sub sr from pr */ 232 | #define SWAP12 70 /* swap pr and sr */ 233 | #define SWAP1s 71 /* swap pr and top of stack */ 234 | #define SWITCH 72 /* find switch case */ 235 | #define XOR12 73 /* XOR pr with sr */ 236 | 237 | /* optimizer-generated */ 238 | #define ADD1n 74 /* add n to pr */ 239 | #define ADD21 75 /* add pr to sr */ 240 | #define ADD2n 76 /* add immediate to sr */ 241 | #define ADDbpn 77 /* add n to mem byte thru sr ptr */ 242 | #define ADDwpn 78 /* add n to mem word thru sr ptr */ 243 | #define ADDm_ 79 /* add n to mem byte/word thru label (part 1) */ 244 | #define COMMAn 80 /* finish instruction with ,n */ 245 | #define DECbp 81 /* dec mem byte thru sr ptr */ 246 | #define DECwp 82 /* dec mem word thru sr ptr */ 247 | #define POINT2m 83 /* point sr to mem thru label */ 248 | #define POINT2m_ 84 /* point sr to mem thru label (part 1) */ 249 | #define GETb1s 85 /* get byte into pr from stack */ 250 | #define GETb1su 86 /* get unsigned byte into pr from stack */ 251 | #define GETw1m_ 87 /* get word into pr from mem thru label (part 1) */ 252 | #define GETw1s 88 /* get word into pr from stack */ 253 | #define GETw2m 89 /* get word into sr from mem (label) */ 254 | #define GETw2p 90 /* get word into sr thru sr ptr */ 255 | #define GETw2s 91 /* get word into sr from stack */ 256 | #define INCbp 92 /* inc byte in mem thru sr ptr */ 257 | #define INCwp 93 /* inc word in mem thru sr ptr */ 258 | #define PLUSn 94 /* finish instruction with +n */ 259 | #define POINT2s 95 /* point sr to stack */ 260 | #define PUSH2 96 /* push sr */ 261 | #define PUSHm 97 /* push word from mem thru label */ 262 | #define PUSHp 98 /* push word from mem thru sr ptr */ 263 | #define PUSHs 99 /* push word from stack */ 264 | #define PUT_m_ 100 /* put byte/word into mem thru label (part 1) */ 265 | #define rDEC2 101 /* dec sr (may repeat) */ 266 | #define rINC2 102 /* inc sr (may repeat) */ 267 | #define SUB_m_ 103 /* sub from mem byte/word thru label (part 1) */ 268 | #define SUB1n 104 /* sub n from pr */ 269 | #define SUBbpn 105 /* sub n from mem byte thru sr ptr */ 270 | #define SUBwpn 106 /* sub n from mem word thru sr ptr */ 271 | 272 | #define PCODES 107 /* size of code[] */ 273 | 274 | -------------------------------------------------------------------------------- /C/CCC.BAT: -------------------------------------------------------------------------------- 1 | cc cc1 -m -a -p 2 | if errorlevel 1 goto exit 3 | asm cc1 /p 4 | if errorlevel 1 goto exit 5 | : del cc1.asm 6 | 7 | cc cc2 -m -a -p 8 | if errorlevel 1 goto exit 9 | asm cc2 /p 10 | if errorlevel 1 goto exit 11 | : del cc2.asm 12 | 13 | cc cc3 -m -a -p 14 | if errorlevel 1 goto exit 15 | asm cc3 /p 16 | if errorlevel 1 goto exit 17 | : del cc3.asm 18 | 19 | cc cc4 -m -a -p 20 | if errorlevel 1 goto exit 21 | asm cc4 /p 22 | if errorlevel 1 goto exit 23 | : del cc4.asm 24 | 25 | link cc1 cc2 cc3 cc4,cc,cc,clib.lib 26 | 27 | :exit 28 | 29 | -------------------------------------------------------------------------------- /C/CHKLIST.MS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/C/CHKLIST.MS -------------------------------------------------------------------------------- /C/CLIB.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/C/CLIB.LIB -------------------------------------------------------------------------------- /C/CLIBARC.LST: -------------------------------------------------------------------------------- 1 | CLIB.H 2 | ABS.C 3 | ATOI.C 4 | ATOIB.C 5 | AUXBUF.C 6 | AVAIL.C 7 | BSEEK.C 8 | BTELL.C 9 | CALL.ASM 10 | CALLOC.C 11 | CLEARERR.C 12 | CSEEK.C 13 | CSYSLIB.C 14 | CTELL.C 15 | DTOI.C 16 | EXIT.C 17 | FCLOSE.C 18 | FEOF.C 19 | FERROR.C 20 | FGETC.C 21 | FGETS.C 22 | FOPEN.C 23 | FPRINTF.C 24 | FPUTC.C 25 | FPUTS.C 26 | FREAD.C 27 | FREE.C 28 | FREOPEN.C 29 | FSCANF.C 30 | FWRITE.C 31 | GETARG.C 32 | GETCHAR.C 33 | IS.C 34 | ISASCII.C 35 | ISATTY.C 36 | ISCONS.C 37 | ITOA.C 38 | ITOAB.C 39 | ITOD.C 40 | ITOO.C 41 | ITOU.C 42 | ITOX.C 43 | LEFT.C 44 | LEXCMP.C 45 | MALLOC.C 46 | OTOI.C 47 | PAD.C 48 | POLL.C 49 | PUTCHAR.C 50 | PUTS.C 51 | RENAME.C 52 | REVERSE.C 53 | REWIND.C 54 | SIGN.C 55 | STRCAT.C 56 | STRCHR.C 57 | STRCMP.C 58 | STRCPY.C 59 | STRLEN.C 60 | STRNCAT.C 61 | STRNCMP.C 62 | STRNCPY.C 63 | STRRCHR.C 64 | TOASCII.C 65 | TOLOWER.C 66 | TOUPPER.C 67 | UNGETC.C 68 | UNLINK.C 69 | UTOI.C 70 | XTOI.C 71 | 72 | -------------------------------------------------------------------------------- /C/DISK.BAT: -------------------------------------------------------------------------------- 1 | echo off 2 | if x%1 == xa goto load 3 | if x%1 == xA goto load 4 | if x%1 == xb goto load 5 | if x%1 == xB goto load 6 | goto try 7 | 8 | :load 9 | echo "load diskette in drive %1:" 10 | pause 11 | 12 | if x%2 == xd goto del 13 | if x%2 == xD goto del 14 | if x%2 == x goto fmt 15 | goto try 16 | 17 | :fmt 18 | call format %1: 19 | goto go 20 | 21 | :del 22 | del %1:*.* 23 | 24 | :go 25 | echo on 26 | copy read.me %1: 27 | copy history %1: 28 | copy ccc.bat %1: 29 | copy cc.exe %1: 30 | copy cc.h %1: 31 | copy cc1.c %1: 32 | copy cc2.c %1: 33 | copy cc3.c %1: 34 | copy cc4.c %1: 35 | copy notice.h %1: 36 | copy stdio.h %1: 37 | copy clib.lib %1: 38 | copy clib.arc %1: 39 | copy clibarc.lst %1: 40 | copy ar.exe %1: 41 | copy ar.c %1: 42 | copy \sa\asm.exe %1: 43 | type notice.h 44 | goto end 45 | 46 | :try 47 | echo "try: DISK [D]" 48 | pause 49 | 50 | :end 51 | 52 | -------------------------------------------------------------------------------- /C/HISTORY: -------------------------------------------------------------------------------- 1 | Small-C Revision History 2 | 3 | -- included in version 2.2 4 | 5 | 76 Modified _read() in CSYSLIB.C to do console input through _getkey() 6 | for consistent handling of special key values per the MS-DOS addendum 7 | to the Small-C Handbook. 8 | 77 Modified fgetc() in FGETC.C to look for an ungotten character and 9 | return it without cooking it (since it cooked on the original get). 10 | This fixed an apparent problem in scanf() and fscanf() in which 11 | they appear to miss input characters. 12 | 78 Revised out_code() and do more optimizing. Let p-code subscript code[], 13 | (an array of pointers to output assembly code strings) instead of using 14 | a monstrous switch statement. 15 | 79 Always compile features that are now considered standard. 16 | 80 Properly calculate swend in main() to use all of the switch table. 17 | 81 Dropped unnecessary variable func1. 18 | 82 Changed if(match(...)); to match(...); statements. 19 | 83 Dropped unnecessary while loop in declloc(). 20 | 84 Simplified treatment of argument "dim" in initials(). 21 | 85 Dropped outside() because it is redundant with code in compound(). 22 | 86 Revised the point at which lval2[] is declared in plnge(), and hier14() 23 | to greatly reduce the amount of stack space used during expression 24 | analysis by allocating lval[] arrays only when actually needed. 25 | 87 Simplified logic in newfunc(), doif(), dodo(), preprocess(), skip(), 26 | plnge(), expression(), hier14(), primary(), pstr(), white(). 27 | 88 Modified primary() to add an undeclared function to the symbol table only 28 | if the name is not already in the table. This improves run time by 29 | saving a table lookup on most function references. 30 | 89 Reorganized source code into four files (CC1.C, CC2.C, CC3.C, CC4.C), 31 | regrouped functions into more logical units, and renamed some functions 32 | (addmac->dodefine, newfunc->dofunction, rvalue->fetch, pstr->chrcon, 33 | qstr->string, needtoken->need, col->colon, ol->outline, junk->skip). 34 | 90 Improved output efficiency by deleting cout(), sout(), and xout(). 35 | It now checks for an output error only at the end of a line. 36 | 91 Dropped assignment statements in main() that set globals to zero. 37 | 92 Revised ispunct() to exclude white space from the 'true' condition. 38 | 93 Combined all of the is...() character classification functions into a 39 | single module of short, fast functions that subscript into an array 40 | for the answer. This approach is three times faster. 41 | 94 Per Kiyoshi Akima, eliminated LINK module from library. Now, trailer() 42 | declares _MAIN to be external if main() is declared in the module being 43 | compiled; this forces CSYSLIB to load when linking. By not declaring it 44 | external in other modules, a "multiply defined" error is eliminated when 45 | compiling CSYSLIB which contains _MAIN. However, since .OBJ modules 46 | which were compiled with earlier versions of Small-C contain references to 47 | __LINK, it is declared as a dummy entry point in CALL.ASM to avoid 48 | "unresolved reference" errors at link time. 49 | 95 Per Kiyoshi Akima, installed additional code optimizing. 50 | 96 Dropped setops() in favor of initializing the op[] and op2[] arrays. 51 | This can be done since these arrays now contain p-codes rather than 52 | function addresses. 53 | 97 Yet another rewrite of the the optimizer. It's now much smaller, each 54 | optimization is cheaper, the logic is clearer and more bullet proof. 55 | And, yet more optimizations. EXE sizes are down by 10% and execution times 56 | are down by as much as 25%. 57 | 98 Renamed CC.DEF to CC.H and CLIB.DEF to CLIB.H. 58 | 99 Corrected unlink() to return ERR on failure instead of EOF. 59 | 100 Revision 76 slowed down the reading of files considerably by introducing 60 | an additional call to iscons() for every character read. It was discovered 61 | that the DOS interrupt in this function is very very slow. So, iscons() 62 | was revised to call DOS only the first time for a file, and then test 63 | the rememberred answer thereafter. This required changes to CSYSLIB.C 64 | also. The effect was a DOUBLING OF I/O SPEED DURING READS, compared to 65 | revision level 75 -- BEFORE the slowdown was introduced. This shows that 66 | the existing calls to iscons() in fgetc() and fgets() have been a major 67 | bottleneck all along. 68 | 101 Added the "unsigned" integer and character data types. These result in 69 | unsigned <, <=, >, >=, *, /, % operations and yield unsigned results. 70 | 102 Revised the handling of numeric constants to recognize values from 71 | 32768 to 65535 as unsigned. These, likewise, produce unsigned operations 72 | and yield unsigned results. 73 | 103 Cleaned up the handling of non-definitional function declarations. The 74 | syntax (*func)(), which specifies a pointer to a function, is now accepted 75 | only for function arguments. Previously, it was accepted at the global and 76 | local levels, but not interpreted as a pointer. 77 | 104 Reject instances of declarations, such as *func(), which have multiple 78 | modifiers. Previously, the right most modifier prevailed. But it is 79 | better to reject something than to interpret in differently than it is 80 | written. 81 | 105 Accept "void" before function header as comment. 82 | 106 Corrected an error in the expression analyzer which causes pointer offsets 83 | to be lost when subscripting is applied; e.g., (ptr+5)[x] would lose the 84 | offset 5. 85 | 107 Revised the implementation of the sizeof() operator so it works correctly. 86 | Although undocumented, this was in the original MS-DOS compiler. 87 | 108 Always pass an argument count to functions, even if NOCCARGC is defined. 88 | This is not very costly on 8086 family CPUs and it eliminates a lot of 89 | headaches when you call printf() but forget that NOCCARGC is defined. 90 | 109 Small-C programs now abort with a return code of 1 for memory overflows 91 | and 2 for operator interruptions (control-C). 92 | 110 Revised strlen() to use the 8086 "REPNE SCASB" prefix/instruction for 93 | the fastest possible operation. Sped it up over 500%. 94 | 111 Any redirection of stdout overrides the assumed output of the compiler, 95 | not just redirections to disk files. 96 | 112 Revised hier2() (now called level2()), which processes the ?: operator, 97 | so that it groups properly from right to left and yields meaningful 98 | attributes for further expression analysis. This involved imposing 99 | consistency restrictions on the second and third expressions. 100 | 113 Revised dogoto(), dolabel(), and addlabel() to catch duplicate label 101 | definitions. 102 | 114 Revised outname() to write names to the output file without forcing them to 103 | uppercase. Except for this function, the compiler was already case 104 | sensitive. Also recompiled and assembled the library with lowercase names. 105 | 115 Modified the p-code translation strings containing "CALL xxx", where xxx 106 | is a CALL module entry point, so that xxx is in lower case. This 107 | eliminates errors when case sensitivity is specified to the assembler and 108 | the linker. 109 | 116 Made minor revisions to allow command-line switches to be introduced by 110 | slashes (/) as well as hyphens (-). This is consistant with the Small 111 | Assembler which accommodates slashes for consistency with the PC/MS-DOS 112 | linker which it employs. 113 | 117 Revised optimization cases 31 thru 33 to prevent generating corrupt code 114 | for statements like ++x[4]; where x[] is local. Previously this statement 115 | would update the wrong memory location. Deleted cases 31 and 32, and 116 | changed case 33 to do less optimizing. Renumbered cases 33 thru 49 as 117 | 31 thru 47. 118 | -------------------------------------------------------------------------------- /C/NEWVER.BAT: -------------------------------------------------------------------------------- 1 | cd text 2 | call edit REGISTER.F 3 | fmt REGISTER -np 4 | call edit LABEL.F 5 | cd ..\test 6 | call edit READ.ME 7 | call edit HISTORY 8 | call edit CLIBARC.LST 9 | del ..\CLIB.ARC 10 | ar -u ..\CLIB.ARC 25 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | # Small C repository 2 | 3 | Collected at one place for historic purposes. 4 | 5 | This is original untouched source code (with the possible exception of any added errata.txt files). 6 | 7 | * ASM - Small Assembler 1.2 (rev level 14) 8 | * C - Small C 2.2 (rev level 117) 9 | * TOOLS - Small Tools 1.2 (rev level 33) 10 | * VAL - Linker, released in public domain at SDC'89 11 | * SW - Small Windows 1.1 (rev level 18) for Small C 12 | * SW-TC - Small Windows 1.1 (rev level 18) for Turbo C (any version) 13 | 14 | Assembler, C and VAL can be used together. 15 | 16 | MAKE tool for Small-C available from https://github.com/DosWorld/smallmake 17 | 18 | Note: VAL and SW-TC sources are written for the Turbo-C compiler, available 19 | here - https://edn.embarcadero.com/museum/antiquesoftware 20 | 21 | The Turbo-C package includes tlink (which can be used instead of VAL) 22 | and tlib (which can be used to (re)build clib.lib and asm.lib). 23 | 24 | # License 25 | 26 | I am not a author of this source codes and nothing is contributed by me. Here is original Licenses for each project: 27 | 28 | ## Small C, Small Assembler, Small Tools and Small Windows 29 | 30 | Notice of Public Domain Status 31 | 32 | The source code for the Small-C Compiler and runtime libraries (CP/M & DOS), Small-Mac Assembler (CP/M), Small-Assembler (DOS), Small-Tools programs and Small-Windows library to which I hold copyrights are hereby available for royalty free use in private or commerical endeavors. The only obligation being that the users retain the original copyright notices and credit all prior authors (Ron Cain, James Hendrix, etc.) in derivative versions. 33 | 34 | James E. Hendrix Jr. 35 | 36 | http://www.deturbulator.org/Jim.asp 37 | 38 | ## VAL Linker 39 | 40 | This program is released to the public domain by the author on 41 | February 15, 1989 at the Software Development Conference, 42 | San Francisco, CA. With the understanding that there are no 43 | warranties of any sort either expressed or implied, you may use the 44 | code in whole or part for any lawful purpose. The author does not 45 | warrant or guarantee that this code is fit for any particular purpose. 46 | You are under no obligation to acknowledge the author when using this 47 | code, but you may do so if you desire. The author neither seeks nor 48 | desires any contributions for this code. 49 | 50 | Should you desire to communicate with the author, the preferred method 51 | is via the author's bulletin board, Pontchippi. Pontchippi is an 52 | OPUS board. You may contact it directly at 504-244-1417 or via net 53 | mail to node 390/105. The board has a 9600 baud US Robotics Courier 54 | HST modem. Should you contact the board directly, access to the board 55 | is granted immediately up completion of a very simple questionnaire. 56 | 57 | The author wishes to acknowledge and thank Jack Purdum and Tim Leslie 58 | of Ecosoft for their assistance and support. In addition to Jack and 59 | Tim, Steve Russell of SLR Systems was also of invaluable assistance. 60 | All helped in this project by debugging and offering their expert 61 | advice and guidance. They always had time for me seemingly whenever 62 | I requested it. 63 | 64 | Finally, this program is dedicated to the memory of my father-in-law, 65 | Mariano "Val" Valentino. The only request the author makes for 66 | using the program is that the program name be left as "VAL" in his 67 | memory. 68 | 69 | David Troendle 70 | New Orleans, LA 71 | February 10, 1989 72 | -------------------------------------------------------------------------------- /SW-TC/ALIB.BAT: -------------------------------------------------------------------------------- 1 | echo off 2 | :small 3 | if %1==s goto small2 4 | if not %1==S goto compact 5 | :small2 6 | masm %2,%2,nul,nul /DNEARCODE /DNEARDATA 7 | goto library 8 | 9 | :compact 10 | if %1==c goto compact2 11 | if not %1==C goto medium 12 | :compact2 13 | masm %2,%2,nul,nul /DNEARCODE /DFARDATA 14 | goto library 15 | 16 | :medium 17 | if %1==m goto medium2 18 | if not %1==M goto large 19 | :medium2 20 | masm %2,%2,nul,nul /DFARCODE /DNEARDATA 21 | goto library 22 | 23 | :large 24 | if %1==l goto large2 25 | if not %1==L goto error 26 | :large2 27 | masm %2,%2,nul,nul /DFARCODE /DFARDATA 28 | goto library 29 | 30 | :error 31 | echo try: ALIB model filename 32 | goto exit 33 | 34 | :library 35 | if errorlevel 1 goto exit 36 | lib sw%1 -+%2; 37 | if errorlevel 1 goto exit 38 | del %2.obj 39 | del sw%1.bak 40 | 41 | :exit 42 | 43 | -------------------------------------------------------------------------------- /SW-TC/AR.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW-TC/AR.EXE -------------------------------------------------------------------------------- /SW-TC/CHKLIST.MS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW-TC/CHKLIST.MS -------------------------------------------------------------------------------- /SW-TC/CLIB.BAT: -------------------------------------------------------------------------------- 1 | echo off 2 | :small 3 | if %1==s goto small2 4 | if not %1==S goto compact 5 | :small2 6 | tcc -ms -c -O -f- -Lc:\turboc\lib -Ic:\turboc\include %2 7 | goto library 8 | 9 | :compact 10 | if %1==c goto compact2 11 | if not %1==C goto medium 12 | :compact2 13 | tcc -mc -c -O -f- -Lc:\turboc\lib -Ic:\turboc\include %2 14 | goto library 15 | 16 | :medium 17 | if %1==m goto medium2 18 | if not %1==M goto large 19 | :medium2 20 | tcc -mm -c -O -f- -Lc:\turboc\lib -Ic:\turboc\include %2 21 | goto library 22 | 23 | :large 24 | if %1==l goto large2 25 | if not %1==L goto error 26 | :large2 27 | tcc -ml -c -O -f- -Lc:\turboc\lib -Ic:\turboc\include %2 28 | goto library 29 | 30 | :error 31 | echo try: CLIB model filename 32 | goto exit 33 | 34 | :library 35 | if errorlevel 1 goto exit 36 | lib sw%1 -+%2; 37 | if errorlevel 1 goto exit 38 | del %2.obj 39 | del sw%1.bak 40 | 41 | :exit 42 | 43 | -------------------------------------------------------------------------------- /SW-TC/MTEST.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW-TC/MTEST.EXE -------------------------------------------------------------------------------- /SW-TC/MTEST.MAP: -------------------------------------------------------------------------------- 1 | 2 | Start Stop Length Name Class 3 | 4 | 00000H 03B2AH 03B2BH _TEXT CODE 5 | 03B30H 04301H 007D2H _DATA DATA 6 | 04302H 04305H 00004H _EMUSEG DATA 7 | 04306H 04307H 00002H _CRTSEG DATA 8 | 04308H 04308H 00000H _CVTSEG DATA 9 | 04308H 04308H 00000H _SCNSEG DATA 10 | 04308H 04443H 0013CH _BSS BSS 11 | 04444H 04444H 00000H _BSSEND BSSEND 12 | 04450H 044CFH 00080H _STACK STACK 13 | 14 | Program entry point at 0000:0000 15 | 16 | -------------------------------------------------------------------------------- /SW-TC/SW-ARC.LST: -------------------------------------------------------------------------------- 1 | FILES.C 2 | FILES2.ASM 3 | GETKEY.ASM 4 | HITKEY.ASM 5 | ITOAB.C 6 | ITOU.C 7 | LTOU.C 8 | MENU.C 9 | MSORT.C 10 | MTEST.C 11 | PAD.ASM 12 | POLL.C 13 | SW.H 14 | UTOI.C 15 | VATT.ASM 16 | VCHR.ASM 17 | VCHRA.ASM 18 | VCURSOR.ASM 19 | VDROP.ASM 20 | VGOTO.ASM 21 | VISAT.ASM 22 | VLIFT.ASM 23 | VMODE.C 24 | VMODE2.ASM 25 | VPAGE.ASM 26 | VPOINT.C 27 | VPOINT2.ASM 28 | VSHOW.ASM 29 | VSTOW.ASM 30 | VSTR.ASM 31 | VSTRA.ASM 32 | WATT.C 33 | WAUTO.C 34 | WCHR.C 35 | WCHRA.C 36 | WCLEAN.C 37 | WFRAME.C 38 | WGETC.C 39 | WGETF.C 40 | WGETS.C 41 | WINDOW.H 42 | WKERNEL.C 43 | WMOVE.C 44 | WPRINTF.C 45 | WPUSH.C 46 | WPUTC.C 47 | WPUTCA.C 48 | WPUTS.C 49 | WPUTSA.C 50 | WSCANF.C 51 | WSCROLL.C 52 | WSTR.C 53 | WSTRA.C 54 | WTEST.C 55 | 56 | -------------------------------------------------------------------------------- /SW-TC/SW-LIB.LST: -------------------------------------------------------------------------------- 1 | +FILES& 2 | +FILES2& 3 | +GETKEY& 4 | +HITKEY& 5 | +ITOAB& 6 | +ITOU& 7 | +LTOU& 8 | +MENU& 9 | +MSORT& 10 | +PAD& 11 | +POLL& 12 | +UTOI& 13 | +VATT& 14 | +VCHR& 15 | +VCHRA& 16 | +VCURSOR& 17 | +VDROP& 18 | +VGOTO& 19 | +VISAT& 20 | +VLIFT& 21 | +VMODE& 22 | +VMODE2& 23 | +VPAGE& 24 | +VPOINT& 25 | +VPOINT2& 26 | +VSHOW& 27 | +VSTOW& 28 | +VSTR& 29 | +VSTRA& 30 | +WATT& 31 | +WAUTO& 32 | +WCHR& 33 | +WCHRA& 34 | +WCLEAN& 35 | +WFRAME& 36 | +WGETC& 37 | +WGETF& 38 | +WGETS& 39 | +WKERNEL& 40 | +WMOVE& 41 | +WPRINTF& 42 | +WPUSH& 43 | +WPUTC& 44 | +WPUTCA& 45 | +WPUTS& 46 | +WPUTSA& 47 | +WSCANF& 48 | +WSCROLL& 49 | +WSTR& 50 | +WSTRA; 51 | -------------------------------------------------------------------------------- /SW-TC/SW.ARC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW-TC/SW.ARC -------------------------------------------------------------------------------- /SW-TC/SW.H: -------------------------------------------------------------------------------- 1 | /* 2 | ** sw.h -- Header File for Small-Windows Functions 3 | ** 4 | ** Include in all Small-Windows programs. 5 | */ 6 | extern char *files(char *); 7 | extern void fileset(int, int); 8 | 9 | extern int mfill(int, char *[], int, int); 10 | extern void mhide(int); 11 | extern int mopen(int, int, int, int, int, int, int, int); 12 | extern int mpick(int, char *[], int); 13 | extern void mreset(int); 14 | extern void mshow(int); 15 | extern void msort(char *[], int, int, int); 16 | 17 | extern void vatt(int, int, int, int, int, int); 18 | extern void vchr(char, int, int, int, int, int); 19 | extern void vchra(char, int, int, int, int, int, int); 20 | extern void vcursor(int, int); 21 | extern void vdrop(int, int, int, int, int, int); 22 | extern void vfast(); 23 | extern void vgoto(int, int, int); 24 | extern int visat(int); 25 | extern void vlift(int, int, int, int, int, int); 26 | extern int vmode(int); 27 | extern int vpage(int); 28 | extern int vpoint(int, int, int, int, int, int, int); 29 | extern void vshow(char far *, int, int, int, int, int); 30 | extern void vslow(); 31 | extern void vstow(char far *, int, int, int, int, int); 32 | extern void vstr(char *, int, int, int, int, int); 33 | extern void vstra(char *, int, int, int, int, int, int); 34 | 35 | extern int wactive(); 36 | extern void wallow(int); 37 | extern void watt(int, int); 38 | extern void wauto(int, int); 39 | extern void wblank(int); 40 | extern int wchop(int); 41 | extern void wchr(char, int); 42 | extern void wchra(char, int, int); 43 | extern void wclean(int); 44 | extern int wcol(); 45 | extern int wcsize(); 46 | extern void wcursor(int); 47 | extern void wdrop(int); 48 | extern void wframe(int, int); 49 | extern char wgetc(); 50 | extern int wgetf(char *, char *, int); 51 | extern char *wgets(char *, int); 52 | extern int wgo(int, int); 53 | extern int wgoto(int, int); 54 | extern void whide(); 55 | extern void wlift(int); 56 | extern int wmode(int); 57 | extern void wmove(int, int); 58 | extern void wnl(int); 59 | extern int wok(int); 60 | extern int wopen(int, int, int, int, int); 61 | extern int wpage(int); 62 | extern char far *wpoint(); 63 | extern void wpop(int); 64 | extern int wprintf(); 65 | extern void wpush(int, int); 66 | extern char wputc(char); 67 | extern char wputca(char, int); 68 | extern void wputs(char *); 69 | extern void wputsa(char *, int); 70 | extern void wsbuf(int, int); 71 | extern int wrow(); 72 | extern int wscanf(); 73 | extern void wsdis(int, void (*)()); 74 | extern int wseen(int); 75 | extern void wselect(int); 76 | extern void wshow(); 77 | extern void wstr(char *, int); 78 | extern void wstra(char *, int, int); 79 | extern void wsxow(void (*)(), char far *); 80 | 81 | extern char *itou(unsigned, char *, int); 82 | extern void itoab(unsigned, char *, int); 83 | extern char *ltou(unsigned long, char *, int); 84 | extern int poll(int); 85 | extern int utoi(char *, int *); 86 | 87 | -------------------------------------------------------------------------------- /SW-TC/SWC.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW-TC/SWC.LIB -------------------------------------------------------------------------------- /SW-TC/SWL.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW-TC/SWL.LIB -------------------------------------------------------------------------------- /SW-TC/SWM.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW-TC/SWM.LIB -------------------------------------------------------------------------------- /SW-TC/SWS.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW-TC/SWS.LIB -------------------------------------------------------------------------------- /SW-TC/WTEST.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW-TC/WTEST.EXE -------------------------------------------------------------------------------- /SW-TC/WTEST.MAP: -------------------------------------------------------------------------------- 1 | 2 | Start Stop Length Name Class 3 | 4 | 00000H 034ABH 034ACH _TEXT CODE 5 | 034B0H 03BDFH 00730H _DATA DATA 6 | 03BE0H 03BE3H 00004H _EMUSEG DATA 7 | 03BE4H 03BE5H 00002H _CRTSEG DATA 8 | 03BE6H 03BE6H 00000H _CVTSEG DATA 9 | 03BE6H 03BE6H 00000H _SCNSEG DATA 10 | 03BE6H 03C4BH 00066H _BSS BSS 11 | 03C4CH 03C4CH 00000H _BSSEND BSSEND 12 | 03C50H 03CCFH 00080H _STACK STACK 13 | 14 | Program entry point at 0000:0000 15 | 16 | -------------------------------------------------------------------------------- /SW/CHKLIST.MS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW/CHKLIST.MS -------------------------------------------------------------------------------- /SW/DISK.BAT: -------------------------------------------------------------------------------- 1 | echo off 2 | if x%1 == xa goto load 3 | if x%1 == xA goto load 4 | if x%1 == xb goto load 5 | if x%1 == xB goto load 6 | goto try 7 | 8 | :load 9 | echo "load diskette in drive %1:" 10 | pause 11 | 12 | if x%2 == xd goto del 13 | if x%2 == xD goto del 14 | if x%2 == x goto fmt 15 | goto try 16 | 17 | :fmt 18 | call format %1: 19 | goto go 20 | 21 | :del 22 | del %1:*.* 23 | 24 | :go 25 | echo on 26 | copy read.me %1: 27 | copy text\register %1: 28 | copy text\history %1: 29 | copy d:\ocs\order %1: 30 | copy d:\sc\ar.c %1: 31 | copy d:\sc\ar.exe %1: 32 | copy *.lib %1: 33 | copy *.arc %1: 34 | copy *.lst %1: 35 | copy *.exe %1: 36 | copy book\manual.out %1: 37 | dir %1: 38 | goto end 39 | 40 | :try 41 | echo "try: DISK [D]" 42 | pause 43 | 44 | :end 45 | 46 | -------------------------------------------------------------------------------- /SW/MTEST.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosWorld/smallc/62d51f2f4ba64032b347de02c6253f08ba4933c7/SW/MTEST.EXE -------------------------------------------------------------------------------- /SW/NEWVER.BAT: -------------------------------------------------------------------------------- 1 | cd test 2 | call edit SW-LIB.LST 3 | call edit SW-ARC.LST 4 | call edit READ.ME 5 | call edit ..\text\HISTORY 6 | call edit ..\text\LABEL.F 7 | del SW.ARC 8 | ar -u SW.ARC