Looking at the bit patterns for the Z80 instruction set
(they are nicely tabulated in your Nascom manual -.. towards the
back}, you will notice that many groups of instructions use the
middie three bite to represent 2 register, condition, arithmetic
Gperation, or a number from oO to 7 (for the bitwise
operations)(r, cy a & n respectivelyl.
Bits or . a a
000 8 Nz o abo a
001 c z 1 Ape
10 D Ne 2 sup
on E c 3 sec A
100 4 Fo a ND
101 L PE 5 xOR,
110 INDIsP e oR
au a " 7 ce
INDIS represents an index register HL, IX or IY (and the
displacenent if necessary). A Similar ‘system operates with
Bits ss ad
00 BE BC
oO De De
10 IND IND
a SP oF
Where IND represents one of the index registers (HL, IX, 1Y)
but with no displacements. Make sure that you understand this,
because basically disassembley is analysis of bit patterns. i
did not, and wrote a disasseabler so complex even I could not
make head nor tail of it’! These tables will have to go inte
tables in the computer as they are crucial. You will have to
define a character to represent INDIS and IND as we don’t yet
know which of the index registers to output’’ Remember these as
Hf they were arrays, eg. r(0) – r(7) etc.
The disasseabler is going to need one vital piece of
information before it starts. Elementary – where to start froa.
This can easily be done using the Nas-Sys routine ARGS. Load
this disassembly address into BC’ (the alternate registers are
identified by“). This piece of your program is the first
encountered on a run and is not used” again. From now on the
disascembley address is always in BC’. It must be the first byte
of an instruction or else there will be havec!’ Next thing to
da 14 to set STRDIS to an empty string.
Now there are two more variables – held also in the
alternate registers (use D’ and E’) – te be initialised.” Call
one INDEX, the print routine will require this. The other call
TYPE and this holds information as to whether the instruction
began with £8, LED or neither. Set both these to zero. Take #
deep breath and begin!!!
This is an OCR’d version of the scanned page and likely contains recognition errors.