emu8086 trouver le minimum et le maximum dans un tableau

Oui, j'ai soigneusement cherché sur internet tous sur la place pour de l'aide. Non, je ne comprends rien à propos de l'assemblage. Je suis 1 semaine en cours (microprocesseurs), et l'enseignant est un cinglé psychopathe qui pense qu'il pisse excellence, car nous sommes tous des débutants.

De toute façon, je dois venir avec un code ASM (pour emu8086) qui vous permettra de trouver le minimum et le maximum de valeur dans un tableau d'une taille. Dans l'exemple de code, il fournit (ce qui semble être) un segment de données qui contient un tableau nommé LISTE. Il prétend qu'il va remplacer cette liste avec d'autres listes de tailles différentes, et notre code doit être capable de les gérer.

Voici l'exemple de code ci-dessous. J'ai mis en évidence les parties que j'ai ajouté, juste pour vous montrer que j'ai fait de mon mieux pour résoudre ce problème:

; You may customize this and other start-up templates; 
; The location of this template is c:\emu8086\inc
; You may customize this and other start-up templates; 
; The location of this template is c:\emu8086\inc\0_com_template.txt
org 100h
data segment
LIST DB 05H, 31H, 34H, 30H, 38H, 37H
MINIMUM DB ?
MAXIMUM DB ?
AVARAGE DB ?
**SIZE=$-OFFSET LIST**
ends
stack segment       **;**
DW 128 DUP(0)   **; I have NO CLUE what this is supposed to do**
ends                **;**
code segment
start proc far
; set segment registers:
MOV AX,DATA      **;**
MOV DS,AX        **;I'm not sure what the point of this is, especially since I'm supposed to be the programmer, not my teacher.**
MOV ES,AX        **;**
; add your code here
**;the number of elements in LIST is SIZE (I think)                                      
MOV CX,SIZE   ;a loop counter, I think
;find the minimum value in LIST and store it into MINIMUM
;begin loop
AGAIN1:
LEA SI,LIST
LEA DI,MINIMUM
MOV AL,[SI]
CMP AL,[SI+1]
If carry flag=1:{I got no idea}
LOOP AGAIN1
;find the maximum value in LIST and store it into MAXIMUM
;Something similar to the other loop, but this time I gotta find the max.
AGAIN2:
LEA SI,LIST
LEA DI,MINIMUM
MOV AL,[SI]
CMP AL,[SI-1]        ;???
LOOP AGAIN2
**
; exit to operating system.
MOV AX,4C00H
INT 21H
start endp
ends
end start ; set entry point and stop the assembler.
ret
_com_template.txt org 100h data segment LIST DB 05H, 31H, 34H, 30H, 38H, 37H MINIMUM DB ? MAXIMUM DB ? AVARAGE DB ? **SIZE=$-OFFSET LIST** ends stack segment **;** DW 128 DUP(0) **; I have NO CLUE what this is supposed to do** ends **;** code segment start proc far ; set segment registers: MOV AX,DATA **;** MOV DS,AX **;I'm not sure what the point of this is, especially since I'm supposed to be the programmer, not my teacher.** MOV ES,AX **;** ; add your code here **;the number of elements in LIST is SIZE (I think) MOV CX,SIZE ;a loop counter, I think ;find the minimum value in LIST and store it into MINIMUM ;begin loop AGAIN1: LEA SI,LIST LEA DI,MINIMUM MOV AL,[SI] CMP AL,[SI+1] If carry flag=1:{I got no idea} LOOP AGAIN1 ;find the maximum value in LIST and store it into MAXIMUM ;Something similar to the other loop, but this time I gotta find the max. AGAIN2: LEA SI,LIST LEA DI,MINIMUM MOV AL,[SI] CMP AL,[SI-1] ;??? LOOP AGAIN2 ** ; exit to operating system. MOV AX,4C00H INT 21H start endp ends end start ; set entry point and stop the assembler. ret