ack/mach/i386/libsys/_sbrk.s

30 lines
319 B
ArmAsm
Raw Normal View History

1990-01-22 11:01:47 +00:00
.sect .text; .sect .rom; .sect .data; .sect .bss
.define __sbrk
.sect .text
__sbrk:
push bp
mov bp,sp
mov ax,8(bp)
or ax,ax
jne 1f
mov ax,(.limhp)
pop bp
ret
1:
mov bx,(.limhp)
add ax,bx
push ax
call _brk
or ax,ax
jne 1f
pop ax
mov (.limhp),ax
mov ax,bx
pop bp
ret
1:
pop ax
mov ax,-1
pop bp
ret