|
Prev: Audio processing via GPU
Next: All is right !
From: chnorik on 12 Apr 2008 13:06 Hello, I am still porting my code from gas to hla. In gas source I used functions, which were called from other objects. it was like this ..globl foo .type foo, @function foo: my function then I was calling call foo from other object file Then I was linkind separate object files, and it was working. Now, in HLA, in aoa 'managing large programs' I have read about header files, etc... But isn't it possible to do modular programming without headers? I wonder whether it is possible to follow simple approach like in gas with hla Thank you
From: Frank Kotler on 12 Apr 2008 15:03 chnorik(a)gmail.com wrote: > Hello, > I am still porting my code from gas to hla. > In gas source I used functions, which were called from other objects. > it was like this > .globl foo > .type foo, @function > foo: > my function > > then I was calling call foo from other object file > Then I was linkind separate object files, and it was working. > > Now, in HLA, in aoa 'managing large programs' I have read about > header files, etc... But isn't it possible to do modular programming > without headers? Should be... > I wonder whether it is possible to follow simple approach like in gas > with hla You chose HLA because you wanted a simple approach??? Do you know about "unit" instead of "program"? That may fix you up. What's HLA's equivalent to ".globl"? "public"? Frank's Law: When making the complicated things simple, be careful not to make the simple things complicated! I'm sure HLA will do what you want, but I don't know the magic incantation. If you don't get an answer here, try asking in the !Yahoo! group... (Quick, before M$ eats it!!!) Best, Frank
From: Evenbit on 12 Apr 2008 19:55 On Apr 12, 1:06 pm, chno...(a)gmail.com wrote: > Hello, > I am still porting my code from gas to hla. > In gas source I used functions, which were called from other objects. > it was like this > .globl foo > .type foo, @function > foo: > my function > > then I was calling call foo from other object file > Then I was linkind separate object files, and it was working. > > Now, in HLA, in aoa 'managing large programs' I have read about > header files, etc... But isn't it possible to do modular programming > without headers? > I wonder whether it is possible to follow simple approach like in gas > with hla > > Thank you I think it is easier to manage if you *avoid* the "multiple object file" approach. For instance: myfuncs.hhf ---- 8< ---- procedure myinc( x:dword ); begin myinc; mov( x, eax ); inc( eax ); end myinc; procedure myprint( sometext:string; repcount:dword ); begin myprint; push( ecx ); for( mov( 0, ecx ); ecx < repcount; add( 1, ecx ) ) do stdout.puts( sometext ); stdout.newln(); endfor; pop( ecx ); end myprint; ---- >8 ---- ....and testfunc.hla ---- 8< ---- program testfunc; #include( "stdlib.hhf" ) #include( "myfuncs.hhf" ) begin testfunc; mov( 5, ebx ); myinc( ebx ); stdout.puti32( eax ); stdout.newln(); myprint( "Hello HLA!", 5 ); end testfunc; ---- >8 ---- $ hla testfunc $ ./testfunc 6 Hello HLA! Hello HLA! Hello HLA! Hello HLA! Hello HLA! Nathan.
|
Pages: 1 Prev: Audio processing via GPU Next: All is right ! |