ack/mach/sun2/libsys/_sbrk.s

37 lines
519 B
ArmAsm
Raw Normal View History

1990-01-22 11:56:01 +00:00
#include "syscall.h"
.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
.define __sbrk,__brk
__sbrk:
move.l 4(sp),d0
add.l #3,d0
move.l #~3,d1
and.l d1,d0
move.l d0,a0
1990-01-22 14:25:10 +00:00
move.l .limhp,d0
1990-01-22 11:56:01 +00:00
add.l #3,d0
and.l d1,d0
1990-01-22 14:25:10 +00:00
move.l d0,.limhp
1990-01-22 11:56:01 +00:00
add.l d0,a0
move.l a0,4(sp)
pea 17 ! not SYS_sbrk
trap #0
bcs 1f
1990-01-22 14:25:10 +00:00
move.l .limhp,d0
move.l 4(sp),.limhp
1990-01-22 11:56:01 +00:00
rts
1:
jmp cerror
__brk:
move.l 4(sp),d0
add.l #3,d0
move.l #~3,d1
and.l d1,d0
move.l d0,4(sp)
pea 17
trap #0
bcs 1b
1990-01-22 14:25:10 +00:00
move.l 4(sp),.limhp
1990-01-22 11:56:01 +00:00
clr.l d0
rts