home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / source / qvideo.seq < prev    next >
Text File  |  1989-09-21  |  2KB  |  64 lines

  1. \ QVIDEO.SEQ    Fast video routine LINKAGE.             by Tom Zimmer
  2.  
  3. comment:
  4.  
  5.   Set F-PC to use a very fast direct screen write routine called VIDEO-TYPE.
  6. This is incredibly fast, but does have at least one side effect. Types beyond
  7. the end of the right screen edge do NOT wrap properly. If you need to have
  8. type do a proper wrap at the right screen edge, specify SLOW below. This
  9. will cause all typing and emitting to go through a DOS WRITE operation.
  10.  
  11. comment;
  12.  
  13. DECIMAL
  14.  
  15. : QTYPEL        ( SEG A1 N1 --- )
  16.                 @> PRINTING
  17.                 IF      (TYPEL)
  18.                 ELSE    VIDEO-TYPEL
  19.                 THEN    ;
  20.  
  21. : FAST          ( --- )
  22.                 ['] QTYPEL     IS TYPEL
  23.                 FALSE =: ?DOSIO ;
  24.  
  25. : SLOW          ( --- )
  26.                 ['] (TYPEL)    IS TYPEL
  27.                 TRUE =: ?DOSIO ;
  28.  
  29. FAST
  30.  
  31. \S
  32.  
  33. CODE COLOR-EMIT ( C1 --- )
  34.                 POP AX
  35.                 CMP AX, # 13                    \ Is char a Carraige Return?
  36.              0= IF      MOV AH, # $0E
  37.                         INT $10
  38.                         MOV #OUT # $00 WORD     \ reset to left column
  39.                         NEXT
  40.                 THEN
  41.                 CMP AX, # 10                    \ or is char a LineFeed?
  42.              0= IF      MOV AH, # $0E
  43.                         INT $10
  44.                         MOV AX, #LINE           \ Get line number
  45.                         INC AX
  46.                         INC AX
  47.                         CMP AX, ' ROWS >BODY    \ bump line if not at bottom
  48.                       < IF      DEC AX
  49.                                 MOV #LINE AX
  50.                         THEN
  51.                         next
  52.                 THEN
  53.                 MOV AH, # $09
  54.                 MOV BX, ATTRIB
  55.                 SUB BH, BH
  56.                 MOV CX, # 1
  57.                 INT $10
  58.                 ADD #OUT # $01 WORD
  59.                 NEXT            END-CODE
  60.  
  61.  
  62.  
  63.  
  64.