Answer the question
In order to leave comments, you need to log in
How to combine procedure with code?
I wrote my 3 lr on arrays, the task is simple, in a one-dimensional array (size = 20) find max, min, and max-min. It's done, I wrote a procedure for displaying numbers > 9. But I'm struggling with how to combine it ... Help, please.
org 100h
Start:
mov cx, 20
mov si, Mas
sub si, 1
mov bl, byte[si+1]
mov bh, byte[si+1]
A1:
inc si
mov al, byte [si]
cmp al, bl
ja B1
cmp al, bh
jb B2
jmp A2
B2:
mov bh, al
jmp A2
B1:
mov bl, al
A2:
loop A1
Exit:
mov dx, Str1
mov ah, 09h
int 21h
xor cx, cx
xor ax, ax
mov al, bl ;вот здесь мне надо передать ещё bh и bh=bh-bl
Div_Num:
xor dx, dx
mov bx, 10
div bx
add dx, '0'
push dx
inc ecx
cmp ax, 0
jne Div_Num
Outp:
pop dx
mov ah, 02h
int 21h
loop @F
mov ah, 0Ch
mov al, 08h
int 21h
cmp al, 0
jne @F
mov ah, $08
int 21h
@@:
ret
Mas db 1, 2, 3, 4, 5, 6, 8, 7, 5, 95, 6, 7, 4, 2, 9, 5, 6, 1, 2, 1
Str1 db "Max = $"
Str2 db 10, 13, "Min = $"
Str3 db 10, 13, "Result = $"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question