ch5-arithInstr

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

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

View Full Document Right Arrow Icon
Arithmetic instructions EE 3750 2 Overview Will discuss instructions for addition subtraction comparison (based on subtraction) multiplication division BCD and ASCII arithmetic
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
figure from Brey 5 ADC example ADD AX, CX ADC BX, DX figure from Brey 6 SBB example SUB AX, DI SBB BX, SI
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/25/2012 for the course EE 3750 taught by Professor Desouza during the Fall '08 term at LSU.

Page1 / 9

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online