Re: Article about HLA on Linux Journal's website





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:
>

Obee-tabee... that was easy to convert to batch b/c his example only
displayed text on the screen. But try something a little more
elaborate like:

\|||/
(o o)
+-oooO--(_)-------+
| |
| b2h.hla |
| |
+------------Ooo--+
|__|__|
|| ||
ooO Ooo

program b2h;
#include ("stdlib.hhf")

var

hIn :dword; // input file handle
hOut :dword; // output file handle
bBin :char; // input byte
bHex :char[2]; // output text

begin b2h;

arg.c(); // check command line arguments
if ( eax = 3 ) then

try

fileio.open(arg.v(1),fileio.r);
mov(eax, hIn);
fileio.openNew(arg.v(2));
mov(eax, hOut);
xor(edx, edx); // column count

forever

lea(ebx, bBin);
fileio.read(hIn, [ebx], 1);
if (fileio.eof(hIn)) then
break; // exit the loop at EOF
endif;
lea(ecx, bHex);
xor(eax, eax); // clear the workbench
mov([ebx], al);
push(ax);
shr(4, al); // convert H.O. nibble
if (al < 10) then
add($30, al); // '0 - 9'
else;
add($37, al); // 'A - F'
endif;
mov(al, [ecx]);
pop(ax);
and($0F, al); // convert L.O. nibble
if (al < 10) then
add($30, al); // '0 - 9'
else;
add($37, al); // 'A - F'
endif;
mov(al, [ecx + 1]);
fileio.write(hOut, [ecx], 2);
mov($20, al);
fileio.putc(hOut, al); // add ' ' spacing
inc(edx);
if (edx = 16) then // check for last column
xor(edx, edx);
mov($0D, al);
fileio.putc(hOut, al); // add CR/LF
mov($0A, al);
fileio.putc(hOut, al);
endif;

endfor;

mov($0D, al);
fileio.putc(hOut, al);
mov($0A, al);
fileio.putc(hOut, al);
fileio.close(hIn);
fileio.close(hOut);

exception(ex.FileOpenFailure);

stdout.put( "File Open Failure!" nl );

endtry;

else;

stdout.puts( nl "Binary File --> Hex File Convertor" nl nl );
stdout.puts( "USAGE: b2h <binfile> <hexfile>" nl nl);
stdout.puts( "EXAMP: b2h notepad.exe notepad.txt" nl );
stdout.puts( " OR: b2h con: myhex.txt" nl );
stdout.puts( " {use CTRL-C to exit}" nl );

endif;

end b2h;

Nathan.

.



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. ... Prev by Date: ...
    (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)
  • Re: Why There are no Asm Apps
    ... >> With HLA, ... > In the section on installing on Linux in the Reference Manual, ... HLA and its teaching approach for assembly language ...
    (alt.lang.asm)