programb22 - 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 : We have 32 bit numbers. Initially we will load the first 32 bit number into the registers AX and BX. AX contains the LSB while BX contains the MSB of the number. Loading is done using the MOV instruction. Now we will load the second 32 bit number into the registers CX and DX. CX contains the LSB and DX contains the MSB of the number. Initially, we will subtract the LSBs i.e. to subtract the contents of CX with contents of AX. The subtraction is done using SUB instruction. The result of LSB subtraction is stored in AX. Now, we will subtract the MSB alongwith borrow if any generated in the LSB subtraction i.e. we are subtracting DX from BX using SBB (subtract with borrow) instruction. The result of MSB subtraction is in register BX. Display the result using display routine. For example : BX : AX = 12345678 H 12345678 H DX : CX = 11111111 H 11111111 H 01234567 H  Algorithm :
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

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