A86: Long Text Routine


[Prev][Next][Index][Thread]

A86: Long Text Routine




 I am just learning how to program in assembly (thanks mainly to Matt 
Johnson's Z80 Programming Tutorial) and I am wondering if there is an 
easier way to write a whole page of text.  It seems to take an awful lot 
of source to write a page of text on the screen.

#include "asm86.h"
#include "ti86asm.inc"
#include "ti86math.inc"
#include "ti86ops.inc"
#include "ti86abs.inc"

.org _asm_exec_ram

         call  _clrScrn
         call  _runindicoff

Text_test:
         ld    hl, $0000                    ;stores (0,0) to hl
         ld    b, 30                        ;# of chars. to display
         ld    ($0C37C), hl                 ;stores hl to adress of 
_penCol
         ld    hl, Open1                    ;loads text string
         call  _vputsn                      ;writes string to screen
         ld    a, ($0C37D)
         ld    hl, $0600
         ld    b, 34
         ld    ($0C37C), hl
         ld    hl, Open2
         call  _vputsn
         ld    a, ($0C37D)
         ld    hl, $0C00
         ld    b, 32
         ld    ($0C37C), hl
         ld    hl, Open3
         call  _vputsn
         ld    a, ($0C37D)
         ld    hl, $1200
         ld    b, 29
         ld    ($0C37C), hl
         ld    hl, Open4
         call  _vputsn

ret

Open1:   .db   "Im Wonderin if this is the"
         .db   "only",0
Open2:   .db   "way to write a long page of"
         .db   "writing",0
Open3:   .db   "like this, or if there is a"
         .db   "short",0
Open4:   .db   "cut, useing a shorter source.",0

.end

This source written in basic would be significantly shorter.

:ClDrw
:Text(0,0,"Im Wondering if this is the only")
:Text(7,0,"way to write a long page of writing")
:Text(14,0,"like this or if there is a short")
:Text(21,0,"cut, useing a shorter source.")
:

The assembly seems like a lot more work to me, so if anyone has any 
comments I would surely appreciate your help!

                  The Chronomancer

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Follow-Ups: