made to work
This commit is contained in:
parent
a93d4a1e29
commit
e61d8f6356
2 changed files with 24 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
.sect .text; .sect .rom; .sect .data; .sect .bss
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
|
||||||
.define begtext,begdata,begbss
|
.define begtext,begdata,begbss,syscal
|
||||||
.define hol0,.reghp,.limhp,.trppc,.ignmask
|
.define hol0,.reghp,.limhp,.trppc,.ignmask
|
||||||
.define ERANGE,ESET,EHEAP,ECASE,EILLINS,EIDIVZ,EODDZ
|
.define ERANGE,ESET,EHEAP,ECASE,EILLINS,EIDIVZ,EODDZ
|
||||||
.extern _end
|
.extern _end
|
||||||
|
@ -14,6 +14,22 @@ EODDZ = 19
|
||||||
ECASE = 20
|
ECASE = 20
|
||||||
|
|
||||||
.sect .text
|
.sect .text
|
||||||
|
.data1 0353
|
||||||
|
.data1 0176 ! jmp to begtext in 2 bytes. Assembler generates 3
|
||||||
|
! bytes.
|
||||||
|
syscal: jmp 1f
|
||||||
|
grow: jmp 2f
|
||||||
|
jmp 2f
|
||||||
|
.data2 -277, -277, -277, -277, -277, -277
|
||||||
|
2:
|
||||||
|
mov ax,2088
|
||||||
|
1:
|
||||||
|
int 5
|
||||||
|
jmp 1f
|
||||||
|
.space 100
|
||||||
|
1:
|
||||||
|
ret
|
||||||
|
|
||||||
begtext:
|
begtext:
|
||||||
mov bx,sp
|
mov bx,sp
|
||||||
mov cx,(bx)
|
mov cx,(bx)
|
||||||
|
@ -26,6 +42,12 @@ begtext:
|
||||||
push bx
|
push bx
|
||||||
push cx
|
push cx
|
||||||
xor bp,bp
|
xor bp,bp
|
||||||
|
mov bx,_end
|
||||||
|
mov cx,9
|
||||||
|
add bx,1024
|
||||||
|
shr bx,cl
|
||||||
|
shl bx,cl
|
||||||
|
call grow
|
||||||
call _m_a_i_n
|
call _m_a_i_n
|
||||||
call __exit
|
call __exit
|
||||||
.sect .data
|
.sect .data
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
.sect .text; .sect .rom; .sect .data; .sect .bss
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
.define syscal, sysal, sysn, sysnl, sysnx, sysc, syse, cerror, _errno
|
.define sysal, sysn, sysnl, sysnx, sysc, syse, cerror, _errno
|
||||||
|
|
||||||
.sect .bss
|
.sect .bss
|
||||||
.comm _errno, 2
|
.comm _errno, 2
|
||||||
|
|
||||||
.sect .text
|
.sect .text
|
||||||
syscal:
|
|
||||||
int 5
|
|
||||||
ret
|
|
||||||
|
|
||||||
sysal:
|
sysal:
|
||||||
push bp
|
push bp
|
||||||
|
|
Loading…
Reference in a new issue