50 likes | 144 Views
Progam .-(6) * Write a program to Display series of Leaner , Even and odd using by LOOP command and Direct Offset address. Design by : sir Masood. Algorithm steps. Store 9 into CX Store 1 into BL Store BL into DL Add 48 in to DL Display to DL Increment in BL
E N D
Progam.-(6)* Write a program to Display series of Leaner , Even and odd using by LOOP command and Direct Offset address. Design by : sir Masood
Algorithm steps • Store 9 into CX • Store 1 into BL • Store BL into DL • Add 48 in to DL • Display to DL • Increment in BL • Check CX IF CX=0 Then go to step No.8 else go to step 3 8. Store 5 into CX 9. Store 1 into BL 10 Store BL into DL 11 Add 48 in to DL 12 Display to DL 13 BL=BL+2 14 Check CX IF CX=0 Then go to step No.15 else go to step 10 15. Store 5 into CX 16. Store 0 into BL 17 Store BL into DL 18. Add 48 in to DL 19 Display to DL 20 BL=BL+2 • Check CX IF CX=0 Then go to step No.22 else go to step 17 • END Design by : sir Masood
Start c D CX=9 CX=5 CX=5 BL=1 BL=1 BL=1 DL=BL DL=BL DL=BL DISPLAY DL DISPLAY DL DISPLAY DL DL=DL+48 DL=DL+48 DL=DL+48 BL=BL+1 BL=BL+2 BL=BL+2 Yes CX≠0 Yes Yes CX≠0 CX≠0 No No No Design by : Sir. Masood End C D
Program Example MOV CX,9 ; for loop 9 Times MOV BL,1 MOV AH,2 ; This is service For display Offset address: ; This is label name MOV DL,BL ADD DL,30H ; Add Simple No. to ASCII Code No. INT 21H INC BL LOOP Offset address MOV CX,5 ; for loop 5 Times MOV BL,1 MOV AH,2 ; This is service For display Offset address : ; This is label name MOV DL,BL ADD DL,30H ; Add Simple No. to ASCII Code No. INT 21H ADD BL,2 ; This is service For display LOOP Offset address Design by :Sir Masood
Program Example MOV CX,5 ; for loop 5 Times MOV BL,0 MOV AH,2 Offset address : ; This is label name MOV DL,BL ADD DL,30H ; Add Simple No. to ASCII Code No. INT 21H ADD BL,2 ; Increment 2 in DL regester LOOP Offset address INT 20H ; Here end Program Design by : Sir Masood