Custom Search

Assembly language

An assembly language is a low-level programming language.  It is a 'second-generation programming language', or 2GL. It is used to program microprocessors and microcontrollers for computers and many other 'computerised' products' - automatic washing machines etc.

Assembly languages have the same structure and set of commands as machine code languages, but they enable a programmer to use names instead of numbers. They are therefore easier for the human brain to cope with.

Each type of CPU has its own machine language and assembly language, so an assembly language program written for one type of CPU won't run on another.

MIPS is a commonly used assembly language dialect. Each CPU type has a different instruction set but there's enough commonality that once you learn one dialect of Assembly (MIPS ibeing most common on courses today) the others should be easy to pick up.

Assembly commands relate to the machine code needed to operate the appliance. These are usually defined by the hardware manufacturer, and based on mnemonics that symbolize processing steps (instructions), processor registers, memory locations, and other language features.

An assembler is used to translate assembly language statements into the computer's machine code. The assembler takes each mnemonic statement and translates them in turn directly into machine instructions and data. This is in contrast with high-level languages, in which a single statement generally results in many machine instructions.

When you have finished studying the manufacturers specifications you write your assembly program. You then 'run' the assembler and it translates your code into machine code. That relates to the electronic circuitry and makes the computerised element perform the task you wrote into the program. (But usually it first lists errors you have made. Assembly language is NOT easy to write programs in. That is why high level programs were developed!)

In the early days of programming, all programs were written in assembly language. Now, most programs are written in a high-level language - which, ideally, are portable and easier to write programs in.

Programmers still use assembly language when speed is essential or when they need to perform an operation that isn't possible in a high-level language.

See here for a MIPS tutorial