Thursday, 3 November 2011

MP LAB ANSWER ...

QUESTION
TO GENERATE
1
12
123
1234
12345
123456
.......
SOLUTION
MOV SI,2001H ;2001 IS THE INITIAL LOCATION WHERE SERIES GET SAVED
MOV AL,01H
MOV BL,01H

L1:MOV[SI],BL
INC BL
INC SI
CMP BL,AL
JBE L1

INC AL
MOV BL,01H
CMP AL,[2000H] ;SAVE NO. OF ROWS REQUIRED IN LOCATION 2000
JBE L1

HLT

No comments:

Post a Comment