home *** CD-ROM | disk | FTP | other *** search
- A 100
- ;* ---------------------------------------------------------
- ; Demonstration des DEC-Befehls an Hand einer Schleife
- ;* ---------------------------------------------------------
- MOV CX,5 ; setze Index
- ;L1:
- CALL NEAR 150 ; Anzeige Index
- DEC CX ; Index - 1
- JNZ 103 ; Until CX = 0 -> L1:
- ;
- 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 DEMO2.COM
- RCX
- 200
- W
- Q