Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!dkuug!diku!bombadil From: bombadil@diku.dk (Kristian Nielsen) Newsgroups: comp.sys.amiga.programmer Subject: Re: Help! (AmigaDOS CreateProc/LoadSeg) Message-ID: <1991Mar14.150439.1899@odin.diku.dk> Date: 14 Mar 91 15:04:39 GMT References: <63329@eerie.acsu.Buffalo.EDU> <19578@cbmvax.commodore.com> <06417.AA06417@babylon.rmt.sub.org> <1991Mar12.123403.2415@odin.diku.dk> <06569.AA06569@babylon.rmt.sub.org> Sender: news@odin.diku.dk (Netnews System) Organization: Department of Computer Science, U of Copenhagen Lines: 54 rbabel@babylon.rmt.sub.org (Ralph Babel) writes: >In article <1991Mar12.123403.2415@odin.diku.dk>, >bombadil@diku.dk (Kristian Nielsen) writes: >> /* Static initialised data (really code). */ >> struct CodeHdr fooSegList={ >> sizeof(struct CodeHdr), >> NULL, >> 0x4EF9, >> (APTR)foo >> }; >Same problem: not necessarily longword-aligned. Yeah, I forgot... and I won't even try to defend myself with any talk about __align keywords or anything... >> (if LoadSeg differentiates between CODE and DATA sections, >> it might be nessesary to ensure that the structure is >> placed in the CODE section; >Currently it doesn't, but you never know. >Some compilers move "const" data into the code hunk. Yes, I thought about that, but it is only 'some'. I guess the next best way is to resort to the good old assembler: SECTION fakeseglists,CODE fakeseglist MACRO ;label,entry XDEF \1 XREF \2 CNOP 0,4 ;Align to long word. dc.l 14 ;size. \1 dc.l 0 ;pointer to next segment. jmp \2 ;Jump to entry point. ENDM fakeseglist seglist1,entry1 ;Seglist pointer for entry1(). fakeseglist seglist2,entry2 fakeseglist seglist3,entry3 END This way, the code should end up longword aligned AND in code segment. >Ralph - Kristian.