Thread View: comp.sys.zenith.z100
2 messages
2 total messages
Started by Walter A. Koziarz
Mon, 28 Dec 1992 13:15
writing a custom-character to screen...
Author: 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.
Re: writing a custom-character to screen...
Author: Walter A. Koziarz
Date: Mon, 28 Dec 1992 23:55
Date: Mon, 28 Dec 1992 23:55
28 lines
1786 bytes
1786 bytes
In article <1992Dec28.131540.23725@nosc.mil> koziarz@halibut.nosc.mil (Walter A. Koziarz) writes: a description of a character_mask... and a fragment of code... and then the following arithmetic discussion... >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. ummmm, yes, I *was* missing something *very* basic... there are *16* scanlines, not 9... using the relationship: rrow = 16*24*128+79 lets me place the character at row 25, column 80 using the code-fragment shown earlier... (that code-fragment was originally written by W. Ching and was re-printed in an article in "Z-100 Life Line", issue #17) Many thanks to gern for giving me the key piece to this puzzle... Walt K.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads