Z80 MONITOR

Status
Not open for further replies.
OK, so the function "RST $10" displays the character in A to the 7-segment display and auto-adjust the display pointer. I assume.

Then looking at this code:

Code:
   ORG 1800H
   LD A,1 ;
   LD BC,STRING ; bc points to the string data in memory
LOOP: ;
   LD A,(BC) ; Incarca A cu bitul din locatia BC
   CP 0 ; Compara A cu 0(end of STRING data)
   JR Z,EXIT ; Daca este egal cu 0 atunci sare la EXIT
   RST $10 ; Afiseaza A pe ecran
   INC BC ; Incrementeaza BC cu 1 pentru a sari la urmatorul bit
   JR LOOP ; Sare la LOOP sa faca din nou
EXIT:
   RET ; Ne intoarce la basic
STRING: ;
   DEFB "Welcome to UP!"
   DEFB 13,0 ; 13 este o noua linie si 0 inseamna sfarsit de data

There are 16 characters (including EOT "0") in the STRING but the display LED can only hold 6 characters at a time. So the TS would need another variable called "pointer" or something to adjust the value of (BC) so it would display like

Welcom
elcome
lcome
come t
ome to ........ etc

Or make use of the index register IX or IY (need to read more on the use of these 2 registers tonight)

Allen
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…