adapted to new assembler syntax

This commit is contained in:
ceriel
1987-01-08 10:13:48 +00:00
parent 5cc2c0ccfc
commit c754f6ca69
54 changed files with 225 additions and 119 deletions

View File

@@ -1,6 +1,10 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define begtext,begdata,begbss
.define hol0,.reghp,.limhp,.trppc,.ignmask
.define ERANGE,ESET,EHEAP,ECASE,EILLINS,EODDZ
.define ERANGE,ESET,EHEAP,ECASE,EILLINS
.extern _end
.extern np
ERANGE = 1
ESET = 2
@@ -10,66 +14,45 @@ EILLINS = 18
EODDZ = 19
ECASE = 20
base = 0x01C0
topmem = 0xFFF0
.org topmem-16
.extern __n_line
maxmem:
__n_line:
.space 16
.errnz __n_line-0xFFE0
.base base
.text
.sect .text
begtext:
cld
xor ax,ax
mov ss,ax
mov ds,ax
mov es,ax
mov (2),cs
mov (0),.diverr
mov sp,maxmem
mov di,begbss
mov cx,[[endbss-begbss]/2]&0x7FFF
! xor ax,ax ! ax still is 0
rep stos
mov ax,envp
push ax
mov ax,argv
push ax
mov ax,1
push ax
mov bx,sp
mov cx,(bx)
add bx,2
mov ax,cx
inc ax
shl ax,1
add ax,bx
push ax
push bx
push cx
mov (np),begbss
mov bx,endbss
push bx
call _brk ! allocate space for bss
pop si
xor bp,bp
call _m_a_i_n
call .stop
.diverr:
push ax
mov ax,EIDIVZ
call .error
pop ax
iret
.data
int 0x81
.sect .data
begdata:
hol0:
.word 0,0
.word 0,0
.data2 0,0
.data2 0,0
argv:
.word 3f
.data2 3f
envp:
.word 0
.data2 0
3:
.asciz "PROGRAM"
.reghp:
.word endbss
.data2 endbss
.limhp:
.word endbss
.data2 endbss
.ignmask:
.word 0
.data2 0
.trppc:
.word 0
.data2 0
.bss
.sect .bss
begbss: