add DEST, SRC |
Effect:
|
Note:
|
i dd 89 add eax, 12 add eax, ebx add eax, i |
sub DEST, SRC |
Effect:
|
Note:
|
i dd 89 sub eax, 12 sub eax, ebx sub eax, i |
|
|
imul SRC |
Effect:
DEST = DEST * SRC DEST is some part of the EAX register Which part will depend on the SRC operand |
mov ax, 10000 mov bx, 8888 imul bx ;; Result DX:AX = ax * bx ;; DX AX ;; +---------+ +---------+ ;; |xxxxxxxxx| |yyyyyyyyy| ;; +---------+ +---------+ ;; ROL EDX, 16 ;; Rotate EDX 16 bits to the LEFT ;; ;; Before: ;; EDX ;; +---------+---------+ ;; |?????????|xxxxxxxxx| ;; +---------+---------+ ;; ;; After: ;; EDX ;; +---------+---------+ ;; |xxxxxxxxx|?????????| ;; +---------+---------+ ;; ;; This will put lower EDX in upper EDX mov dx, ax ;; Result: ;; EDX ;; +---------+---------+ ;; |xxxxxxxxx|yyyyyyyyy| ;; +---------+---------+ |
|
|
idiv SRC |
Effect:
|
mov ax, 18 ;; AX(16 bits) = 18 cwd ;; DX:AX(32 bits) = 18 mov bx, 7 ;; Prepare for division idiv bx ;; Divide by 16 bit source... ;; ;; Operation performed: ;; DX:AX / BX ;; ;; Result: ;; AX = quotient ;; DX = remainder |