Подскажите плз... что в моей программе неправильно, она почемуто ответ выдает неправельный.
Код: Выделить всё
include macro.lib
stec segment 'stack'
dw 256 dup(?)
stec ends
data segment 'data'
a db ?
cc db ?
x db ?
h db ?
p db ?
b db ?
j db ?
mess db 'Zaraniye_1 $'
mess1 db 'Vvedite A $'
mess3 db 'Vvedite C $'
mess4 db 'Vvedite X $'
data ends
code segment 'code'
Begin:
assume ss:stec,ds:data,cs:code
mov ax,data
mov ds,ax
cls
move_cursor 0,0
mov ah,9
mov dx,offset mess
int 21h
crlf
mov ah,9
mov dx,offset mess1
int 21h
crlf
key_$2bin
crlf
mov a,al
mov ah,9
mov dx,offset mess3
int 21h
crlf
key_$2bin
crlf
mov cc,al
mov ah,9
mov dx,offset mess4
int 21h
crlf
key_$2bin
crlf
mov x,al
mov al,-1
mov p,al;-1 prisvaivaem
mov al,a
imul p;delaem -1
mov h,al;otvet hranim -1
mov al,x
sub al,cc;x-c
mov j,al;otvet x-c
mov al,h
idiv j
print_number
mov ah,10h
int 16h
mov ax,4c00h
int 21h
ret
code ends
end Begin