Welcome to Part 11 – I hope that you managed to struggle
through Part T alright, but don’t worry, it can only get worse.
By now you shoud have your print routine working to your
satisfaction – called PROIS.
Now there are 9 subroutines to wite, yes 9! and also a lot
af data. One of these, is a sort of controller, and calls one of
the remainder depending upon the data it is fed. A great deal of
the disassembler is a Qreat deal. of data, organised into
I will define the control routines
1) On entry HL’ contains a pointer to some data, This holds
the routine number to. which control will” pass. This
routine number is held in the least 3 significant bits
(0, 1, 2) so ANDing the contents of HL” Cie (HU) with 7
will give this number. Don’t forget to increment HL’ to
point to the next piece of valuable data.
14) Bits 3, 4 and 5S may contain data that the called
subroutine will need, though not the only data it aay
heed. Consequently the data byte Cie (HL’) before
incrementing’’] must be put somenhere – just in case.
111) BLt 7 of this data byte fs used as a sort of ‘atop’ flag.
Tf it is not set the CONTROL will loop back on itself in
order to call the next routine. If it is set then CONTROL
Will break out of the loop, call PRDIS and then move onto
the next op-code ta be disassembled.
Obviously HL” mist contain the correct address. This is
achieved by creating a table of twelve addresses, corresponding
to the 12 Combinations of TYPE and F.. Let me’ explain, TYPE
represents whether the instruction to be disassembled began with
£ED, ECB or neither. It can only have 3 possible values – use 0,
I and 2 because life is so much easier. F will hold bits & and 7
of the instruction being. disassembled. Therefore, it has 4
possible values. Hence 12 combinations. There should be an
address in your table for each possible case. Get it into HL".
This should cause na problems 1f you order your table
correctly. For examplet (and may I recommend this method)
TAPSt TYRE = 0) = 0
Tee = 0 f=
Wee SF =?
Wee = 2 F=3
Now the first byte of each address is given by TABST + (2 x
This is an OCR’d version of the scanned page and likely contains recognition errors.