Advanced CP/M
Part Eight
by Ron Collins
This article originally appeared in the September 1991 MOAUG
newsletter.
........Continued from last month..... In the case of this two drive
system, you would change the text I listed above from this:
;valid drives - set to 0 if present, 0FFH otherwise ; VALDRV:
DB 0 ;drive A
DB 0 ;drive B
DB 0 ;drive C
DB 0 ;drive D
DB 0FFH ;drive E
DB 0FFH ;drive F
DB 0FFH ;drive G
DB 0FFH ;drive H
DB 0FFH ;drive I
DB 0FFH ;drive J
DB 0FFH ;drive K
DB 0FFH ;drive L
DB 0FFH ;drive M
DB 0FFH ;drive N
DB 0FFH ;drive O
DB 0FFH ;drive P
to this:
;valid drives - set to 0 if present, 0FFH otherwise ; VALDRV:
DB 0 ;drive A
DB 0 ;drive B
DB 0FFH ;drive C
DB 0FFH ;drive D
DB 0FFH ;drive E
DB 0FFH ;drive F
DB 0FFH ;drive G
DB 0FFH ;drive H
DB 0FFH ;drive I
DB 0FFH ;drive J
DB 0FFH ;drive K
DB 0FFH ;drive L
DB 0FFH ;drive M
DB 0FFH ;drive N
DB 0FFH ;drive O
DB 0FFH ;drive P
As you can see, CP/M supports up to 16 different storage devices and
your own system knows how to talk to any of them by it's own drive
letter. It is your job in many cases, to tell your program about these
drives that IT can use that are present on your system.
The case of the drive assignments is relatively easy to pick out among
all the rest of that TERMINAL.Z80 file, but what about the other
important patching areas? Sometimes, you have to be a bit of a detective
to deduce just what calling conventions are being used by any particular
author. It has been my experience that as most programmers write the
code for such things as inverse video, line inserts, screen clears,
etc., they tend to label them in an easy to pick out fashion. The key is
in our being able to look at that code and recognize these labels for
what they are.
Suppose I had an overlay file such as the one above, but that has been
patched for a Kaypro 1 computer system. To convert the code to match
what my ADAM uses would require me to have a listing of all codes used
by the Kaypro for video sequences. I won't list the whole file again as
I did above, but just a few of the more important screen codes to give
you an idea what we would be up against in converting that code to the
Heath screen codes.
;sequence to turn inverse (or dim) video on ; IVON$: DB ESC,'B0',0,0,0,0
;must be exactly 6 bytes - fill with 0
DB 0 ;end of string marker - do not change ; ;sequence to turn inverse
(or dim) video off ; IVOFF$: DB ESC,'C0',0,0,0,0 ;must be exactly 6
bytes - fill with 0
DB 0 ;end of string marker - do not change ; ;sequence to clear screen
and home cursor ; CLEAR$: DB 1AH,0,0,0,0,0
DB 0,0,0,0,0,0 ;must be exactly 12 bytes - fill with 0
DB 0 ;end of string marker - do not change
Take a look at the sequence to clear the display screen and to home the
cursor into the upper left corner of your screen. The Kaypro uses a
CONTROL-Z command to implement this function. If you take a look at your
CP/M manual's control codes listing, you can pick out the HEX code
needed to represent the CONTROL-Z. In this case, that would be a 1A in
hex. You could also use simply a decimal code, in this case 26. Since I
prefer using HEX codes, I have to also tell my program that the 1A is a
HEX value, this the 1AH you see in the label for CLEAR$.
The codes IVON$ and IVOFF$ represent inverse on and inverse off
respectively. Some programmers will refer to this sequence as reverse
video represented by something like: RVON$ or RVOFF$, while others may
refer to DIMON$ or DIMOFF$ for DIM video on and off. In the case of the
Kaypro, REVERSE video and DIM video or both supported as separate
entities. You can even mix and match them into a DIM/INVERSE video by
use of both codes!
The most important thing to remember here is that if you have a program
designed for a particular computer, and you want to move this file over
to use it on your ADAM, you MUST know the screen codes for the original
computer as well as those for your ADAM.
When all of the codes have been changed to match the proper codes you
want, you will want to save this new version by pressing your ESCAPE key
followed by the X key. This will tell VDE or ZDE to save your new code,
create a backup of the original and kick out of the word processing
program and back to standard CP/M.
Back to
Top
|