Learning assembly, is HLA suitable for modern hardware

Started by ltwinner, October 09, 2009, 11:59:31 AM

Previous topic - Next topic

ltwinner

Ive started learning assembly with the HLA guide but some of the programs are not working for me. They compile ok but do no run properly. I tried copying and pasting the code directly from the guide but the results were still the same. So I'm wondering if there is a problem in that HLA doesn't work correctly on modern hardware?

I am currently on this page -

http://homepage.mac.com/randyhyde/webster.cs.ucr.edu/www.artofasm.com/Windows/HTML/HelloWorlda4.html#999157

The charInput and intInput programs are not working properly.

The charInput program is supposed to list out values from 14 down to 1 and then ask you if you want to repeat the process. However for me it just displays a '14' then it keeps printing out '2' non-stop until I press ctrl+c to break execution of the program.

The intInput program asks for 3 integers of different sizes, between -128 and +128, between -32768 and +32767, and between - and + 2 billion. It then displays them back to you.
However no matter what numbers I input what gets displayed back to me is:
8-bit integer: 4
16-bit integer: 17
32-bit integer: -536608752

The code has been copied and pasted directly from the page itself so I can't see how it could be a code fault.

ltwinner

I made simple program here to demonstrate the problem. I've attached a screenshot that shows the code and the output from the program. Anyone able to tell me what's going wrong?



brethren

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

static
counter: int16;

begin numtest;

mov(4, counter);

while(counter > 0 ) do

stdout.puti16(counter);
sub(1, counter);
endwhile;

end numtest;



it works if you use static instead of var for the data section(tested in linux). i have no idea why var doesn't work

using var it just spits out 4 then 2502 2502 2502 2502....................................on and on

btw i'm using the latest version 2.2


ltwinner

I uninstalled hla and downloaded and installed version 2.3 and tried again and the problem still occurs.

I then tried using static instead of var as suggested by brethren and it now works correctly.

I'm not sure if I should continue to use the guide tho, as if there are bugs in hla that are preventing some of the most basic examples in the guide from working correctly am I wasting my time?


Sevag.K

Quote from: ltwinner on October 10, 2009, 12:45:02 PM
I uninstalled hla and downloaded and installed version 2.3 and tried again and the problem still occurs.

I then tried using static instead of var as suggested by brethren and it now works correctly.

I'm not sure if I should continue to use the guide tho, as if there are bugs in hla that are preventing some of the most basic examples in the guide from working correctly am I wasting my time?



That is strange since I'm not getting that error on my machine.  If you type hla with no arguments, you should be getting this for the version number:

Version 2.3 build 1749 (prototype)

brethren

yes, itwinner, the bug is now fixed in 2.3(just tested it out) and you can use var now

the latest versions of hla are in constant development and small bugs are bound to occur in such an intense development cycle, maybe you should use the stable version recommended for use with the no starch press version of ArtofAssembly version 1.99 (i think)


also he's releasing a new Art of Assembly soon and that why i think hes putting so much intense development into hla

maybe thats why his book release date keeps slipping, lol

keep up the good work randy, we assembly freaks lluv ya