home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1991 / 09_10 / tricks / tp3gr.inc < prev    next >
Encoding:
Text File  |  1991-06-11  |  1.4 KB  |  64 lines

  1. ;* ------------------------------------------------------- *
  2. ;*                     TP3GR.INC                           *
  3. ;*         Textausgabe und Aufruf von TP3-Grafik           *
  4. ;* ------------------------------------------------------- *
  5.  
  6. write proc
  7.     ; Gibt String aus, der am Ende mit einem $ abge-
  8.     ; schlossen sein muß.
  9.     ; 1,1 ist linke obere Ecke
  10.     ; DH = Y   DL = X   BL = Zeichenfarbe
  11.     ; DS:SI = Adresse des String's
  12.   xor   bh,bh
  13.   mov   cx,1
  14.   dec   dl
  15.   dec   dh
  16.   push  bp
  17.   push  dx
  18.   mov   bp,sp
  19.   cld
  20. wr1:
  21.   push  bx
  22.   mov   ah,02h
  23.   int   10h        ; Cursor positionieren
  24.   pop   bx
  25.   lodsb
  26.   cmp   al,'$'     ; Ende des Strings
  27.   jz    WrEnde     ; dann WRITE verlassen
  28.   cmp   al,0dh     ; CR-Code ?
  29.   jnz   wr2
  30.   mov   dl,[bp]    ; X Koordinate wiederherstellen
  31.   jmp   wr1
  32. wr2:
  33.   cmp   al,0ah     ; LF-Code ?
  34.   jnz   wr3
  35.   inc   dh
  36.   jmp   wr1        ; y:= y+1
  37. wr3:
  38.   mov   ah,09h
  39.   int   10h
  40.   inc   dl
  41.   cmp   dl,40
  42.   jnz   wr1
  43.   inc   dh
  44.   mov   dl,[bp]
  45.   jmp   wr1
  46. WrEnde:
  47.   pop   dx
  48.   pop   bp
  49.   inc   dl
  50.   inc   dh
  51.   ret
  52. write endp
  53.  
  54. GrFunction proc near
  55.     ; ruft Grafikroutinen aus GRAPH auf
  56.   mov   bx,offset graph
  57.   add   bx,di
  58.   jmp   bx
  59.     ; GRAPH holt sich Rücksprungadresse selbst
  60. GrFunction endp
  61. ;* ------------------------------------------------------- *
  62. ;*               Ende von TP3GR.INC                        *
  63.  
  64.