L1-introduction to assembly language programming
L1-introduction to assembly language programming
BY
J. Marwa
Prerequis
ite
• Before proceeding with this unit, you should have a basic understanding of
Computer Programming terminologies.
• So, the low-level assembly language is designed for a specific family of processors
that represents various instructions in symbolic code and a more understandable
form.
Advantages of Assembly
Language
An understanding of assembly language provides knowledge of:
Table 1: The following table shows the positional values for an 8-bit binary number, where all bits are set on.
The Hexadecimal Number
System
• Hexadecimal number system uses base 16.
• The digits range from 0 to 15.
• By convention, the letters A through F is used to represent the hexadecimal digits corresponding to decimal
values 10 through 15.
• Main use of hexadecimal numbers in computing is for abbreviating lengthy binary representations
• To convert a binary number to its hexadecimal equivalent, break it into groups of 4 consecutive groups each,
starting from the right, and write those groups over the corresponding digits of the hexadecimal number.
Example: Binary number 1000 1100 1101 0001 is equivalent to hexadecimal - 8CD1
• To convert a hexadecimal number to binary just write each hexadecimal digit into its 4-digit binary
equivalent.
Example: Hexadecimal number FAD8 is equivalent to binary - 1111 1010 1101 1000
Table 2:The following table provides the decimal, binary and
hexadecimal equivalents:
Binary
Arithmetic
• The following table illustrates four simple rules for binary addition:
• Rules (iii) and (iv) shows a carry of a 1-bit into the next left position.
Example:
Con
t’
• A negative binary value is expressed in two's complement notation.
• According to this rule, to convert a binary number to its negative value is to reverse its bit values and add 1.
• To subtract one value from another, convert the number being subtracted to two's complement format and add the
numbers.