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,4 +1,4 @@
tail_em.a libem_s.a
adi.s adi.s
and.s and.s
cii.s cii.s
@ -50,4 +50,3 @@ trp.s
stop.s stop.s
printf.s printf.s
print.s print.s
tail.s

View file

@ -1,16 +1,33 @@
install: # $Header$
../../install head_em.s head_em MACH=i86
../../install tail_em.a tail_em install: all
../../install head_em.o head_em
../../install libem_o.a tail_em
../../install end.o end_em
cmp: cmp: all
-../../compare head_em.s head_em -../../compare head_em.o head_em
-../../compare tail_em.a tail_em -../../compare libem_o.a tail_em
-../../compare end.o end_em
clean : all: head_em.o libem_o.a end.o
end.o: end.s
$(MACH) -I../../../h -c end.s
head_em.o: head_em.s
$(MACH) -I../../../h -c head_em.s
libem_o.a: libem_s.a
ASAR=aal ; export ASAR ;\
march . libem_o.a
clean:
rm -f *.o
opr : opr :
make pr | opr make pr | opr
pr: pr:
@pr head_em.s @pr `pwd`/head_em.s
@arch pv tail_em.a | pr -h `pwd`/tail_em.a @arch pv libem_s.a | pr -h `pwd`/libem_s.a
@pr `pwd`/end.s

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .adi .define .adi
! $Header$
! #bytes in cx , top of stack in ax ! #bytes in cx , top of stack in ax
.sect .text
.adi: .adi:
pop bx ! return address pop bx ! return address
cmp cx,2 cmp cx,2
@ -20,6 +21,8 @@
push dx push dx
jmp bx jmp bx
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .and .define .and
! $Header$
! #bytes in cx ! #bytes in cx
.sect .text
.and: .and:
pop bx ! return address pop bx ! return address
mov di,sp mov di,sp

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .cii .define .cii
.sect .text
.cii: .cii:
! $Header$
pop di ! return address pop di ! return address
! pop cx, dest. size ! pop cx, dest. size
! pop bx, src. size ! pop bx, src. size
@ -31,6 +32,8 @@
jmp di jmp di
9: 9:
push ax ! push low source push ax ! push low source
.extern EILLINS
.extern .fat
mov ax,EILLINS mov ax,EILLINS
push ax push ax
jmp .fat jmp .fat

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .cms .define .cms
! $Header$
! #bytes in cx ! #bytes in cx
.sect .text
.cms: .cms:
pop bx ! return address pop bx ! return address
mov dx,sp mov dx,sp

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .cmu4 .define .cmu4
.sect .text
.cmu4: .cmu4:
! $Header$
pop bx ! return address pop bx ! return address
xor ax,ax xor ax,ax
pop cx pop cx

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .com .define .com
! $Header$
! #bytes in cx ! #bytes in cx
.sect .text
.com: .com:
pop bx ! return address pop bx ! return address
mov di,sp mov di,sp

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .csa2 .define .csa2
.sect .text
.csa2: .csa2:
! $Header$
! si, descriptor address ! si, descriptor address
! bx, index ! bx, index
mov dx,(si) ! default mov dx,(si) ! default
@ -16,6 +17,8 @@
mov bx,dx mov bx,dx
test bx,bx test bx,bx
jnz 2f jnz 2f
.extern ECASE
.extern .fat
mov ax,ECASE mov ax,ECASE
push ax push ax
jmp .fat jmp .fat

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .csb2 .define .csb2
.sect .text
.csb2: .csb2:
! $Header$
!si, descriptor address !si, descriptor address
!dx, index !dx, index
lods lods
@ -19,6 +20,8 @@
2: 2:
test bx,bx test bx,bx
jnz 3f jnz 3f
.extern ECASE
.extern .fat
mov ax,ECASE mov ax,ECASE
push ax push ax
jmp .fat jmp .fat

View file

@ -1,11 +1,12 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .ciu .define .ciu
.define .cui .define .cui
.define .cuu .define .cuu
.sect .text
.ciu: .ciu:
.cui: .cui:
.cuu: .cuu:
! $Header$
pop di ! return address pop di ! return address
! pop cx, dest. size ! pop cx, dest. size
! pop bx, source size ! pop bx, source size
@ -29,6 +30,8 @@
jmp di jmp di
9: 9:
push ax ! to help debugging ? push ax ! to help debugging ?
.extern EILLINS
.extern .fat
mov ax,EILLINS mov ax,EILLINS
push ax push ax
jmp .fat jmp .fat

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .dup .define .dup
! $Header$
! #bytes in cx ! #bytes in cx
.sect .text
.dup: .dup:
pop bx ! return address pop bx ! return address
mov si,sp mov si,sp

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .dvi .define .dvi
! $Header$
! #bytes in ax ! #bytes in ax
.sect .text
.dvi: .dvi:
pop bx ! return address pop bx ! return address
cmp ax,2 cmp ax,2
@ -24,12 +25,15 @@
push si push si
push dx push dx
push ax push ax
.extern .dvi4
call .dvi4 call .dvi4
pop bx pop bx
push cx push cx
push ax push ax
jmp bx jmp bx
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,3 +1,4 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .dvi4 .define .dvi4
yl=2 yl=2
@ -5,8 +6,8 @@ yh=4
xl=6 xl=6
xh=8 xh=8
.sect .text
.dvi4: .dvi4:
! $Header$
mov si,sp ! copy of sp mov si,sp ! copy of sp
mov bx,yl(si) mov bx,yl(si)
mov ax,yh(si) mov ax,yh(si)

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .dvu .define .dvu
! $Header$
! #bytes in ax ! #bytes in ax
.sect .text
.dvu: .dvu:
pop bx ! return address pop bx ! return address
cmp ax,2 cmp ax,2
@ -24,12 +25,15 @@
push si push si
push dx push dx
push ax push ax
.extern .dvu4
call .dvu4 call .dvu4
pop bx pop bx
push cx push cx
push ax push ax
jmp bx jmp bx
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,3 +1,4 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .dvu4 .define .dvu4
yl=2 yl=2
@ -5,8 +6,8 @@ yh=4
xl=6 xl=6
xh=8 xh=8
.sect .text
.dvu4: .dvu4:
! $Header$
mov si,sp ! copy of sp mov si,sp ! copy of sp
mov bx,yl(si) mov bx,yl(si)
mov ax,yh(si) mov ax,yh(si)

View file

@ -1,10 +1,11 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .error .define .error
! $Header$
! ax is trap number ! ax is trap number
! all registers must be saved ! all registers must be saved
! because return is possible ! because return is possible
! May only be called with error no's <16 ! May only be called with error no's <16
.sect .text
.error: .error:
push bp push bp
push si push si
@ -16,6 +17,8 @@
mov cx,ax mov cx,ax
mov bx,1 mov bx,1
sal bx,cl sal bx,cl
.extern .ignmask
.extern .trp
test bx,(.ignmask) test bx,(.ignmask)
jne 2f jne 2f
call .trp call .trp

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define .exg .define .exg
! $Header$
! #bytes in cx ! #bytes in cx
.sect .text
.exg: .exg:
pop bx ! return address pop bx ! return address
mov dx,cx mov dx,cx

View file

@ -1,3 +1,5 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .mlf,.dvf,.ngf,.adf,.sbf,.cmf,.zrf,.fif,.fef .define .mlf,.dvf,.ngf,.adf,.sbf,.cmf,.zrf,.fif,.fef
.define .mlf8,.dvf8,.ngf8,.adf8,.sbf8,.cmf8,.zrf8,.fif8,.fef8 .define .mlf8,.dvf8,.ngf8,.adf8,.sbf8,.cmf8,.zrf8,.fif8,.fef8
.define .mlf4,.dvf4,.ngf4,.adf4,.sbf4,.cmf4,.zrf4,.fif4,.fef4 .define .mlf4,.dvf4,.ngf4,.adf4,.sbf4,.cmf4,.zrf4,.fif4,.fef4
@ -35,8 +37,9 @@
.cuf: .cuf:
.cfu: .cfu:
.cff: .cff:
! $Header$
pop bx ! return address pop bx ! return address
.extern EILLINS
.extern .fat
mov ax,EILLINS mov ax,EILLINS
push ax push ax
jmp .fat jmp .fat

View file

@ -1,7 +1,10 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .fat .define .fat
.fat: .fat:
! $Header$ .extern .trp
.extern .stop
call .trp call .trp
call .stop call .stop
! no return ! no return

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .gto .define .gto
.gto: .gto:
! $Header$
mov bp,4(bx) mov bp,4(bx)
mov sp,2(bx) mov sp,2(bx)
jmp (bx) jmp (bx)

View file

@ -1,10 +1,12 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .iaar .define .iaar
.iaar: .iaar:
! $Header$
pop bx pop bx
pop dx pop dx
cmp dx,2 cmp dx,2
.extern .unknown
jne .unknown jne .unknown
pop si ! descriptor address pop si ! descriptor address
pop ax ! index pop ax ! index

View file

@ -1,13 +1,16 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .ilar .define .ilar
.ilar: .ilar:
! $Header$
pop bx pop bx
pop dx pop dx
.extern .unknown
cmp dx,2 cmp dx,2
jne .unknown jne .unknown
pop di ! descriptor address pop di ! descriptor address
pop ax ! index pop ax ! index
pop si ! array base pop si ! array base
push bx push bx
.extern .lar2
jmp .lar2 jmp .lar2

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .inn .define .inn
! $Header$
! #bytes in cx ! #bytes in cx
! bit # in ax ! bit # in ax
.inn: .inn:
@ -24,6 +25,6 @@
! ax is result ! ax is result
jmp bx jmp bx
.data .sect .data
bits: bits:
.byte 1,2,4,8,16,32,64,128 .data1 1,2,4,8,16,32,64,128

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .ior .define .ior
! $Header$
! #bytes in cx ! #bytes in cx
.ior: .ior:
pop bx ! return address pop bx ! return address

View file

@ -1,13 +1,16 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .isar .define .isar
.isar: .isar:
! $Header$
pop bx pop bx
pop dx pop dx
cmp dx,2 cmp dx,2
.extern .unknown
jne .unknown jne .unknown
pop si ! descriptor address pop si ! descriptor address
pop ax ! index pop ax ! index
pop di ! array base pop di ! array base
push bx push bx
.extern .sar2
jmp .sar2 jmp .sar2

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .lar2 .define .lar2
.lar2: .lar2:
! $Header$
pop bx ! return address pop bx ! return address
! di, descriptor address ! di, descriptor address
! ax, index ! ax, index

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .loi .define .loi
! $Header$
! #bytes in cx ! #bytes in cx
! source address in si ! source address in si
.loi: .loi:

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .mli .define .mli
! $Header$
! #bytes in ax ! #bytes in ax
.mli: .mli:
pop bx ! return address pop bx ! return address
@ -22,6 +23,8 @@
push dx push dx
jmp .mli4 jmp .mli4
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .mli4 .define .mli4
! $Header$
! x * y with ! x * y with
! x.low = si x.high = di ! x.low = si x.high = di
! y.low = bx y.high = ax ! y.low = bx y.high = ax

View file

@ -1,5 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .mon .define .mon
.mon: .mon:
! $Header$ .extern .stop
call .stop call .stop

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .ngi .define .ngi
! $Header$
! #bytes in ax ! #bytes in ax
.ngi: .ngi:
pop bx ! return address pop bx ! return address
@ -22,6 +23,8 @@
push ax push ax
jmp bx jmp bx
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,11 +1,13 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .nop .define .nop
.extern printd, printc, hol0
SIO_S = 0xDA SIO_S = 0xDA
SIO_D = 0xD8 SIO_D = 0xD8
RXRDY = 0x02 RXRDY = 0x02
.nop: .nop:
! $Header$
mov ax,(hol0) mov ax,(hol0)
call printd call printd
! movb al,' ' ! movb al,' '

View file

@ -1,10 +1,11 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define printc,printd,prints .define printc,printd,prints
SIO_D = 0xD8 SIO_D = 0xD8
SIO_S = 0xDA SIO_S = 0xDA
TXRDY = 0x01 TXRDY = 0x01
! $Header$
! argument in ax ! argument in ax
! uses bx ! uses bx
prints: prints:
@ -33,7 +34,6 @@ printd:
1: 1:
xchg ax,dx xchg ax,dx
addb al,'0' addb al,'0'
.errnz printc - .
! argument in ax ! argument in ax
printc: printc:

View file

@ -1,7 +1,9 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define printf .define printf
.extern printc, printd, prints
printf: printf:
! $Header$
pop bx ! return address pop bx ! return address
xchg ax,di xchg ax,di
mov si,sp mov si,sp

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .rck .define .rck
! $Header$
! descriptor address in si ! descriptor address in si
! value in ax, must be left there ! value in ax, must be left there
.rck: .rck:
@ -11,6 +12,8 @@
ret ret
2: 2:
push ax push ax
.extern ERANGE
.extern .error
mov ax,ERANGE mov ax,ERANGE
call .error call .error
pop ax pop ax

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .rmi .define .rmi
! $Header$
! #bytes in ax ! #bytes in ax
.rmi: .rmi:
pop bx ! return address pop bx ! return address
@ -24,12 +25,15 @@
push si push si
push dx push dx
push ax push ax
.extern .rmi4
call .rmi4 call .rmi4
pop ax pop ax
push bx push bx
push dx push dx
jmp ax jmp ax
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,3 +1,5 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .rmi4 .define .rmi4
yl=2 yl=2
@ -6,7 +8,6 @@ xl=6
xh=8 xh=8
.rmi4: .rmi4:
! $Header$
mov si,sp ! copy of sp mov si,sp ! copy of sp
mov bx,yl(si) mov bx,yl(si)
mov ax,yh(si) mov ax,yh(si)

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .rmu .define .rmu
! $Header$
! #bytes in ax ! #bytes in ax
.rmu: .rmu:
pop bx ! return address pop bx ! return address
@ -24,12 +25,15 @@
push si push si
push dx push dx
push ax push ax
.extern .rmu4
call .rmu4 call .rmu4
pop ax pop ax
push bx push bx
push dx push dx
jmp ax jmp ax
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,3 +1,5 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .rmu4 .define .rmu4
yl=2 yl=2
@ -6,7 +8,6 @@ xl=6
xh=8 xh=8
.rmu4: .rmu4:
! $Header$
mov si,sp ! copy of sp mov si,sp ! copy of sp
mov bx,yl(si) mov bx,yl(si)
mov ax,yh(si) mov ax,yh(si)

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .rol .define .rol
! $Header$
! #bytes in ax ! #bytes in ax
.rol: .rol:
pop dx ! return address pop dx ! return address
@ -28,6 +29,8 @@
2: 2:
jmp dx jmp dx
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .ror .define .ror
! $Header$
! #bytes in ax ! #bytes in ax
.ror: .ror:
pop dx ! return address pop dx ! return address
@ -29,6 +30,8 @@
2: 2:
jmp dx jmp dx
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,7 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .sar2 .define .sar2
.sar2: .sar2:
! $Header$
pop bx ! return address pop bx ! return address
! si, descriptor address ! si, descriptor address
! ax, index ! ax, index

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .sbi .define .sbi
! $Header$
! #bytes in cx , top of stack in ax ! #bytes in cx , top of stack in ax
.sbi: .sbi:
pop bx ! return subress pop bx ! return subress
@ -18,10 +19,12 @@
sub cx,ax sub cx,ax
mov ax,cx mov ax,cx
pop cx pop cx
sbc cx,dx sbb cx,dx
push cx push cx
jmp bx jmp bx
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .set .define .set
! $Header$
! #bytes in cx ! #bytes in cx
! bit # in ax ! bit # in ax
.set: .set:
@ -25,11 +26,13 @@
orb (di),dl orb (di),dl
jmp bx jmp bx
2: 2:
.extern ESET
.extern .trp
push bx push bx
mov ax,ESET mov ax,ESET
push ax push ax
jmp .trp jmp .trp
.data .sect .data
bits: bits:
.byte 1,2,4,8,16,32,64,128 .data1 1,2,4,8,16,32,64,128

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .sli .define .sli
! $Header$
! #bytes in ax ! #bytes in ax
.sli: .sli:
pop dx ! return address pop dx ! return address
@ -27,6 +28,8 @@
2: 2:
jmp dx jmp dx
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .sri .define .sri
! $Header$
! #bytes in ax ! #bytes in ax
.sri: .sri:
pop dx ! return address pop dx ! return address
@ -27,6 +28,8 @@
2: 2:
jmp dx jmp dx
9: 9:
.extern EODDZ
.extern .trp
mov ax,EODDZ mov ax,EODDZ
push ax push ax
jmp .trp jmp .trp

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .sti .define .sti
! $Header$
! #bytes in cx ! #bytes in cx
! destination address in di ! destination address in di
.sti: .sti:

View file

@ -1,4 +1,5 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .stop .define .stop
.stop: .stop:
! $Header$
int 3 int 3

View file

@ -1,7 +1,9 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .strhp .define .strhp
.extern .reghp, .limhp, EHEAP, .fat
.strhp: .strhp:
! $Header$
pop bx pop bx
pop ax pop ax
mov (.reghp),ax mov (.reghp),ax

View file

@ -1,6 +1,8 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .trp .define .trp
.extern .trppc, .stop
! $Header$
! ax is trap number ! ax is trap number
.trp: .trp:
xor bx,bx xor bx,bx

View file

@ -1,7 +1,9 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .unknown .define .unknown
.extern EILLINS, .fat
.unknown: .unknown:
! $Header$
mov ax,EILLINS mov ax,EILLINS
push ax push ax
jmp .fat jmp .fat

View file

@ -1,6 +1,7 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.sect .text
.define .xor .define .xor
! $Header$
! #bytes in cx ! #bytes in cx
.xor: .xor:
pop bx ! return address pop bx ! return address

View file

@ -1,6 +1,10 @@
.sect .text; .sect .rom; .sect .data; .sect .bss
.define begtext,begdata,begbss .define begtext,begdata,begbss
.define hol0,.reghp,.limhp,.trppc,.ignmask .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 ERANGE = 1
ESET = 2 ESET = 2
@ -10,66 +14,45 @@ EILLINS = 18
EODDZ = 19 EODDZ = 19
ECASE = 20 ECASE = 20
base = 0x01C0 .sect .text
topmem = 0xFFF0
.org topmem-16
.extern __n_line
maxmem:
__n_line:
.space 16
.errnz __n_line-0xFFE0
.base base
.text
begtext: begtext:
cld mov bx,sp
xor ax,ax mov cx,(bx)
mov ss,ax add bx,2
mov ds,ax mov ax,cx
mov es,ax inc ax
mov (2),cs shl ax,1
mov (0),.diverr add ax,bx
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 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 _m_a_i_n
call .stop int 0x81
.diverr: .sect .data
push ax
mov ax,EIDIVZ
call .error
pop ax
iret
.data
begdata: begdata:
hol0: hol0:
.word 0,0 .data2 0,0
.word 0,0 .data2 0,0
argv: argv:
.word 3f .data2 3f
envp: envp:
.word 0 .data2 0
3: 3:
.asciz "PROGRAM" .asciz "PROGRAM"
.reghp: .reghp:
.word endbss .data2 endbss
.limhp: .limhp:
.word endbss .data2 endbss
.ignmask: .ignmask:
.word 0 .data2 0
.trppc: .trppc:
.word 0 .data2 0
.bss .sect .bss
begbss: begbss: