Guest_imported
New member
- Jan 1, 1970
- 0
START: LD CX,HTU
LD BX,64H
CALL DIGIT
LD BX,0AH
CALL DIGIT
LD BX,01
CALL DIGIT
RET
DIGIT: SUB AX,BX
JP M,NEXT
INC(CX)
JP DIGIT
NEXT: INC CX
ADD AX,BX
RET
HTU: DEFM '000'
(a) If AX is set to 0F5 hex and the subroutine then successfully called and executed. Trace the code above using HTU, HTU+1, HTU+2 and the registers as headings.
(b) What does the code do?
(c) If AX is set to 1A5 hex and the HTU reset to '000' and the subroutine again successfully called executed. Trace again or otherwise to determine the values in HTU, HTU+1 and HTU+2.
(d) (i) What is the largest hexadecimal value AX can have before the subroutine fails to produce the intended result?
(ii) What would be the effect on the subroutine of having too large a value in AX?
thankyou
time and effort much appreciated..
LD BX,64H
CALL DIGIT
LD BX,0AH
CALL DIGIT
LD BX,01
CALL DIGIT
RET
DIGIT: SUB AX,BX
JP M,NEXT
INC(CX)
JP DIGIT
NEXT: INC CX
ADD AX,BX
RET
HTU: DEFM '000'
(a) If AX is set to 0F5 hex and the subroutine then successfully called and executed. Trace the code above using HTU, HTU+1, HTU+2 and the registers as headings.
(b) What does the code do?
(c) If AX is set to 1A5 hex and the HTU reset to '000' and the subroutine again successfully called executed. Trace again or otherwise to determine the values in HTU, HTU+1 and HTU+2.
(d) (i) What is the largest hexadecimal value AX can have before the subroutine fails to produce the intended result?
(ii) What would be the effect on the subroutine of having too large a value in AX?
thankyou
time and effort much appreciated..