programb6 - Microprocessors & Applications (UPTU)...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Appendix B ØØ Explanation : A digit BCD number is available in register AL. We have to unpack this BCD number i.e. we have to separate the BCD digits. e.g : If the number = 92 H then in unpack form the two digits will 02 H and 09 H. i.e. we have to mask the lower nibble, first and rotate four times to the right to get the MSB digit. Then to get the LSB digit mask the upper nibble. Display the result. Masking lower nibble means ANDing the number with OF0 to get MSB. ØØ Algorithm : Step I : Initialize the data memory. Step II : Load number into register AL. Step III : Mask the lower nibble. Step IV : Rotate 4 times left to make ; MSB digit = LSB. Step V : Display the digit. Step VI : Load number in AL. Step VII : Mask upper nibble. Step VIII : Display the result. Step IX : Stop. ØØ Flowchart : Refer flowchart 6. ØØ Program : .model small .data a db 92H .code Flowchart 6 mov ax, @data ; Initialize data section mov ds, ax mov al, a ; Load number1 in al
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

programb6 - Microprocessors & Applications (UPTU)...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online