programb55 - Microprocessors & Applications (UPTU)...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: Microprocessors & Applications (UPTU) ØØ Appendix B Explanation : • • For ASCII-Gray conversion. (i) Divide the ASCII number by 2 until the quotient is 0 . e.g. to convert 0EHi.e. decimal 14 2 2 2 2 2 • ØØ 1 4 7 3 1 0 0 1 1 1 (1110 B) is the binary equivalent of 0E H. Algorithm : Step I ØØ : Get the number whose binary code equivalent is to be found. Step II : Initialise count in CL = 08 H Step III : Divide the number by 2 i.e. shift the number by 1 it to the left. Step III : Display the bit shifted in carry. Step IV : Decrement count Step V : Check if count =0 ? Step VI : if yes goto step VII else goto step III. Step VII : Stop. Flowchart : Refer flowchart 55. ØØ Program : .model small .data a db 0AH .code mov mov mov mov mov up : shl ax, @data ds, ax al, a cl , 08H ah, 00h al, 01h mov bl, al mov adc al, 30h ; Initialize data section ; Load number1 in al ; ah=00 ; divide the number by 2 and SHL gives the same result al, 00H Flowchart 55 Microprocessors & Applications (UPTU) mov mov int mov dec jnz mov int end ØØ dl, al ah, 02h 21h al,bl cl up ah, 4cH 21H ; Terminate Program Result : 0000 1010 Appendix B ...
View Full Document

Page1 / 2

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