Professional Documents
Culture Documents
Tutorial 5
Tutorial 5
13.02.2024
14.02.2024
15.02.2024
19.02.2024
Problem 1
.MODEL SMALL
.DATA
.CODE
.STARTUP
LEA BX, NUM ;BX to point the array
MOV CL,0AH ;length of array
MOV AL,0 ;AL=0
AGAIN: INC BX
DEC CL
JNZ L1
MOV BIGGEST,AL ;store the biggest value from AL to memory
.EXIT
END
.CODE
.STARTUP
LEA SI,LONGNUM1 ;SI as pointer to first operand
LEA DI,LONGNUM2 ;DI as pointer to second operand
LEA BX,SUM ;BX as pointer to sum
CLC ;clear carry
MOV CX,2 ;counter for number of words
.CODE
.STARTUP
MOV AX,WORD1 ;load WORD1 to AX
CMP AX,WORD2 ;compare with WORD2
JB L1 ;jump to L1 if AX<WORD2
LEA DX,MSG1 ;point DX to MSG1
JMP DISP