ORG 0000 /* starting of
the programe
MOV R1,#04 /* load r1 with 04
MOV R7,#01 /* load r7 with 01
LCALL FACT /*longcalltothefact subroutine
MOV R7,A /* load R7 WITH 00
FACT: MOV A,R7 /* LOAD A WITH 01
CJNE R1,#00,UP /*compare jump in not equal
SJMP UP1 /* inttrupt(condition togo up1)
UP: MOV B,R1 /* b= 00
MUL AB /* result in A
DJNZ R1,UP /* decrement jump if r1 zero
UP1: RET / return
END
MOV R1,#04 /* load r1 with 04
MOV R7,#01 /* load r7 with 01
LCALL FACT /*longcalltothefact subroutine
MOV R7,A /* load R7 WITH 00
FACT: MOV A,R7 /* LOAD A WITH 01
CJNE R1,#00,UP /*compare jump in not equal
SJMP UP1 /* inttrupt(condition togo up1)
UP: MOV B,R1 /* b= 00
MUL AB /* result in A
DJNZ R1,UP /* decrement jump if r1 zero
UP1: RET / return
END
No comments:
Post a Comment