Re: Article about HLA on Linux Journal's website



HLA is an assembly language, although one might be able to write a few
cross-compatible programs that can work either as an HLA-compiled
program or a batch file.

Paul

Herbert Kleebauer wrote:
> dunric@xxxxxxxxx wrote:
> >
> > It's about HLA and assembly language.
>
> Are you sure? I just looked at the code and I think
> this is batch programming and not assembly programming.
> Ok, I had to insert a few "::" and "call", but then
> cmd.exe executes it without any problem:
>
> @echo off
> :: :// Player vs. Dragon demo. An example of HLA code.
> :: :// ------------------------------------------------------
> :: :// Sample game introduction of "Player vs. Dragon".
> :: :// ------------------------------------------------------
> :: :program west;
> :: :// ------------------------------------------------------
> :: :// Include files "console.hhf" and "stdlib.hhf" into
> :: :// the program.
> :: :// ------------------------------------------------------
> :: :#include("console.hhf");
> :: :#include("stdlib.hhf");
> :: :// ------------------------------------------------------
> :: :// Begin program "west".
> :: :// ------------------------------------------------------
> :: :begin west;
> :: :// ------------------------------------------------------
> :: :// Set console foreground color to white, background
> :: :// to blue.
> :: :// ------------------------------------------------------
> :: :console.setAttrs( console.white, console.blue );
> :: :// ------------------------------------------------------
> :: :// Clear the console screen.
> :: :// ------------------------------------------------------
> call :console.cls();
> :: :// ------------------------------------------------------
> :: :// Start the main loop of the program, designated
> :: :// "mainlp".
> :: :// ------------------------------------------------------
> :: :mainlp:
> :: :// ------------------------------------------------------
> :: :// Change foreground color to green, background to blue.
> :: :// ------------------------------------------------------
> call :console.setAttrs( console.green, console.blue );
> :: :// ------------------------------------------------------
> :: :// Use "stdout.puts" to display text on the console
> :: :// mode screen. "nl" means "next line".
> :: :// ------------------------------------------------------
> call :stdout.puts("A green dragon approaches, spreading her wings high" nl);
> call :stdout.puts("across the landscape, plunging it into darkness! The" nl);
> call :stdout.puts("dragon looks at you and says:");
> :: :// ------------------------------------------------------
> :: :// Change foreground color to yellow, background to blue.
> :: :// ------------------------------------------------------
> call :console.setAttrs( console.yellow, console.blue );
> :: :// ------------------------------------------------------
> :: :// Use "stdout.puts" to display more text.
> :: :// ------------------------------------------------------
> call :stdout.puts(" 'I am the last of my kind." nl);
> call :stdout.puts("Here you are, a human, come here to slay me?! I breathe" nl);
> call :stdout.puts("fire upon trees, rustling the bad kami out of the forests" nl);
> call :stdout.puts("and valleys of this forgotten world. I keep my peace inside" nl);
> call :stdout.puts("these caves, only to be disturbed by your species which" nl);
> call :stdout.puts("pollute this landscape! I was once happy in my silence" nl);
> call :stdout.puts("here, yet you come to make me miserable! I won't allow" nl);
> call :stdout.puts("it, knave! Prepare to feel my wrath!!!'" nl);
> :: :// ------------------------------------------------------
> :: :// Change foreground color to cyan, background to blue.
> :: :// ------------------------------------------------------
> call :console.setAttrs( console.cyan, console.blue );
> :: :// ------------------------------------------------------
> :: :// Use "stdout.puts" to display a brief message.
> :: :// ------------------------------------------------------
> call :stdout.puts("The dragon moves about angrily, stomping the floor!" nl);
> :: :// ------------------------------------------------------
> :: :// Change foreground color to white, background to blue.
> :: :// ------------------------------------------------------
> call :console.setAttrs( console.white, console.blue );
> :: :// ------------------------------------------------------
> :: :// Use "stdout.puts" to display another message.
> :: :// ------------------------------------------------------
> call :stdout.puts("What now, adventurer?" nl);
> :: :// ------------------------------------------------------
> :: :// End the program. Total lines: 75. Bytes: 3,895.
> :: :// ------------------------------------------------------
> :: :end west;
>
> goto :eof
>
> :stdout.puts
> set /a t=t+1
> set n=%*
> set n=%n:("=%
> set n=%n:"=%
> set m=%n: nl);=%
> if not "%n%"=="%m%" goto :nl
> set n=%n:);=%
> set /p m="%n%"<nul
> goto :eof
> :nl
> echo %m%
> goto :eof
>
>
> :console.setAttrs
> set n=
> call :colors %2
> set m=%n%
> call :colors %3
> if [%t%]==[0] goto :nowait
> if %t% LSS 3 set t=3
> if %t% GTR 6 set t=6
> ping -n %t% 127.0.0.1>nul
> :nowait
> color %m%%n%
> set t=0
> goto :eof
>
> :colors
> set n=0
> if [%1]==[console.white] set n=F
> if [%1]==[console.green] set n=A
> if [%1]==[console.blue] set n=9
> if [%1]==[console.yellow] set n=E
> if [%1]==[console.cyan] set n=B
> goto :eof
>
> :console.cls
> cls
> set t=0
> goto :eof

.



Relevant Pages

  • Re: GOTO vis-a-vis professional vs amateur programmers
    ... I trained dozens of programmers who were used to using GOTO all the ... A good programming language looks after a lot of those things. ... the language can protect you only to a certain point. ... You can practice and hone your skill in using the risky tool so ...
    (comp.lang.basic.misc)
  • Re: Obtaining Last Logon Time for Domain User
    ... Subject: Re: Last time each NT account was accessed ... > framework 1.1 to run this tool (you can get it from Windows Update). ... >> goto:EOF ...
    (microsoft.public.windows.server.active_directory)
  • Re: 7drl starting announcement
    ... I ran a BBS for awhile in the 90s and was known around my area code ... I wasn't very sophisticated myself in the area of programming, though, ... I still use goto sometimes today just to solve little problems that I ... what we consider programming language without sophisticated use of the ...
    (rec.games.roguelike.development)
  • Re: GOTO vis-a-vis professional vs amateur programmers
    ... My debugger doesn't need me to scroll. ... My programming language doesn't allow jumping in and from Function without ... Please use a good debugger and you won't fear any GOTO. ... PRINT "This is label Curly, ...
    (comp.lang.basic.misc)
  • Re: slightly OT: error handling conventions
    ... You've been programming since before assembly ... goto is not evil. ... Letz the compiler help you to find unsave, unsecure, ...
    (comp.lang.c)