cd languages/BASIC/compiler
perl compile.pl samples/screen.bas
..\..\..\parrot.exe _test.pbc
Be sure you have a fairly recent version of Parrot. This requires recent
fixes to i386/jit_emit.h, the new sysinfo op, and lots of Win32 compilation
help recently pushed to the list.
Notes:
* sysinfo is used to determine your platform. If you're *not* running
Windows, ANSI terminal codes are used to move the cursor, provide color
(thanks Leon), and whatnot. If you're not Win32 or an ANSI terminal...
uh... patches welcome.
* If you are running Win32 then ANSI codes can't be used after Win95/98/ME
by console apps -- CMD.EXE in NT, XP, 2k ignores them now. In this case
the BASIC runtime makes native calls to kernel32.dll Console Functions with
the Parrot dlfunc and loadlib ops (see RT_ platform_Win32.pasm). Fun!
* The next step is Win32 keypress detection, then the games get better. I
don't even have to wait for the I/O layer to get polished off... Or do I
start messing in User32.dll...? Decisions...
What's fun is that the compiled PBC can be moved from my Linux system to my
Win32 system almost transparently!
Suggestions and display hacks welcome...
> The compiled version of BASIC under languages/BASIC/compiler now supports
> the COLOR, LOCATE and CLS statements as found in QuickBASIC. In
> samples/screen.bas you'll find a small program to exercise these
> statements. To run it:
>
> cd languages/BASIC/compiler
> perl compile.pl samples/screen.bas
> ..\..\..\parrot.exe _test.pbc
Uh, I think you've missed a step somewhere in there. When I run
compile.pl, I don't get a .pbc file; I get two PASM files,
TARG_test.pasm and TARG_localfuncs.pasm
Simon
Ahh, you're right.
perl compile.pl samples/screen.bas
perl -I../../.. ../../../assemble.pl -o _test.pbc TARG_test.pasm
../../../parrot _test.pbc
One of these days I'll write a proper harness for this all. Or this might
even work:
perl compile.pl samples/screen.bas
perl testrun.pl