Unpacked bcd to packed bcd program


















Labels: programs. Post a Comment. By Shalini kapoor March 31, RLC: This instruction rotates the contents of accumulator to the left by one bit. It will shift B0 to B1, B1 to B2, B7 to B0 as well as to carry flag. Only CY flag is modified. LDA — A 24 bits 3 bytes command which will load content of memory location in register A i. LDA — This command will load content of memory location in register A i. STA — A 24 bits command which will store data of accumulator in memory location Table of Contents.

HTL — It means Halt the microprocessor. The lower 4 bits of the number represent the BCD number. The higher bits are zero '0'. So only 1 byte of memory is required for unpacked BCD numbers or an 8 bit register to contain it. In packed BCD numbers, both the lower and higher 4 bits are used. A single byte has two BCD numbers, one in the lower nibble 4 bits, and one in the upper 4 bits.

We have to unpack this BCD number i. Then to get the LSB digit mask the upper nibble. Display the result. Step I : Initialize the data memory. Step III : Mask the lower nibble. Step V : Display the digit. Turbo Assembler Version 3.



0コメント

  • 1000 / 1000