home *** CD-ROM | disk | FTP | other *** search
- A 100
- ;* ---------------------------------------------------------
- ; Demonstration des INC-Befehls an Hand einer Schleife
- ;* ---------------------------------------------------------
- MOV CX,0 ; clear Index
- ;L1:
- INC CX ; Count + 1
- CALL NEAR 150 ; Anzeige Index
- CMP CX,05 ; 5 X ausführen
- JB 103 ; an Schleifenanfang
- ;
- MOV AX,4C00 ; DOS-Exit
- INT 21 ;
-
- A 130
- ;* ---------------------------------------------------------
- ; Textkonstante
- ;* ---------------------------------------------------------
- DB "Schleifenindex = $"
- DB 0D,0A,"$"
-
- A 150
- ;* ---------------------------------------------------------
- ; Ausgaberoutine
- ;* ---------------------------------------------------------
- PUSH CX ; rette Index
- MOV DX,130 ; Zeiger auf Text
- MOV AH,09 ; Text ausgeben
- INT 21
- MOV DL,CL ; Index lesen,
- ADD DL,30 ; in ASCII wandeln
- MOV AH,02 ; und ausgeben
- INT 21
- MOV DX,142 ; Zeiger auf CR,LF
- MOV AH,09 ; Text ausgeben
- INT 21
- POP CX ; restauriere Index
- RET ; Ende
- ;
- ; Speichere das Programm
- ;
-
- N DEMO1.COM
- RCX
- 200
- W
- Q