Article View: comp.sys.zenith.z100
Article #293writing a custom-character to screen...
From: Walter A. Koziarz
Date: Mon, 28 Dec 1992 13:15
Date: Mon, 28 Dec 1992 13:15
36 lines
2000 bytes
2000 bytes
got a question that's been bugging me for a couple days... I wish to write a
custom-character (from assembly-language program) to a *specific* screen
location (column 80 of line 25, since that line doesn't scroll normally...).
the char is defined thusly --
char db {a byte}
db {a byte}
etcetera, for 9 bytes (coresponding to the 9 scanlines in a character)
the char is then displayed via this code fragment --
(assume -- ax holds segment address for the desired color-plane and di holds
the offset of the character mask -- 'char' as described above)
mov es,ax
mov sx,9 ; 9 scanlines
mov si,79 ; row 1, col 80
g_v_l: mov ax,es:[si] ; read a row from chosen screen location
mov bx,cs:[di] ; read a row from character mask
xor ax,bx ; invert 'em
mov es:[si],ax ; write 'em to the screen
add si,128 ; next row of screen
inc di ; next row of char mask
loop g_v_l
okay, my problem is -- how do I go about determining the 'start point' to get
row 25, col 80 of the screen? I interpret all the information that exists to
tell me that I should use 9*24*128+79 to get me to the 80th column in row 25.
*but* it doesn't work... what am I missing? incidentally -- the arithmetic
above is based upon _9_ scanlines per char, _24_ character rows, _128_ bytes
per character rows and _79_ character-positions to 'skip' in the first scanline
of character row 25 (see the example code, the '79' in mov si,79 *does* put me
at row 1, col 80)... I feel I *must* be missing something quite basic...
Walt K.
Technical Details
Message-ID:
<1992Dec28.131540.23725@nosc.mil>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!agate!dog.ee.lbl.gov!news!nosc!halibut.nosc.mil!koziarzShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.zenith.z100 Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!agate!dog.ee.lbl.gov!news!nosc!halibut.nosc.mil!koziarz From: koziarz@halibut.nosc.mil (Walter A. Koziarz) Subject: writing a custom-character to screen... Message-ID: <1992Dec28.131540.23725@nosc.mil> Sender: usenet@nosc.mil (Network News) Organization: Naval Ocean Systems Center, San Diego Date: Mon, 28 Dec 1992 13:15:40 GMT Lines: 36