brk.S revision 1.3
11.3Sws/* $NetBSD: brk.S,v 1.3 1998/05/25 15:35:06 ws Exp $ */ 21.1Sthorpej 31.1Sthorpej#include "SYS.h" 41.1Sthorpej 51.3Sws .globl _ASM_LABEL(curbrk) 61.1Sthorpej 71.1Sthorpej .text 81.1Sthorpej 91.1Sthorpej#ifdef PIC 101.1Sthorpej XXX 111.1Sthorpej#else 121.1SthorpejENTRY(brk) 131.3Sws lis 5,_C_LABEL(end)@ha # r5 = &_end 141.3Sws addi 5,5,_C_LABEL(end)@l 151.1Sthorpej cmplw 5,3 # if (&_end <= r3) 161.1Sthorpej bgt 0f 171.1Sthorpej mr 5,3 # r5 = r3 181.1Sthorpej0: 191.1Sthorpej mr 3,5 # new break value 201.1Sthorpej li 0,SYS_break 211.1Sthorpej sc # assume, that r5 is kept 221.1Sthorpej bso 1f 231.3Sws lis 6,_ASM_LABEL(curbrk)@ha # record new break 241.3Sws stw 5,_ASM_LABEL(curbrk)@l(6) 251.1Sthorpej blr # return 0 261.1Sthorpej 271.1Sthorpej1: 281.3Sws b _ASM_LABEL(cerror) 291.1Sthorpej#endif 30