Professional Documents
Culture Documents
Assembly Language
Dr. Irfan Yousuf
Department of Computer Science (New Campus)
UET, Lahore
(Lecture # 3; October 5, 2020)
Outline
• Previous Lecture(s)
• Data Representation & Number Systems
• Data Organization
Previous Lecture(s)
• Computer Organization
• Central Processing Unit (Control Unit & Arithmetic and Logic Unit)
• Memory
• I/O subsystem
• Binary Numbers
• 1s and 0s
• Assembly Language
• Machine Language
• Assembler
Data Representation
• Computer systems do not represent numeric values using the decimal system.
• Instead, they use Binary system, i.e., 0s and 1s
MSB LSB
Word
• A word is a group of 16 bits.
• It can represent 216, or 65,536, different values. (0 to 65,535)
• The bits in a word are normally numbered from zero to fifteen (right to left).
Double Word
• A double word is exactly what its name implies, a pair of words. Therefore, a
double word quantity is 32 bits long.
• It can represent 232, or 4,294,967,296 different values. (0 to 4,294,967,295)
• The bits in a word are normally numbered from zero to thirty-one (right to left).
Arithmetic of Number Systems
• Re-vise basic arithmetic operations for
• Decimal, Binary and Hexadecimal Numbers
Instruction Format
• Computers perform tasks on the basis of instructions provided.
• An instruction in computer comprises of groups called fields.
• An instruction is of various length depending upon the number of addresses it
contains.
• 3-address
• 2-address
• 1-address
• 0-address
3- address Instruction Format
• It has one opcode and three address fields.
• One address field is used for destination and two address fields for source
ADD X, A, B
MUL Y, A, B
2- address Instruction Format
• It has one opcode and two address fields.
• One address field is common and can be used for either destination or source and
other address field for source.
ADD A, B
MUL A, B
1- address Instruction Format
• It has only two fields. One for opcode and other for operand.
• One Operand is in Accumulator (AC) and the other is in register or memory
whose address is given in the instruction.
PUSH A
PUSH B
ADD
Summary
• Number Systems
• Data Organization
• Instruction format
Questions?