I'm trying to concert the following pseudocode into assembly code-
This is the code that I currently have. While the code builds successfully, it's going through both the LESSER and GREATER conditions when debugging. I can't seem to figure out what's making this happen. Any help will be appreciated. Thank you.
.data
array1 BYTE 13h,14h,15h,16h
array2 BYTE 12h,13h,14h,15h
sample1 BYTE 30h
sample2 BYTE 5h
length1 BYTE LENGTHOF array1
length2 BYTE LENGTHOF array2
index BYTE 0
maxlength DWORD 4
exp1 WORD ?
.code
main PROC
mov esi, 0 ;serves as the index
L1:
mov bl, array1[esi]
mov cl, array2[esi]
cmp bl, cl
jg GREATER
jl LESSER
GREATER:
mov al, bl
mul sample1
mov bx, ax
mov al, cl
mul sample2
mov cx, ax
mov ax, bx
mov dx, 0
div cx
LESSER:
mov exp1, 0
inc esi
cmp esi, maxlength ;while condition
jl L1