A
A
Alexander Shuvalov2017-08-24 14:27:36
Algorithms
Alexander Shuvalov, 2017-08-24 14:27:36

Why errors when calculating an arithmetic expression?

Hello! Check that the expression f = (ab)*c/2+d must be calculated incorrectly if a, b, c, d are byte, a=15, b = 70, c=25, d=35 We must also display the result in as a binary and hexadecimal value.

.model small
.stack 256
.data
a db 15
b db 70
c db 25
d db 35
f dw 0
.code
main:
   xor ax, ax
   mov al, 15
    mov bl, b
   cbw
   movsx ax, bx
   sub ax, bx
   imul c
   
   mov dl, d
   cbw
   movsx ax, dx
   add dx, 2
   
   idiv dx
   exit:
   mov ax, 4c00h
   int 21h
end main

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question