• Please review our updated Terms and Rules here

Dr Dobb's Journal Vol 1.

CP/M User

Veteran Member
Joined
May 2, 2003
Messages
2,986
Location
Back of Burke (Guday!), Australia
2 Things I discovered from the Journals:

I came across a "Line Drawing Game for your Video Terminal" Oct 1976 page 30, or page 290 on Archive, written for an 8080 based machine, but I don't have much information about what that machine is, it uses a VDM (Video Display Monitor I presume), which has a PORT accessed at 8Ch and memory assigned to it between 8800h and 8BFFh. Within the Game source code itself is a Couple of IN statements using PORT address FFh and the source was written in 8080.

The funny thing about this game was I was able to rewrite the code into Z80 to understand a little bit clearer for myself, a lot of the initialization code was removed, which looked like this:

Code:
LXI 6,SP+6         Set Stack Point
MV I A,0
OUT 8CH
AG LXI H,8800H  Initialize screen
ST MV I M,20H
INX H
MOV A,h
CPI 8CH
JNZ ST

I figured that to draw some things to screen to simply use what my machine had and hopefully all the other pieces would fall into place, which on this occasion seems to be the case when I used what my machine had in terms of Input & Output to make this work, I had to come up with some other things, which i was able to do to determine when the game is over, though the original game appears as if it's able to read based on where the object is on screen, with this bit of code:

Code:
N2 MOV A,M
CPI 2AH
JZ HLT

Which simply jumps to the HLT routine, which appears to pause for an Input (using IN 0FFH again), then restart.

I was simply wondering what sort of machine this was written on, I can only imagine that because the code was so short and well commented, I was able to substitute what would work on my computer.


The 2nd thing I became intrigued with regards Tiny BASIC and how a number of versions were created on computers with 4k. I had a look specifically at Palo Alto Tiny BASIC, though initially didn't realise they were created for TTX based system with 8080 processors, though I had to wonder if I could persevere on it if it could be created to function under VDM, or perhaps when I was reading about this Language being translated if perhaps CP/M had a version? I'm a bit confused if it had since Tiny BASIC was designed for systems with small amount of memory, but I thought if I was going to try and understand Languages better, then finding something small would be a good start.
 
My first thought based on looking at the article was that it related to the Processor Technology VDM-1 but the port reference (i.e., the "OUT 8CH") is different than in the VDM-1 manual, which interestingly is C8H. I would take a look at that manual and see if the sample 8080 code lines-up properly. Generally 8080 code will run unmodified on a Z80, but the reverse isn't always possible (the Z80 has a few Z80-specific instructions).

Rich
 
Generally 8080 code will run unmodified on a Z80, but the reverse isn't always possible (the Z80 has a few Z80-specific instructions).

A few? How about "roughly double the number of 8080 instructions"? :)

One of the options for my emulator was to start in 8080 mode, but switch to Z80 mode the moment a Z80-specific instruction was encountered. Usually that happened within the first dozen instructions of an application.
 
I don't know how true it is, but was lead to believe a Z80 opcode always begins with ED?

Some but definitely not all. Other Z80 instruction prefixes are DD, FD and CB. And some like the relative jumps reside in the main code page without a prefix.
 
Back
Top