Rev 922 | Details | Compare with Previous | Last modification | View Log
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 635 | alone | 1 | DEVICE ZXSPECTRUM128 |
| 2 | include "../_sdk/sys_h.asm" |
||
| 3 | include "8080.asm" |
||
| 4 | |||
| 5 | ; |
||
| 6 | ; CCC.ASM: BDS C Run-Time Package (C.CCC) v1.6, 2/86 |
||
| 7 | ; |
||
| 8 | ; Copyright (c) 1982, 1983, 1986 by BD Software, Inc. |
||
| 9 | ; |
||
| 10 | ; This is the source to the BDS C run-time package module. When running |
||
| 11 | ; in a standard CP/M system environment, the run-time package object module |
||
| 12 | ; resides at the start of the TPA (typically 100h). The code generated by |
||
| 13 | ; the BDS C Compiler usually has its origin immediately following the end of |
||
| 14 | ; the run-time package module. |
||
| 15 | ; |
||
| 16 | ; This file may be assembled either by Digital Research's assemblers |
||
| 17 | ; (ASM and MAC) or by Microsoft's assembler (M80/L80). Set the M80 symbol |
||
| 18 | ; (below) to specify which assembler shall be used. The final result of the |
||
| 19 | ; assembly is a run-time package module named "C.CCC", ready for use by |
||
| 20 | ; CLINK.COM or L2.COM. |
||
| 21 | ; |
||
| 22 | ; Assembly instructions for MAC.COM / ASM.COM: |
||
| 23 | ; (set M80 to FALSE) |
||
| 24 | ; >asm ccc |
||
| 25 | ; >load ccc |
||
| 26 | ; >ren c.ccc=ccc.com |
||
| 27 | ; |
||
| 28 | ; Assembly instructions with M80.COM for standard CP/M TPA operation: |
||
| 29 | ; (set M80 to TRUE) |
||
| 30 | ; >m80 ccc,ccc=ccc.asm |
||
| 31 | ; >l80 /p:100,ccc/n,ccc/e |
||
| 32 | ; >ren c.ccc=ccc.com |
||
| 33 | ; |
||
| 34 | |||
| 35 | M80 EQU FALSE ;TRUE for M80 and L80, FALSE if using ASM/MAC and LOAD |
||
| 36 | |||
| 37 | ; |
||
| 38 | ; Equate statements in CAPITAL letters may be configured to control the |
||
| 39 | ; following environmental and auxilliary options of the run-time environment: |
||
| 40 | ; |
||
| 41 | ; a) operating system environment, or lack thereof (CPM, MPM2) |
||
| 42 | ; b) recognition of the CP/M "user area" mechandsm (USAREA) |
||
| 43 | ; c) CDB debugger interface (USERST, RSTNUM) |
||
| 44 | ; d) code compression through use of restart vectors 1-7 (ZOPT1-ZOPT7) |
||
| 45 | ; |
||
| 46 | ; All the above options (except CPM and sometimes ZOPT1-ZOPT7) may be altered |
||
| 47 | ; freely WITHOUT requiring the reassembly of the CSM-coded portions of the |
||
| 48 | ; C library (object in DEFF2.CRL). Changing ZOPT1-ZOPT7 requires library |
||
| 49 | ; reassembly only when PRESRV is set to FALSE. |
||
| 50 | ; |
||
| 51 | ; If generating code for an operating-system-independent application (when |
||
| 52 | ; the CPM equate is set to FALSE), make sure to set the following values: |
||
| 53 | ; |
||
| 54 | ; e) the origin of the run-time package code segment (ORIGIN) |
||
| 55 | ; f) the origin of the run-time package's local data area (RAM) |
||
| 56 | ; g) the transfer address upon program termination (EXITAD) |
||
| 57 | ; |
||
| 58 | |||
| 59 | FALSE equ 0 |
||
| 60 | TRUE equ not FALSE |
||
| 61 | |||
| 62 | CPM EQU TRUE ;True if to be run under any CP/M- or MP/M-like system |
||
| 63 | MPM2 EQU FALSE ;True ONLY if running MP/M II (forces R/O file closes) |
||
| 680 | alone | 64 | NEDOOS EQU 1 |
| 635 | alone | 65 | |
| 66 | ; |
||
| 67 | ; Use this section to configure run-time package |
||
| 68 | ; for non-CP/M-resident operation (e.g., for ROM): |
||
| 69 | ; |
||
| 70 | |||
| 71 | IF NOT CPM ;fill in the appropriate values... |
||
| 72 | ORIGIN EQU NEWBASE ;Address at which programs are to run |
||
| 73 | RAM EQU WHATEVER ;R/W memory area for non-CP/M configurations |
||
| 74 | ;(default: immediately after C.Ccall c,under CP/M) |
||
| 75 | EXITAD EQU WHENDONE ;where to go when done executing |
||
| 76 | ENDIF |
||
| 77 | |||
| 78 | ; |
||
| 79 | ; Some CP/M-specific symbolic values: |
||
| 80 | ; |
||
| 81 | |||
| 82 | if CPM |
||
| 83 | nfcbs EQU 8 ;maximum # of files open at one time |
||
| 84 | base equ 0 ;start of system ram |
||
| 85 | bdos equ base+5 ;bdos entry pt. |
||
| 86 | tpa equ base+100h |
||
| 87 | tbuff equ base+80h |
||
| 88 | ORIGIN equ tpa |
||
| 89 | EXITAD equ base ;warm boot location |
||
| 90 | |||
| 91 | conin equ 1 ;BDOS call codes...console input |
||
| 92 | cstat equ 11 ;interrogate console status |
||
| 93 | closec equ 16 ;close file |
||
| 94 | gsuser equ 32 ;get/set user code |
||
| 95 | endif |
||
| 96 | |||
| 97 | ; |
||
| 98 | ; The location of the jump vectors and utility routines must remain |
||
| 99 | ; constant relative to the beginning of this run-time module. |
||
| 100 | ; |
||
| 101 | ; Do NOT change ANYTHING between here and the start of the |
||
| 102 | ; "init" routine!!!!!!!! |
||
| 103 | ; |
||
| 104 | |||
| 105 | ;IF NOT M80 |
||
| 106 | org ORIGIN |
||
| 107 | begin |
||
| 108 | ;ENDIF |
||
| 109 | |||
| 930 | alone | 110 | include "ccc.asm" |
| 635 | alone | 111 | |
| 112 | end |
||
| 930 | alone | 113 | savebin "c.ccc",begin,end-begin |
| 635 | alone | 114 | |
| 115 | LABELSLIST "../../us/user.l" |