-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patha1begin.asm
66 lines (65 loc) · 1.66 KB
/
a1begin.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
; This copy of begin.asm from Aztec C is identical aside from the code to zero
; BSS has been commented out. The C standard didn's required bss to be zero
; initialized until 1999, and older apps shouldn't depend on it.
;Copyright (C) 1981,1982,1983 by Manx Software Systems
; :ts=8
BDOS equ 5
extrn Croot_
extrn _Uorg_, _Uend_
;
public lnprm, lntmp, lnsec
;
; The 3 "bss" statements below must remain in EXACTLY the same order,
; with no intervening statements!
;
bss lnprm,4
bss lntmp,4
bss lnsec,4
;
global sbot,2
global errno_,2
global _mbot_,2
dseg
public Sysvec_
public _exit_
Sysvec_: dw 0
dw 0
dw 0
dw 0
public $MEMRY
$MEMRY: dw 0ffffh
;
fcb: db 0,'???????????',0,0,0,0
ds 16
cseg
public .begin
.begin:
; lxi h,_Uorg_
; lxi b,_Uend_-_Uorg_
; mvi e,0
clrbss:
; mov m,e
; inx h
; dcx b
; mov a,c
; ora b
; jnz clrbss
;
LHLD BDOS+1
SPHL
; lxi d,-2048
lxi d,-600 ;set heap limit at 600 bytes below stack
dad d
shld sbot
lhld $MEMRY
shld _mbot_
CALL Croot_
_exit_:
mvi c,17 ;search for first (used to flush deblock buffer)
lxi d,fcb
call BDOS
lxi b,0
call BDOS
jmp _exit_
;
end .begin