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
Unformatted text preview: • Divide word variable WHITE by 38, store quotient to byte variable GRAY MOV AX, WHITE ; word dividend must be in AX MOV BH, 38 ; no immediate division, so move 38 into a register DIV BH ; places quotient in AL MOV GRAY, AL • RED ← (WHITE * BLUE) / GOLD ; all variables are bytes MOV AL, WHITE MUL AL, BLUE ; places product WHITE * BLUE in AX DIV GOLD ; dividend is already word size, already in AX; DIV places quotient in AL MOV RED, AL • RED ← (WHITE / GOLD) * BLUE ; all variables are bytes MOV AL, WHITE MOV AH, 0 ; need word size dividend, so pad out AH ; would use CBW if data was signed DIV GOLD ; places quotient in AL MUL BLUE ; one operand is already in AL, places product in AX MOV RED, AL ; note that the high order byte is in AH, could do in addition: MOV RED+1, AH...
View Full 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.
- Fall '08