programb5

# Programb5 - Microprocessors& Applications(UPTU Appendix B ØØ Explanation • We have two digits available in the AL and BL registers in

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

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

View Full Document
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 : • We have two digits available in the AL and BL registers in unpacked BCD form. The digit in BL is the LSB, whereas digit in AL is MSB. To pack the two numbers, means to combine the two numbers. • To make the digit in AL as MSB we rotate it 4 times to the left. i.e. if digit = 09 H, after rotating it by a 4 times it becomes 90 H. Now add the two numbers. Result will be packed BCD. Display the result. eg. : AL = 09 N BL = 02 H Result = 92 H ØØ Algorithm : Step I : Initialize the data memory. Step II : Load the most significant BCD digit in AL. Step III : Load the least significant BCD digit in BL. Step IV : Rotate MSB 4 times to left. Step V : Add least significant BCD digit into ; rotated number. Step VI : Display the result. Step VII : Stop. ØØ Flowchart : Refer flowchart 5. ØØ Program : .model small .data Flowchart 5 a db 09H b db 02H .code mov ax,@data ; Initialize data section mov ds,ax mov al,a ; Load number1 in al...
View Full Document

## This note was uploaded on 08/04/2011 for the course ECON 101 taught by Professor Lucky during the Spring '11 term at Silver Lake.

### Page1 / 2

Programb5 - Microprocessors& Applications(UPTU Appendix B ØØ Explanation • We have two digits available in the AL and BL registers in

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

View Full Document
Ask a homework question - tutors are online