|
Atari coding BBS
Re: Mxalloc? |
Posted by: evil
|
Aug,30.2013-15:20
|
It looks like he's using C, I took for granted that the libs will do a proper init with Mshrink.. But what do I know, I never learned that jibberish language :)
An init in non-jibbersih that will allow for Malloc() use looks like this:
move.l 4(sp),a5 ;address to basepage
move.l $0c(a5),d0 ;length of text segment
add.l $14(a5),d0 ;length of data segment
add.l $1c(a5),d0 ;length of bss segment
add.l #$100,d0 ;length of basepage
add.l #$1000,d0 ;length of stackpointer
move.l a5,d1 ;address to basepage
add.l d0,d1 ;end of program
and.l #-2,d1 ;make address even
move.l d1,sp ;new stackspace
move.l d0,-(sp) ;mshrink()
move.l a5,-(sp)
move.w d0,-(sp)
move.w #$4a,-(sp)
trap #1
lea 12(sp),sp
--
Anders Eriksson
ae@dhs.nu
|
[All messages in this thread] [Start new thread]
What's the anti-troll code? That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
|