CODING - The printing of tektstovyh lines of BASIC.

Deja Vu #07
AY-Track: LOW CODER'S LYRIC (ON FUNTOP'98)
__________________________________________


(C) Andrew Strelnikov
__________________________________________



        The printing process



   The programs at Basic'e commonly used procedures for 
printing a native. To do this, they connect to the new channel 
and print plain PRINT, or placed in

RAM pre-prepared messages and transmit them to the procedure of 
printing the address using the POKE. Propose another way. Data 
is transmitted via a user function. Text is placed in the REM 
lines. Address Text is calculated by number of the first first

line with the text. Symbol of the end of the text is missing. 
End of the text determined by the absence of the operator REM 
at the beginning of the next Basic line. As an example, cite

the simple procedure of printing, which uses
PZUshnuyu RST 16.

; How to print the group of text strings
; Of BASIC.
And (c) Strelnikov AS
; Def fn a (n, x, y, t, p, b) = adr
; N - number of first-line with text
; X, y - coordinates
; T, p, b, - attributes (ink, paper, bright)
; Newline 13 (VC)
The text is placed behind the operator in REM
; Multiple lines.
; Print lines until it encounters
; Line that starts with another
; (Not REM) operator.


      ORG 40000

      LD A, 2

      CALL 5633; open channel 2

, The definition addresses the first line of text


      LD HL, (23563); defadd

      INC HL

      INC HL

      CALL 13236

      CALL 7833

      PUSH BC

      POP HL

      CALL 6510

      LD DE, 5

      ADD HL, DE; now in HL address text

                 And after REM

Setting of print attributes


      LD IX, (23563); Defadd

      LD A, 16

      RST 1916

      LD A, (IX +28); ink

      RST 1916

      LD A, 17

      RST 1916

      LD A, (IX +36); paper

      RST 1916

      LD A, 19

      RST 1916

      LD A, (IX +44); bright

      RST 1916


Setting of printing position


      LD B, (IX +12); x

      LD C, (IX +2); y
START LD A, 22; at

      RST 1916

      LD A, C; y

      RST 1916

      LD A, B; x

      RST 1916


; Print

PRN LD A, (HL); have a symbol

      CP 13; checking code VC

      JR 2, PS; if so, the procedure ne
                  , Maps the line

      RST 16; print symbol

      INC HL; increment pointer

                  ; Text

      JR PRN; seal. symbol

; Newline: increase y by 1
S address is increased by 5 (go to the next, blowing line, 
where after REM is The text: 2 byte line number 2 bytes long, 
and on-line, and 1 byte - code 13 previous ; Line).


PS INC C; y = y +1

      LD DE, 5

      ADD HL, DE; adr = adr +5

      LD A, (HL); if there

      CP 234; code REM - skip

      INC HL; it and print

      JR Z, START; the next line if

                   Nay - reset
END CALL 3405; temporal attributes

      RET; output


   This program, in many cases more convenient than just PRINT. 
It prints a few lines in the given coordinates. Can used to 
print the menu descriptions and etc.