Path: utzoo!attcan!uunet!wuarchive!julius.cs.uiuc.edu!apple!agate!shelby!msi-s0.msi.umn.edu!cs.umn.edu!thelake!steve From: steve@thelake.mn.org (Steve Yelvington) Newsgroups: comp.sys.atari.st Subject: Re: Re: Sozobon Message-ID: Date: 3 Oct 90 18:44:02 GMT References: <6565@castle.ed.ac.uk> Lines: 98 [elev35@castle.ed.ac.uk (R C Smith) writes ... ] > I'm trying to compile sozobon C on our mainframe so that I can have lots > of lovely disk space to use. It compiles but says it doesn't know the > following functions. Could some kind person send me source code for > these functions or at least tell me what they do. > ... > Whoops forgot to say which functions I need, can I have code for > > _lclr > _lcpy A little work with grep reveals that these two are defined in the "subs.s" module of hcc. I have to move my lips when I read assembler, but it looks to me like lclr works like bzero and lcpy works like bcpy. Or perhaps memcpy, which has its args reversed ... look carefully. .globl _lclr .text _lclr: link a6,#0 move.l 8(a6),a0 move 12(a6),d0 bra L5 L4: clr.l (a0)+ L5: dbf d0,L4 unlk a6 rts .globl _lcpy .text _lcpy: link a6,#0 move.l 8(a6),a0 move.l 12(a6),a1 move 16(a6),d0 bra L8 L7: move.l (a1)+,(a0)+ L8: dbf d0,L7 unlk a6 rts > _strchr This should be in your native compiler's library. If not, the dLibs module strchr.s defines it in Motorola assembler and includes a C equivalent: * #include * * char *strchr(string, symbol) * register char *string; * register char symbol; * /* * * Return a pointer to the first occurance of in . * * NULL is returned if is not found. * */ * { * do * { * if(*string == symbol) * return(string); * } * while(*string++); * return(NULL); * } .text .globl _strchr _strchr: move.l 4(a7),a0 move.w 8(a7),d0 strchr1: cmp.b (a0),d0 bne strchr2 move.l a0,d0 rts strchr2: tst.b (a0)+ bne strchr1 clr.l d0 rts -- Steve Yelvington up at the lake in Minnesota Internet: steve@thelake.mn.org UUCP: {plains,rutgers,apple,cray}!umn-cs!thelake!steve