ch5-arithInstr

# ch5-arithInstr - Arithmetic instructions EE 3750 Overview...

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

Arithmetic instructions EE 3750 2 Overview Will discuss instructions for addition subtraction comparison (based on subtraction) multiplication division BCD and ASCII arithmetic

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

View Full Document
3 ADD, SUB instructions ADD dest,source dest ! dest + source Examples ADD AX,BX ADD SUM, BL SUB dest,source dest ! dest " source Examples SUB AX,BX SUB DIFF, BL 4 ADC, SBB instructions ADC dest,source dest ! dest + source + CF add with carry: used for wide additions Examples ADC AX,BX ADC SUM, BL SBB dest,source dest ! dest " source " CF subtract with borrow; used for wide subtractions Examples SBB AX,BX SBB DIFF, BL
figure from Brey 5 ADC example ADD AX, CX ADC BX, DX figure from Brey 6 SBB example SUB AX, DI SBB BX, SI

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

View Full Document
7 CBW, CWD instructions CBW ; note: operands implicit, none specified extend sign of AL to AH convert byte to word Examples if AL = 0001 1011 before CBW, then AX = 0000 0000 0001 1011 after CBW if AL = 1001 1011 before CBW, then AX = 1111 1111 1001 1011 after CBW CWD ; note: operands implicit, none specified extend sign of AX to DX convert word to doubleword Examples if AX = 0001 0001 0001 1011 before CWD, then DX—AX = 0000 0000 0000 0000 0001 0001 0001 1011 after CWD if AX = 1101 0001 0001 1011 before CWD, then DX—AX = 1111 1111 1111 1111 1101 0001 0001 1011 after CWD 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern