ArticleslgStudy

computer science

High Level Assembly

High Level Assembly is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand High Level Assembly rather than just read about it. In short: High-Level Assembly (HLA) is a language developed by Randall Hyde that enables the use of higher-level language constructs to aid both novice and experienced assembly developers. It supports advanced data types and object-oriented programming.

Key takeaways

  • High Level Assembly belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect High Level Assembly to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of High Level Assembly from memory before moving on to harder problems.

Reference excerpt

High-Level Assembly (HLA) is a language developed by Randall Hyde that enables the use of higher-level language constructs to aid both novice and experienced assembly developers. It supports advanced data types and object-oriented programming. Its syntax is loosely based on several high-level programming languages (HLLs), such as Pascal, Ada, Modula-2, and C++, to facilitate the creation of readable assembly language programs and enable HLL programmers to learn HLA quickly.

Origins and Goals HLA was initially designed as a tool for teaching assembly language programming at the college and university level. The objective was to leverage students' existing programming knowledge to accelerate their learning of assembly language. Most students in assembly language programming courses are already familiar with high-level control flow structures like IF, WHILE, and FOR. HLA allows students to immediately apply this knowledge to assembly language coding early in the course. This enables them to master other prerequisite subjects in assembly before learning how to code low-level forms of these control structures. The book The Art of Assembly Language Programming by Randall Hyde utilizes HLA for this purpose.

High vs. low-level assembler HLA v2.x supports the same low-level machine instructions as a regular low-level assembler. High-end assemblers also support high-level-language-like statements (such as IF and WHILE) and more advanced data declaration directives, including structures-records, unions, and even classes. Examples of high-end assemblers include HLA, Microsoft Macro Assembler (MASM), and Turbo Assembler (TASM) on the Intel x86 processor family. Unlike most other assembler tools, the HLA compiler includes a Standard Library with thousands of functions, procedures and macros that can be used to create full applications with the ease of a high-level language. While assembly language libraries are not new, a language that includes a large standardized library encourages programmers to use library code rather than writing their own functions. HLA supports all the same low-level machine instructions as other x86 assemblers. Furthermore, HLA's high-level control structures are based on those found in MASM and TASM, whose HLL-like features predated HLA by several years. In HLA, low-level assembly code can be written just as easily as with any other assembler by ignoring the HLL control constructs. Unlike HLLs like Pascal and C(++), HLA does not require inline asm statements. HLA's HLL-like features provide a learning aid for beginning assembly programmers by easing the learning curve, with the expectation that they will discontinue using those statements once they master the low-level instruction set. In practice, many experienced programmers continue to use HLL-like statements in HLA, MASM, and TASM long after mastering the low-level instruction set, typically to improve readability. It is also possible to write high-level programs using HLA, which reduces the tedium of low-level assembly language programming. Some assembly language programmers reject HLA outright because it allows programmers to do this. However, supporting both high-level and low-level programming gives any language a broader range of applicability.

Distinguishing features Two HLA features distinguish it from other x86 assemblers: its powerful macro system (compile-time language) and the HLA Standard Library.

Macro system HLA's compile-time language allows easy extension of the language, even enabling the creation of small domain-specific languages to simplify common programming problems. The macro stdout.put is a good example of a sophisticated macro that can simplify programming. Consider the following invocation of that macro: stdout.put( "I=", i, " s=", s, " u=", u, " r=", r:10:2, nl ); The stdout.put macro processes each argument to determine its type and then calls an appropriate procedure in the HLA Standard Library to handle the output of each operand. Most assemblers offer some macro capabilities. HLA's advantage over other assemblers is its ability to process macro arguments like r:10:2 using HLA's extensive compile-time string functions. HLA's macro facilities can also infer variable types and use that information to direct macro expansion. HLA's macro language provides a special Context-Free macro facility. This feature allows easy writing of macros that span other code sections via a starting and terminating macro pair (along with optional intermediate macro invocations available only between the start–terminate macros). For example, one can write a fully recursive-nestable SWITCH–CASE–DEFAULT–ENDSWITCH statement using this macro facility. Because of the HLA macro facilities' context-free design, these switch..case..default..endswitch statements can be nested without conflicting code emission.

Compile-Time Language The HLA macro system is a subset of the larger HLA Compile-Time Language (CTL). The HLA CTL is an interpreted language available within an HLA program source file; hence the name compile-time language. The HLA CTL includes control statements such as #IF, #WHILE, #FOR, #PRINT, and an assignment statement. One can also create compile-time variables and constants, including structured data types like records and unions. The HLA CTL also provides hundreds of built-in functions, including a rich set of string and pattern-matching functions. The HLA CTL allows programmers to create CTL programs that scan and parse strings, enabling the creation of embedded domain-specific languages (EDSLs, also termed mini-languages). The stdout.put macro mentioned earlier is an example of such an EDSL. The put macro (in the stdout namespace, hence stdout.put) parses its macro parameter list and emits the code that will print its operands.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with High Level Assembly

Start with the simplest possible case. Write down what High Level Assembly claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to High Level Assembly before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about High Level Assembly ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of High Level Assembly

In research
High Level Assembly appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses High Level Assembly in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
High Level Assembly is common in secondary-school and first-year university syllabi. It links to neighbouring topics Assemblers, Assembly languages, High-level programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for High Level Assembly outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “High Level Assembly” →

How to study High Level Assembly in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what High Level Assembly means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain High Level Assembly out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is High Level Assembly in simple terms?

High-Level Assembly (HLA) is a language developed by Randall Hyde that enables the use of higher-level language constructs to aid both novice and experienced assembly developers. It supports advanced data types and object-oriented programming.

Why does High Level Assembly matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study High Level Assembly?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on High Level Assembly.

Tags

  • Assemblers
  • Assembly languages
  • High-level programming languages
  • Public-domain software

Keep exploring