Question: (c) The following PIC16F84A assembly code multiplies two numbers together and stores the result. REGA EQU H'10' REGB EQU H'11' REGC EQU H'12' ORG
(c) The following PIC16F84A assembly code multiplies two numbers together and stores the result. REGA EQU H'10' REGB EQU H'11' REGC EQU H'12' ORG H'10' MOVLW D'2' MOVWF REGA MOVLW D'3' MOVWF REGB CALL MULTIPLY MULTIPLY CLRF REGC ; clear REGC LOOP MOVF BTFSC REGB, F STATUS, Z ; test REGB is it zero? GOTO DONE MOVF REGA, W ; Yes, then we are done ; add REGA to REGC ADDWF REGC DECF REGB ; decrement REGB GOTO LOOP DONE RETURN (i) Describe the limitation on the values that can be assigned to REGA and REGB for the multiplication to produce a valid result. (ii) Write down the sequence of hexadecimal values that is stored in the programme counter during the execution of this code. (!!!) Determine the total duration that this code takes to execute, given an instruction cycle of 1 s.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
