I thought that something like what follows:
goto _foo
end
_foo:
print "Howdy!\n"
end
would be legal imcc input, but I get:
last token = [(null)]
(error) line 1: parse error
Didn't create output asm.
instead of happiness. I'm trying to learn enough IMCC that
I can make the jakoc compiler work with it. I've read the
imcc README and scanned a few examples of output from the
Perl6 compiler, but I think I'm still missing something...
Regards,
-- Gregor
IMCC requires you to put everything in .subs. So it should be something like
..sub main
goto _foo
end
_foo:
print "Howdy!\n"
end
..end
There's nothing special about calling it "main", the pasm entry point is the
first sub.
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Except without those extra dots. Stupid mailer.
> All --
>
> I thought that something like what follows:
>
> goto _foo
> end
> _foo:
> print "Howdy!\n"
> end
Works fine *if* you insert your example into ".sub" ... ".end":
..sub _test
goto _foo
end
_foo:
print "ok 1\n"
end
..end
> Regards,
>
> -- Gregor
leo
I think I can use that to work around the limitation. It makes it
unnatural to
have a script with the pattern:
some code
some subroutine definitions
some more code, calling the subroutines.
Which Jako permits.
It looks like I can wrap all the bits of miscellaneous code in little
pseudo-
subs:
.sub __CODE__0
...
goto __CODE__1
.end
.sub some_real_sub
....
.end
.sub __CODE__1
...
call some_real_sub
...
.end
And just ignore the spurrious 'ret' instructions imcc generates to
"properly"
terminate each of the "subroutines" (if imcc ever does dead code removal,
it could actually remove these instructions before they make it to the
..pasm
file).
Regards,
-- Gregor
"Mr. Nobody" <mrnob...@yahoo.com>
12/04/2002 10:15 AM
To: gre...@focusresearch.com
cc: perl6-i...@perl.org
Subject: Re: Tiny imcc example doesn't work
--- gre...@focusresearch.com wrote:
> I thought that something like what follows:
>
> goto _foo
> end
> _foo:
> print "Howdy!\n"
> end
>
> would be legal imcc input
IMCC requires you to put everything in .subs. So it should be something
like
..sub main
goto _foo
end
_foo:
print "Howdy!\n"
end
..end
There's nothing special about calling it "main", the pasm entry point is
the
first sub.
__________________________________________________
> And just ignore the spurrious 'ret' instructions imcc generates to
> "properly"
> terminate each of the "subroutines" (
These "ret" ins are remnants from the ret => .end change - they will go
away.
leo