Text in graphics mode

 BBS: Inland Empire Archive
Date: 07-29-92 (20:19)             Number: 195
From: MATT HART                    Refer#: NONE
  To: CURTIS STRATMAN               Recvd: NO  
Subj: Text in graphics mode          Conf: (2) Quik_Bas
 CS> Can anyone tell me how to print 80
 CS> column text in graphics mode?  I'm using
 CS> PDQ 3.0 so you will probably have to POKE around <grin>.

I think PDQ has a BIOS print routine - that's what you
need.  If not, I think I have one...

; BPRINT.ASM  by Matt E. Hart
;
; PRINT replacement - uses BIOS calls
;
; NOTE that this uses an old BIOS interrupt call - 10h function 09h.
; This is supported on all PC BIOS's.  The newer function 13h is not
; supported before BIOS dates of 1/10/86 and many clones after that date,
; including most Phoenix BIOS chip sets.
;
; DECLARE SUB BPrint(Strg$, BYVAL Attr)
;
;        Strg$ : String to print
;        Attr% : Attribute to print the string with

.MODEL MEDIUM,BASIC
.CODE

BPrint PROC Strg:Word, Attr:Word
    MOV     AX,0300h
    XOR     BX,BX
    INT     10h                 ; Sets current cursor location into DX
    MOV     SI,Strg
    MOV     CX,[SI]             ; CX has string length
    CMP     CX,0
    JE      B_Ending            ; Zero length - string was null
    MOV     DI,[SI+2]           ; DI has address of first byte
    MOV     BX,Attr             ; BX has attribute
B_Top:
    PUSH    CX                  ; Save the counter
    MOV     CX,1                ; Set the number of characters to 1
    MOV     AH,09h
    MOV     AL,[DI]             ; Character of string into AL
    INT     10h                 ; BIOS Print it
    POP     CX                  ; Restore the number of characters
    DEC     CX                  ; Less 1
    JZ      B_Ending            ; Last character - finish
    INC     DI                  ; Next character
    INC     DL                  ; You can keep updating the Column
                                ; - the BIOS doesn't care if you go
                                ; past the end, it'll wrap
    MOV     AH,02h
    INT     10h                 ; Reset the Row/Column
    JMP     B_Top
B_Ending:
    RET
BPrint ENDP
END

---
 * Origin: Midnight Micro!  V.32/REL  (918)451-3306 (1:170/600)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET