programb4 - 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 : Let the 8 bit number be in the AL register. We have to mask the upper nibble ie we have to separate the upper nibble. In the result only LSB number should be present. eg. : AL = 67H. 011 0 011 1 Logically AND with 0FH 000 0 111 1 000 0 011 1 = 07H Result = 07 H, 6 is masked. Display the result. ØØ Algorithm : Step I : Load the number in AL. Step II : Mask the upper nibble. Step III : Display result. Step IV : Stop. ØØ Flowchart : Refer flowchart 4. ØØ Program : .model small .data a dw 0012H .code mov ax, @data ; Initialize data section mov ds, ax Flowchart 4 mov ax, a ; Load number1 in ax and al, 0fh ; mask upper nibble.Result in al mov ch, 02h ; Count of digits to be displayed mov cl, 04h ; Count to roll by 4 bits mov bh, al ; Result in reg bh l2: rol bh, cl
Background image of page 1

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

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

Page1 / 2

programb4 - 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