[Coco] Portal-9 to compile HLA source to 6809/CoCo!

Roger Taylor rtaylor at bayou.com
Sun Nov 28 22:25:33 EST 2004


The author of HLA, Randall Hyde, just confirmed that HLA 2.x will generate 
intermediate code and allow plug in modules to support any kind of 
assembler.  The stock assemblers are, ofcourse, PC-based and for the 
Pentium line, but soon we'll be able to cross-compile/assemble HLA source 
to the CoCo!

"The plan is to allow this, yes. The macro facilities
will be sufficiently improved to allow you to easily
write a parser for a different assembly language (and
emit the corresponding byte values for the instructions)."

So, Portal-9 will soon get its first cross compiler that targets the 
6809/6309/CoCo/Vectrex.  This is great!

I won't get too much into HLA, but it is very powerful, and allows some of 
the most common structure schemes used in the popular languages.  If you 
know C, you will learn HLA easily, and it is much more readable than C, 
unless you really get into some advanced stuff like big macros, thunks, 
code generation control, etc.

Here's some of the very simple (out of hundreds of code structures and 
statements) to give you an idea:


static
         grape:  word:=  2; // initialized to what we want (2)
         peach:  int16; // uninitialized
         banana: uns8;
         pear:   byte;
         count:  dword;  // 32-bit value (6309 can access 32 bits at once)
         apple:  dword:= 5;
         orange: dword;
         msg1:   string:=        "this is a static HLA string";
         zstring:        char[128];

const
         coco:=  3;
         cpu:=   6309;
         ram:=   1024*128; // 128k

readonly
         msg:    string:=        "this is a read-only string";

procedure printmsg(themsg: string);
begin printmsg;
         stdout.put(themsg, nl);
end printmsg

for(mov(0, count); count<10; inc(count)) do
         stdout.put("we're at ", count, nl);
endfor;

if(theflag=true) then
elseif(someothervar=value) then
endif;



More later...!


-- 
Roger Taylor




More information about the Coco mailing list