Jonathan A. Titus

Microcomputer Pioneer

Home Jon Titus Mark-8 Lessons Timeline Links Comm Board About









Lesson 8: Assembly Language

Being a low level language, Assembly is a prime language to use in the programming directly onto the processor. This language consists of basic statements, known as instructions, and is very simple to understand. These statements usually consist of an opcode (the task that needs to be done), and if needed, operands. Generally, an opcode is a symbolic name for a single executable machine language instruction

In addition to codes for machine instructions, assembly languages have extra directives for assembling blocks of data, and assigning addresses locations for instructions or code. These directives usually have simple symbolic capability for defining values as symbolic expressions which are evaluated at assembly time, making it possible to write code that is easier to read and understand.

Directives are very important to assembly language, they include such topics as include directives to the assembler, directives to the linker, directives for organizing data space, and macros.

Directives differ based on which processor you are working with but tend to remain similar across platforms. For the SX-28 processor, used for the XGameStation PicoTM case study, directives were used to make the coding of the program easier along with making it readable. Below are some examples of simple directives and their use:

An if else selection structure:

IF condition
Statement
Else
Statement
EndIF

A loop structure:

Top
Code statement
Loop Top

These directives make programming in assembly language much easier for the programmer. The assembler will automatically decode the opcode into their machine language equivalence. The SX-28 uses special directives to control certain aspects of the processor that are not found in some other assembly languages. These directives, such as freq which controls the frequency at which the program runs the oscillator, are important for making any code run properly on the SX-28.