https://github.com/turkishrational/scc
Small C Compiler (Hendrix) for TRDOS 386 Operating System
https://github.com/turkishrational/scc
32bit 386dos c cc ccompiler compiler fasm hendrix scc simple simplec small smallc trdos386
Last synced: about 2 months ago
JSON representation
Small C Compiler (Hendrix) for TRDOS 386 Operating System
- Host: GitHub
- URL: https://github.com/turkishrational/scc
- Owner: turkishrational
- Created: 2024-09-24T13:12:06.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-12-19T18:14:59.000Z (5 months ago)
- Last Synced: 2025-02-13T01:51:16.556Z (4 months ago)
- Topics: 32bit, 386dos, c, cc, ccompiler, compiler, fasm, hendrix, scc, simple, simplec, small, smallc, trdos386
- Language: Assembly
- Homepage:
- Size: 4.02 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## SMALL C COMPILER (Origin: J.E. Hendrix) for TRDOS 386 Operating System
*** 32 bit C compiler, flat memory, FASM output ***
### Modified/Derived from: KolibriOS SCC
### Origin: Small C Compiler for MSDOS (J. E. Hendrix)
### Operating System depended file (contains TRDOS 386 system calls): OSFUNC.ASM
### Major difference from other SCC adaptations/ports:
In TRDOS 386, STDIN/STDOUT/STDERR (can be used but) are not used in
same meanings.. SYSSTDIO system call is used instead of SYSREAD/SYSWRITE
system calls with file handles 0,1,2 for STDIN/STDOUT/STDERR.
In 'stdio.h' header file, STDIN,STDOUT and STDERR
file handles are set to -1 (not 0,1,2 as in other systems).
This is a signature that directs code to SYSSTDIO system call
(for putc, getc) instead of SYSREAD/SYSWRITE (fputc, fgetc) system calls.
(You can see it in 'OSFUNC.ASM' file)
SYSSTDIO system call can be used to redirect STDIN and STDOUT to a file.
(But this is not a subject for SCC here.)### Compiling: fasm scc.asm SCC.PRG (in Windows or Linux)
FASM (flat assembler) is used to assemble SCC source code.
### Using compiler: scc cfile
Use scc without a file name -without an argument- to see options.
### SCC compiler output: ASM file
Label numbers may need to be changed later by using NOTEPAD
or a similar text editor.### Assembling: FASM filename.asm
Note: 'include' files and a header file
-for setting '_main' function, entry point- is needed.
SCC output file must be included to TRDOS 386 compatible ASM file.
(There are samples in this SCC repository.)### What is PRG file:
PRG extension means TRDOS 386 flat image binary/executable
file (like as a .BIN file or similar to MSDOS .COM files but startup address
is 0 not 100h). (TRDOS 386 PRG file size + BSS limit is virtually 4GB-4MB.)Erdogan Tan - September 2024