Re: Article about HLA on Linux Journal's website



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: Article about HLA on Linux Journals website
    ... |> It's about HLA and assembly language. ... | this is batch programming and not assembly programming. ... A green dragon approaches, ... across the landscape, plunging it into darkness! ...
    (alt.lang.asm)
  • Re: Article about HLA on Linux Journals website
    ... Herbert Kleebauer wrote: ... >> It's about HLA and assembly language. ... > this is batch programming and not assembly programming. ...
    (alt.lang.asm)
  • HLA History
    ... The Self-proclaimed "assembly language historian" ... High-Level Assembler. ... HLA *has* been around long enough now ... using MASM 6.1. ...
    (alt.lang.asm)
  • Re: TMA Assembler?
    ... I wish I was as good as Rene in ASM, but there is still some way to go, ... If "I am HLA" then I'm definitely the one to argue with. ... The actual assembly language ...
    (alt.lang.asm)
  • Re: .EXE -> .ASM -> .EXE
    ... Are you saying that some people have trouble learning assembly language ... HLA from an experienced HLA programmer and see what happens. ... AoA has nothing to do with HLA. ... typical user trying to learn RosAsm. ...
    (alt.lang.asm)