Assembly Language and Assemblers

• Assembly language - we can think of as a language that is "human-readable machine language."
• Each assembly language instruction generally corresponds to one machine language instruction.
• To convert a program written in assembly language we use a translator called "an assembler"
• Assemblers were the first of "symbolic" language translator written for a computer by Nathaniel Rochester of IBM in 1953, though the idea precedes this date.

This particular assembly language describes a virtual machine (VM) with the following characteristics:

• Each word in the machine is two bytes long, and thus instructions and data are to be placed in even numbered memory locations.
• Instructions in this VM contain an opcode and single operand.
• The ALU of the VM contains only one register (named R) which is the second operand in many arithmetic instructions.
• It is assumed that the first instruction to be executed in each program is in location 00000.
• Instructions are executed in sequence (that is the PC is incremented by 2 normally) unless the instruction specifically alters the PC.
• Data is represented in 2's complement notation.

 BINARY OP CODE INSTRUCTION MEANING CON() = "contents of" 0000 LOAD X CON(X) -> CON(R) 0001 STORE X CON(R) -> CON(X) 0010 CLEAR X 0 -> CON(X) 0011 ADD X CON(R) + CON(X) -> CON(R) 0100 INCREMENT X CON(X) + 1 -> CON(X) 0101 SUBTRACT X CON(R) - CON(X) -> CON(R) 0110 DECREMENT X CON(X) - 1 -> CON(X) 0111 COMPARE X IF CON(X) > CON(R) THEN CON(GT) <-1 ELSE CON(GT) <- 0 ... SAME FOR EQ & LT 1000 JUMP X X -> CON(PC) 1001 JUMPGT X IF CON(GT) = 1 THEN X -> CON(PC) 1010 JUMPEQ X IF CON(EQ) = 1 THEN X -> CON(PC) 1011 JUMPLT X IF CON(LT) = 1 THEN X -> CON(PC) 1100 JUMPNEQ X IF CON(EQ) = 0 THEN X -> CON(PC) 1101 IN X CON(IN) -> CON(X) 1110 OUT X CON(X) -> CON(OUT) 1111 HALT STOP

Distinguish between an ASSEMBLER and a COMPILER or INTERPRETER

CS1104 Main Page
Last Updated 2001/10/15
© L.Heath, 2000, extensively updated by J.A.N. Lee, 2001.