Assembly code

From Esolang
Jump to navigation Jump to search
Not to be confused with assembly language, machine code, nor Assembly.

Assembly code is a notation for machine code designed to aid readability. A machine code instruction consisting of binary digits representing an operation and possibly addresses or integers is represented by a mnemonic code representing the operations, and labels or numerals representing addresses or integers. Assembly codes differ from other programming languages in that the relationship between an assembly code and its machine code form is direct, making the implementation of a compiler - known as an assembler - in machine code straightforward.

As is the case with machine code, any programming language can be regarded as assembly code for a hypothetical machine with machine code instructions corresponding directly to the instructions of the language, but this concept is usually reserved for esoteric programming languages for which a compiler to an existing machine code is very small, such as Brainfuck (whose 680x0 compiler was 240 bytes in size).

Some Example

Example01:

ASSUME CS:CODESG
CODESG SEGMENT
START:
    MOV AX, 0123H
    MOV BX, 0456H
    ADD AX, BX
    ADD AX, AX
    
    MOV AH, 4CH
    INT 21H
CODESG ENDS
END START


See also