Understand the following program carefully and state what doeseach block(set of
ID: 3608536 • Letter: U
Question
Understand the following program carefully and state what doeseach block(set of instruction having same color) do? Write youranswer against eachinstruction Marks: 10
MOV AH, 2CH
INT 21H
MOV AL, CH
CALL CONVERT
MOV [BX], AX
MOV AL, CL
CALL CONVERT
MOV [BX + 3], AX
MOV AL, DH
CALL CONVERT
MOV [BX + 6], AX
CONVERT PROC
MOV ah, 0
MOV DL, 10
DIV DL
OR AX, 3030H
RET
CONVERT ENDP
Explanation / Answer
MOV AH, 2CH
INT 21H
The function 21H returns hours (0-23) in CH, minutes(0-59) in CL, and seconds (0-59) in DH.
MOV AL, CH
CALL CONVERT
MOV [BX], AX
The first statement moves the values of CH to AL and call theprocedure CONVERT ,the function returns AX . The AX value isplaced at the address present in BX.
MOV AL, CL
CALL CONVERT
MOV [BX + 3], AX
The first statement moves the values of CL to AL andcall the procedure CONVERT ,the function returns AX value andplaces value at the location after adding the address with 3present in BX
MOV AL, DH
CALL CONVERT
MOV [BX + 6], AX
The first statement moves the values of DH in ALand call the procedure CONVERT ,the function returns AX value andplaces value at the location after adding the address with 6present in BX
CONVERT PROC
MOV ah, 0
MOV DL, 10
DIV DL
OR AX, 3030H
RET
CONVERT ENDP
This is a procedure which updates the value of Ax and returns AXvalue to function call
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.