Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

High Level Assembly

Hemos posted more than 10 years ago | from the for-the-insane-or-hardcore dept.

Programming 53

dunric writes "Randall Hyde has developed a programming language called High Level Assembly (HLA). It is a great way for new programmers to develop applications for both Windows and Linux. It works with a variety of assemblers, including Gas, Fasm, Masm and others. The website for Randy's HLA is located at: http://webster.cs.ucr.edu/"

Sorry! There are no comments related to the filter you selected.

I'll pass (5, Funny)

niff (175639) | more than 10 years ago | (#9295381)

i'm waiting for Microsoft ASM.NET

Re:I'll pass (1)

Tobias Luetke (707936) | more than 10 years ago | (#9296132)

You mean this :

http://www.viksoe.dk/code/asmil.htm [viksoe.dk]
<%@ page language="Asm80386" %>
<%
Str: DB "Testing...", 0

mov eax, -2
cmp eax, 2
jle Label1
xor eax, eax
Label1:
lea esi, Str
push esi
call "Response.Write(string)"
pop esi
%>
<br>EAX: <%= eax %>

FP!!!! (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#9295384)

Two FPs in 30 secondz, h0w c4n 1 l0z3?!? GNAA can suck my ass!

Re:FP!!!! (-1, Offtopic)

Anonymous Coward | more than 10 years ago | (#9295673)

mooooooron!

High Level Assembly (HLA) (5, Funny)

Red Pointy Tail (127601) | more than 10 years ago | (#9295385)

...also known as C.

Re:High Level Assembly (HLA) (0, Troll)

You're All Wrong (573825) | more than 10 years ago | (#9295665)

Nope, at least C looks like C.
HLA looks like, gag... gag... gag, Pascal!

Sorry, gotta go. Must evacuate...

YAW.

Re:High Level Assembly (HLA) (4, Insightful)

Tobias Luetke (707936) | more than 10 years ago | (#9296871)

I think this should be modded as Insightful not Funny....

With modern C compiles in place its all but impossible to write an entire project with faster code then the same program in C.
ASM is good to optimize some sections, but even that is questionable nowadays because its probably less expensive to get a faster computer then having a coder with great insight into ASM optimize a section of the code for a week.

Also C code can run on a cluster or super computer if required.

Re:High Level Assembly (HLA) (1)

LWATCDR (28044) | more than 10 years ago | (#9303255)

I have to say that I thought that c was supposed to be a High Level Assembly language. I can remember when c was dismissed because it was too low level. Ada was supposed to be the next big thing. Intel even tried to make an Ada Chip. Turned out c was the next big thing.

Re:High Level Assembly (HLA) (1)

huge (52607) | more than 10 years ago | (#9304622)

[...] because its probably less expensive to get a faster computer then having a coder with great insight into ASM optimize a section of the code for a week.
This is exactly the problem these days. People think so way without really considering the consequences.

If you have a moderate or a large project in corporate environment, or a project that is delivered to larger audience, it's not uncommon to have 10,000+ users.

Now think if you have to get a new PC for each and every user because you don't want to get someone to do the optimization. Even if the upgrade would cost only a $50 for PC, it still $500,000. That's hell of a pay for a weeks (or month) job.

Even in case of a corporate environment where the application might run on a centralized manner (mainframe, cluster, whatever), upgrading your mainframe or cluster just because of lack of optimization is outright stupid.

It might cost a little more for a company to begin with, but in the end it will be lot cheaper.

Re:High Level Assembly (HLA) (1)

Tobias Luetke (707936) | more than 10 years ago | (#9309134)

See I compleatly agree with you, but i also think that your argument is very Theoretical.

I just can't come up with a type of software which would trigger such a behaviour.
Honestly there are two types of applications which still hit computers hard: Math problem solving tools and computer games.

Games are a whole topic in themselves. Well optimized code is a feature which can cause more sells, so optimized asm code will have a home here for a long time. Math is usually so complex that you need infrastructure for clustering anyways ( think seti ) here hand optimized asm code can save you years in calculating. All other software which has business with bytecode ( ie you wouldn't write with java, .net or python ) is better off being written in C for protablility then optimized ( obfuscated ? ) in asm.

Re:High Level Assembly (HLA) (2, Interesting)

gfody (514448) | more than 10 years ago | (#9309162)

optimizing a section of code in asm is about what 99% of asm programmers do these days. code that requires such optimizations will always be around. typically any place you have an "inner loop" that could be nested within several outer loops that actually gets executed millions or billions of times.. that's when even a single redundant instruction or calculation that takes a few clock cycles can cost you seconds minutes or hours in the final execution time.

dsp and rendering are two areas I have experience optimizing inner loops for. sometimes you can split up the work at a higher level to run on seperate machines. sometimes you can't. it's _never_ a case of you could always split it up, and it would be easier than optimizing the inner loop in asm. most of the time figuring out how to split up a task to be executed on seperate machines is much more involved than optimizing redundant instructions out've an inner loop.

Re:High Level Assembly (HLA) (0)

Anonymous Coward | more than 10 years ago | (#9320407)

ASM is good to optimize some sections, but even that is questionable nowadays because its probably less expensive to get a faster computer then having a coder with great insight into ASM optimize a section of the code for a week.


Last time I checked, CPU speeds weren't increasing as rapidly as they used to. It used to be that CPU speeds doubled every couple of years. That hasn't happened recently (big news flash! Intel increases clock speed from 3.2 GHz to 3.4 GHz!).

Assembly language may not be the right way to create faster applications, but the lazy approach that programmers have used for the past three decades, waiting for faster hardware, seems to be coming to an end. Programming in assembly may be out of the question for real programming tasks, but learning assembly (which is really what HLA is all about) can help programmers write much more efficient code in the HLLs they choose to use.

Re:High Level Assembly (HLA) (0)

Anonymous Coward | more than 10 years ago | (#9347996)

You have a good point. One that escapes many for some reason.

NoDot
of the MASM Forum, Win32Asm Board, alt.lang.asm, and others

Re:High Level Assembly (HLA) (1)

FictionPimp (712802) | more than 10 years ago | (#9377182)

I personally found that learning assembly even the little bit that I know (i'm still strugling along with MMX and SSE) Improved my programming skills in other areas. I found myself thinking more about what I was writing and what was actully happening. And I started to document and structure my code better.

that was just my exp in it.

Re:High Level Assembly (HLA) (2, Informative)

Per Wigren (5315) | more than 10 years ago | (#9297150)

As the other poster said: Insightful, not Funny.

For example SmartEiffel [loria.fr] compiles Eiffel-code to assembly-like C-code and then compiles the C-code to executable code using an ANSI-C compiler. Smart and efficient way to make a new compiler produce extremly fast code and be crossplatform without an extra effort.

Re:High Level Assembly (HLA) (1)

warrax_666 (144623) | more than 10 years ago | (#9304612)

Smart and efficient way to make a new compiler produce extremly fast code and be crossplatform without an extra effort.


Except that the Eiffel->C translation effectively obliterates any chance of using the (presumably) much stronger semantics of Eiffel for optimizations which are not possible in C, due to the fact that a C compiler doesn't know about the semantics of Eiffel, and consequently cannot know of any "non-C" properties of the intermediate C program.

FAQ (3, Informative)

Fulkkari (603331) | more than 10 years ago | (#9295439)

...is something you should probably read. Link here [ucr.edu] .

Interesting project, but quite useless for us that prefer portability.

Re:FAQ (2, Insightful)

LordNimon (85072) | more than 10 years ago | (#9295973)

Portability in assembly language? Huh?

Re:FAQ (0)

Anonymous Coward | more than 10 years ago | (#9320325)


Portability in assembly language? Huh?


Well-written HLA programs, like well-written C programs, are immediately portable between Linux and Windows. All that's required (just like C), is to recompile the source file under the other operating system.

Of course, the code will only run on a Pentium processor (or an emulator), but portability has many dimensions. One aspect of portability is portability between operating systems, which HLA achieves through the use of its library code.

Re:FAQ (2, Interesting)

aminorex (141494) | more than 10 years ago | (#9296785)

For some of us, the ability to use assembly-language
to optimize critical sections on sensitive platforms
or to access memory-mapped hardware registers
is the sine qua non for the very option of
writing portable code. Absent this ability, we'd
have to write entire systems in low-level asm.

....meanwhile in other news...... (2, Interesting)

MrIrwin (761231) | more than 10 years ago | (#9295445)

....Sun students get to perfect thier cross platform techniques by programming the JVM natively.

BTW, PLC's are commonly programmed in "assembler", but the industrial automation worlds idea of Assembler is remarkebly similar to this HLA.

Relax, it's a teaching tool... (3, Informative)

Cragen (697038) | more than 10 years ago | (#9295944)

HLA was created to help make teaching assembly language easy (for both instructors and students). This paper describes the features of HLA that make it suitable for teaching assembly language programming.

Kinda like MIPS/SPim. Assembly: The Anti-Java language. (Haven't decided if that is a comment or compliment...)

Oldbie.

Re:Relax, it's a teaching tool... (3, Interesting)

Anonymous Coward | more than 10 years ago | (#9296744)

Exactly like SAL (Simple Assembly Language). MIPS/Spim is a processor/assembly language (MIPS) and an assembler and emulator (Spim). Spim is a great tool in itself. SAL was added onto Spim as a teaching tool.

We (Goodman [wisc.edu] , et al) designed SAL back in 1990 when the CS354 Computer Organization and Programming was moved from VAX. I was a TA at the time and added the SAL code onto Spim.

Re:Relax, it's a teaching tool... (1)

calica (195939) | more than 10 years ago | (#9297514)

I took CS354 with Goodman back in 92. Very good class and teaching tool.

Re:Relax, it's a teaching tool... (2, Interesting)

schwaang (667808) | more than 10 years ago | (#9297760)

In my day, we learned MIC-1 and MAC-1 from Tanenbaum's book "Structured Computer Organization", and we liked it.

Google tells me the kids use java to simulate [highpoint.edu] it now.

Re:Relax, it's a teaching tool... (1)

PorkCharSui (583216) | more than 10 years ago | (#9300958)

We're learning an even simpler language in my machine dependent programming class at UCD. It is called CUSP and was originally programmed in Pascal back in the late 80s/early 90s :-/

Our latest project is PacMan in assembly. It's already at 1000 lines of code and the ghosts don't even have an AI moving routine yet.

Re:Relax, it's a teaching tool... (1)

Claire-plus-plus (786407) | more than 10 years ago | (#9364779)

Is that surposed to make it better? Have you forgotten Pascal and BASIC? "Teaching" languages are often so bad that they make people worse programmers. Make people learn ASM the hard way, like I did, and they will thank you for it (as soon as they stop trying to kill you long enough to realise they have learned the language).

Wow that's gross (4, Informative)

p3d0 (42270) | more than 10 years ago | (#9296322)

Take a look at the sample programs [ucr.edu] .

Teaching? Yes. Applications? Er.. why? (4, Insightful)

EnglishTim (9662) | more than 10 years ago | (#9296378)

I'm sure it's a great teaching tool for learning assembler, and if you need to do a bit of assembler for some reason, cool.

However, using it to teach new programmers how to program applications? Why?

It's

a) Harder to learn than a High Level Language.
b) Takes a lot more work to get anything done when compared to High Level Languages.
c) Is much less use in a working envronment than knowledge of a High Level language is.

Re:Teaching? Yes. Applications? Er.. why? (3, Interesting)

Monkelectric (546685) | more than 10 years ago | (#9296902)

That's the question nobody can answer. I have quite alot of experience with the author, Randall Hyde, and can tell you in no uncertain terms he beyond a brilliant programmer. He also suffers from some kind of pathology such as megalomania or manic depressive disorder.

Nobody can answer the question -- why do you need a language that has none of the advantadges of assembley, AND none of the advantadges of a higher level language?

Re:Teaching? Yes. Applications? Er.. why? (1)

MilenCent (219397) | more than 10 years ago | (#9397752)

I haven't read the whole site yet (I got a Spanish paper due in an hour, yikes!), but from what I can tell the idea is to give the user all the advantages of assembly with some of the advantages of compiled languages.

I have to say, I could really groove on this.

Re:Teaching? Yes. Applications? Er.. why? (4, Insightful)

Anonymous Coward | more than 10 years ago | (#9297246)

I'm sure it's a great teaching tool for learning assembler, and if you need to do a bit of assembler for some reason, cool.

However, using it to teach new programmers how to program applications? Why?


For the same reason it's valuable for programmers to know any language other than the one their company uses. Because teaching someone to write applications isn't the same as teaching them to program.

This language is basically like C but more so: nobody in their right minds would consider using it for a major project, but it's very useful to have some idea of how this stuff really works.

I assure you, the moment I discovered what a 'for' loop compiled to, that was like a lightbulb going on in my head: suddenly programming made sense instead of just being about typing mystical formulae. Since then, sure, I've never touched ASM again, and these days I work almost entirely in functional languages that end up being a million miles away from the hardware, but I don't think I wasted my time when I did learn ASM.

Re:Teaching? Yes. Applications? Er.. why? (1)

man_ls (248470) | more than 10 years ago | (#9302996)

" " This language is basically like C but more so: nobody in their right minds would consider using it for a major project, but it's very useful to have some idea of how this stuff really works. " "

Tell that to the Linux Kernel developers.

Structured assembly language not new (3, Interesting)

waterbear (190559) | more than 10 years ago | (#9297465)

HLA looks like a complex programming environment.

Assuming a common role of assembler, to fine-tune a critical smallish bit of code, I can see the convenience of having a higher level than normal of language constructs. It can make the flow of logic more transparent, (e.g. nestable conditional blocks, loops with readable criteria, repeat-until, do-while, switch/case structure, etc).

On the other hand, providing this kind of pseudo-high level language structure in assembler programs has been around a long time, and can be done more simply. I still have an assembler macro library around that in its original version (circulated on 80s bbs networks) did this for at least some early versions of MASM and TASM.

(Most of the identifiers would probably have to be changed for compatibility with newer assemblers because it used non-standard initial characters to enable constructs looking a bit like (ignore the 1--- 's, they just adjust formatting in the Slashdot editor)

1---- .if (test)

1---- .orif (another test)

1------ (whatever code)

1---- .else

1-------- .while (yet another test)

1----------- (whatever other code)

1-------- .endwhile

1---- .endif

and suchlike constructs).

As I first read it, it was a macro library carrying a by-line from 'Jim Holtman, 1982'. It was not very big, the whole thing (even after some more macros for other logic-extensions were added)came to an include-file size of no more than about 10 kb.

Maybe it's not clear why anything bigger would be needed.

-wb-

Re:Teaching? Yes. Applications? Er.. why? (0)

Anonymous Coward | more than 10 years ago | (#9320156)

You might be interested in Mr. Hyde's views on using assembly as an application development tool in this article he wrote: http://www.onlamp.com/pub/a/onlamp/2004/05/06/writ egreatcode.html Be sure to read the whole article. It's pretty clear most of the people posting response have only read the title before embarassing themselves with their responses. To cut to the chase, there is a line in this article where Mr. Hyde suggests that it would be foolish for people to write applications in assembly language. Have a Nice Day, Anonymous Cowards, anonymous

HLA and Art of Assembly (4, Informative)

Dayflowers (729580) | more than 10 years ago | (#9296747)

This is hardly news to anyone. If my memory doesn't fail me, that has been around for at least two years. And if you were ever into assembly or even just curious, you were bound to stumble uppon the Art of Assembly (his book, a must read when learning assembly) and his site. Its not like HLA was any secret of even hidden in some obscure webpage...

Re:HLA and Art of Assembly (0)

Anonymous Coward | more than 10 years ago | (#9312613)

If anything, the site has more content than it did a few years ago (as one would figure), as its no longer just Windows specific. That said, the new things aren't exactly worthy of slashdot attention.

Randall Hyde's long-term project ... (5, Informative)

Chromodromic (668389) | more than 10 years ago | (#9296817)

Actually, HLA ain't nothing new, and if you've been doing any hanging out on comp.lang.asm then you've seen his name popping up on posts about every single day, several times per day, promoting HLA and helping newbies for years now.

I downloaded his book, "Art of Assembly Language" (avail. at No Starch, http://www.nostarch.com/) a couple of years ago before it had been published by No Starch and it's well written, still available for free either HTML [ucr.edu] , or PDF [ucr.edu] .

If you're using Windoze then it's definitely worth checking out the excellent RadASM [visualassembler.com] assembly language IDE for Windows, which is itself written in assembly, and also supports HLA. Randall Hyde devotes a chapter somewhere, either in his book or on his site, I can't remember, to configuring and using RadASM.

One of the posts has questioned the value of teaching assembly to newbies, but I think there's a huge value for serious students. It's hard to appreciate garbage collection, for one, until you've had to pick up your own memory trash. But more importantly, most compilers out there output to some intermediary assembly language, and understanding the inner workings of your processor, your compiler and your own programs is one essential difference between being, well, a hack and being really, really good. There are other differences, to be sure, but that's one.

I haven't been a huge fan of HLA myself for various, and admittedly completely arbitrary reasons. But Randall Hyde has put megatons of work into his stuff, doing some extremely impressive things, and he's always ready and willing to be helpful on the newsgroups, so if you have an interest then I would probably go to his site and to comp.lang.asm before I went anywhere else. Anyone stands to learn a ton.

Re:Randall Hyde's long-term project ... (1)

hobo2k (626482) | more than 10 years ago | (#9297123)

It's hard to appreciate garbage collection, for one, until you've had to pick up your own memory trash
Well yes, they did teach us C at my school.

But our coverage of assembler was limited (not a full course). Just implementing some functions, called by C. And analysing the output of various compilers and flags. The focus was just on the performance tricks.

wow, displays (1)

scrytch (9198) | more than 10 years ago | (#9296969)

I noticed its standard calling convention is to use the x86 ENTER/LEAVE instructions. From what I've seen of other programs, this convention is certainly ... unique. Every compiler I've seen handles the stack manually and doesn't use these instructions, which do a lot of scoping work for you in the form of a data structure called a display. It looks neat, but HLA has got to be the only compiler I've seen that uses it. My guess is that it doesn't by itself support a jump to a procedure, that it simply creates a nested scope, something that shouldn't even be necessary when you do some basic static analysis. Am I completely wrong here? Does anything else out there actually make good use of displays?

Re:wow, displays (2, Interesting)

Anonymous Coward | more than 10 years ago | (#9298740)

It's been about 10 years since I've written a compiler, but displays are an optimization for statically scoped languages that allow nested procedures. Examples of static scoping with nested procedures are Pascal and Java. Your call stack may be 100 levels deep, but a procedure nested 3 deep only ever needs to look at 3 of those entries to resolve variables. A display lets you access those variables without walking the entire call stack. You can't just statically analyze your way around that problem. If you've been looking at C compilers then it's a different story since they don't allow nesting.

Re:wow, displays (1)

scrytch (9198) | more than 10 years ago | (#9298917)

A display lets you access those variables without walking the entire call stack. You can't just statically analyze your way around that problem. If you've been looking at C compilers then it's a different story since they don't allow nesting.

I admit it, it's from looking at C. Anything I've looked at that's allowed nested functions has tended to be high enough level that they're implemented on a virtual machine of some sort, so they do walk either their own stack of activations or the C stack. Thanks for clearing it up.

Re:wow, displays (0)

Anonymous Coward | more than 10 years ago | (#9320080)

Actually, HLA does not use ENTER/LEAVE instructions by default. There are some options (@ENTER and @LEAVE) that you can use to enable these instructions in the code that builds a stack frame, but the default setting is for HLA to emit discrete instructions to build a display. Of course, HLA also provides an option that turns off automatic code generation for stack frames so that the programmer has to manually write the code; this is for those who prefer to be in complete control of the code generation process. Very few people use nested procedures. The common coding style seems to be to write "flat" code like they were writing BASIC or C/C++ code. As such, most HLA programs would probably want to use the @nodisplay and @nostackalign options and skip the code generation for displays entirely. Most of this information can be found at the following URL: http://webster.cs.ucr.edu/AsmTools/HLA/WhitePapers /DoingUnits.html

High Level Assembler for JVM use (3, Informative)

astrojetsonjr (601602) | more than 10 years ago | (#9297808)

If you are looking for a High Level Assmebler that generates Java Byte Code look at Jamaica. It allows Java control structures around the byte code. It is simple to use and has some very good documentation. Jamaica (on the Judoscript site) [judoscript.com]

Finally! (1)

LazyBoy (128384) | more than 10 years ago | (#9298580)

... a "way for new programmers to develop applications for both Windows and Linux"!!! Why didn't anyone think of this sooner!

I did this independently 20 years ago. (2, Interesting)

Anonymous Coward | more than 10 years ago | (#9300024)

I used to program a computer which only had BASIC (a Sinclair ZX-81 like).

After some time, I decided hex codes sucked big time. So I decided to code an assembler in BASIC.

Also, I always found assembly syntax awkward... so instead of:

LD HL, DE

I would write:

HL := DE

Pascal-like, but no semicolon at the end. Memory references were like:

A := MEM[HL] .... equivalent to LD A,(HL)

JMPs were written as GOTO, while conditional branches were written as:

IF A <> 0 THEN GOTO LABEL, meaning JNZ LABEL.

EQUs were CONSTS, DWs were INTEGERS, DBs were CHAR (or BYTE, more probably).

I had a lot of fun.

The first thing I wrote was the assembler itself, just changing the BASIC commands to my above described lingo.

It took the BASIC program one entire hour to "assemble" it. Later, I used the same code thru the newly generated assembler. It was assembled in nearly 60 seconds.

At first, I thought it had failed... :-)

Those were the good times...

Re:I did this independently 20 years ago. (1)

turgid (580780) | more than 10 years ago | (#9301974)

Do you mean, "like, a Sinclair ZX81" or "like a Sinclair ZX81?" :-)

You must have had the patience of a saint to do such programming on such a machine and good enough humour to be able to live with the cassette interface. :-)

Re:I did this independently 20 years ago. (0)

Anonymous Coward | more than 10 years ago | (#9347422)

>> Do you mean, "like, a Sinclair ZX81" or "like a Sinclair ZX81?" :-)

Exactly like a Sinclair ZX81: it was a clone, same horrible membrane keyboard and all.

>> You must have had the patience of a saint to do such programming on such a machine and good enough humour to be able to live with the cassette interface. :-)

20 years ago I was young, poor and, besides, the cassette wasn't all that bad... and I was doing that out of love, just like linux coders do it nowadays.

It was fun, not a suffering.

Re:I did this independently 20 years ago. (0)

Anonymous Coward | more than 10 years ago | (#9347908)

You must admit that that is funny. It was a magnitude of 60 faster. I was laughing for at least a minute. LOL

NoDot
of the MASM Forum, Win32Asm Board, alt.lang.asm, and others

Time machine? (1)

Theatetus (521747) | more than 10 years ago | (#9300809)

Hey! Look everybody! Larry Wall has invented a language called Perl [perl.org] ! It's great for extracting reports from text.

Randall put this out like almost 3 years ago. And frankly I find HLA more confusing than as or nasm.

Pointless. (1)

warrax_666 (144623) | more than 10 years ago | (#9304703)

Surely the whole point of using assembly is that you can optimize specifically for the platform (otherwise why not just use C?).

But if it has to be "High-Level", then that implies that you cannot get access to or exploit the particulars of the underlying platform. E.g.: Optimal instruction scheduling, pipeline depths are different from platform to platform, so how you accomodate that? If this is just about generating assembler specifically for each platform from a "template", then why not just use a generic macro language?

HLA seems utterly pointless to me.

Re:Pointless. (0)

Anonymous Coward | more than 10 years ago | (#9320356)

But if it has to be "High-Level", then that implies that you cannot get access to or exploit the particulars of the underlying platform.

Having high-level features does not imply that you cannot gain access to the particulars of the underlying platform. HLA allows a programmer to write code as "low-level" as they desire. It simply provides some high-level features that help students learn assembly language faster by using statements similar to the high-level languages they know already. As time progresses, presumably those students learn how to replace the high-level statements with their low-level equivalents.

Old news (0)

Anonymous Coward | more than 10 years ago | (#9308188)

He made this a very long time ago to simplify assembler for beginers. This is OLD. Your not getting the point. This is not something that's supposed to replace C or anything, just help people learn assembler.
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?