Professional Documents
Culture Documents
05
Lab Work:
Write an assembly program that finds the highest value in the following array of
numbers:
.MODEL SMALL
.DATA
GRADES DB 19H, 93H, 69H, 55H, 99H
HIGHEST DB ?
.CODE
MAIN: MOV AX,@DATA
MOV DS, AX
MOV BX, OFFSET GRADES
MOV CX, 05
YELLOW: MOV AL, [BX]
GREEN: CMP [BX], AL
JA YELLOW
INC BX
LOOP GREEN
MOV HIGHEST, AL
MOV AH,4CH
INT 21H
END MAIN
Reminder:
The Processor Flags Register
The following diagram shows the location of the various flags in the processor status
register.
The following conditional branches are similar to the above but involve comparisons
which treat the operands as unsigned integers: