Pre-Laboratory: Lazaro, Joven Joseph T. TUT-Microsy
Pre-Laboratory: Lazaro, Joven Joseph T. TUT-Microsy
TUT- Microsy
Pre-Laboratory
Lazaro, Joven Joseph T.
TUT-Microsy
Laboratory Work
Using what was learned from laboratory # 4 and # 5, create a program that will compute
for the sum and difference of two numbers with two digits each.
include AND, OR, Exclusive-OR, NOT, shifts, rotates and the logical compare (TEST).
division, multiplication etc. After execution, the result is stored in the first operand. Logic
BCD usually implies a full byte for each digit (often including a sign), whereas packed
BCD typically encodes two decimal digits within a single byte by taking advantage of the
For example: 1234 is stored as 31 32 33 34H. ASCII for 1 is 31H, for 2 is 32H,
etc.
B. BCD representation
Example: 1234 is stored as 01 02 03 04H Additional byte is used for sign. Sign
For the arithmetic and logic instructions, the MOV CH, AL AND MOV CL,
AL are being used to read high and low digits respectively. Some arithmetic instructions
were also incorporated such as SUB and MUL however for the logic instructions, XOR
the arithmetic and logic instructions. In the experiment, the arithmetic instructions that
are used in putting the digits in one byte are SUB and MUL including also the MOV
instruction. The logic instructions are XOR and OR. In performing the addition, the input
numbers are in BCD format and the ADD instruction was used with the DAA for the
decimal adjust. In displaying the number in BCD format, the logic instructions XOR and
AND were used to clear values of AH and AL. The arithmetic instructions DIV is used
for byte manipulation and the ADD instruction is to convert into a character.
Conclusion
operations with multiple digits involved. The incorporation of these instructions in one
program are helpful in accomplishing a code which performs addition and subtraction
similar to the experiment. In storing two digits in a byte, the packed BCD representation
can be used. If two BCD digits are stored per byte, it’s called Packed BCD. This occurs
in data transmission where numbers are being transmitted over a communications link.
Packed BCD reduces the amount of time spent transmitting the numbers, as each data