home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
DISASM
/
REVAS25.LBR
/
MAN1.WZ
/
MAN1.WS
Wrap
Text File
|
2000-06-30
|
13KB
|
296 lines
REVAS V2
Z80/8080 DISASSEMBLER
.USER'S MANUAL
Copyright (c) 1978
A.E. HAWLEY
LOS ANGELES, CALIF.
.HE INTRODUCTION
.PAè *** REVAS ***
REVERSE ASSEMBLER FOR Z80 OBJECT CODE PROGRAMS
REVA╙á i≤ aε interactivσ reversσ assemble≥ (disassembler⌐ ì
designeΣá t∩ translatσ Z8░ o≥ 808░ machinσ languagσ codσ int∩á aε ì
assembly-likσ listing«á I⌠ i≤ writteε iε Z8░ codσ anΣ caε bσ useΣ ì
iεá an∙ systeφ tha⌠ use≤ ß Z8░ centra∞ processor«á I⌠ support≤á ß ì
puncΦ anΣ linσ printe≥ a≤ wel∞ a≤ ß CR╘ o≥ TTY.
WitΦá 2▓á commands¼á REVA╙á caε hel≡á you║á
**Analysσ undocumenteΣ program≤
áááááááááá**Documen⌠ you≥ machinσ languagσ patches
áááááááááá**Documen⌠ you≥ specia∞ I/╧ routines
áááááááááá**Debuτ developmenta∞ programs
áááááááááá**Modif∙ anΣ relocatσ you≥ software
Herσ arσ somσ oµ REVASº features║
áááááááááá**Assembl∙ forma⌠ listings
áááááááááá**Outpu⌠ suitablσ fo≥ reassembly
áááááááááá**Generate≤ synthetiπ labels
áááááááááá**Accept≤ you≥ choicσ oµ rea∞ labels
áááááááááá**Print≤ table≤ iε datß format
áááááááááá**Display≤ alphanumeriπ equivalent≤ oµ thσ machinσ code
áááááááááá**Display≤ symbo∞ tablσ a⌠ an∙ time
áááááááááá**Cros≤ referencσ listinτ show≤ wherσ anΣ ho≈ eacΦ ì
áááááááááásymbo∞ i≤ used
áááááááááá**U≡ t∩ │ outpu⌠ device≤ caε bσ used
áááááááááá**Yo⌡ arσ alway≤ iε completσ contro∞ oµ thσ ì
áááááááááádisassembl∙ process..sto≡ anΣ restart¼ returε t∩ ì
áááááááááámonitor¼ o≥ returε t∩ commanΣ modσ a⌠ will
.pßè Thσá instructioε mnemonic≤ produceΣ b∙ REVA╙ arσ thσ samσ ì
a≤ thosσ useΣ b∙ thσ Technica∞ Desigε Labsº Z-8░ Relocatinτ Macr∩ ì
Assembler¼ anΣ b∙ Inte∞ fo≥ thσ 8080.
Thσá remainde≥ oµ thi≤ manua∞ show≤ yo⌡ ho≈ t∩ makσ REVA╙ ì
worδ fo≥ you.
Thσá '┴á LITTL┼ INSIGHTº sectioε introduce≤á thσá genera∞ ì
algorithφá b∙á whicΦ REVA╙ perform≤ ßá disassembly«á Thσá usσá oµ ì
table≤á i≤á explaineΣ anΣ relateΣ t∩ thσ command≤ tha⌠ usσá thesσ ì
tables« Yo⌡ wil∞ neeΣ t∩ understanΣ thi≤ subjec⌠ iε orde≥ t∩ makσ ì
mos⌠ effectivσ usσ oµ thσ REVA╙ capabilities«á Iε particular¼ thσ ì
tw∩ mos⌠ frequentl∙ useΣ command≤ arσ introduceΣ iε tha⌠ section.
Iε thσ 'REVA╙ COMMANDSº section¼ yo⌡ wil∞ finΣ ß detaileΣ ì
descriptioεá oµ thσ synta° anΣ operatioε oµ eacΦá command«á Unti∞ ì
yo⌡á becomσ thoroughl∙ familia≥ witΦ thσ commanΣá set¼á yo⌡á wil∞ ì
havσá frequen⌠á usσ fo≥ thi≤ section«á ┴ carefu∞ readinτá oµá thσ ì
forma∞á commanΣá description≤ wil∞ revea∞ thσ freedoφá oµá forma⌠ ì
tha⌠á i≤ designeΣ int∩ thesσ commands«á ┴ lis⌠ oµ REVA╙á COMMAND╙ ì
appear≤ oε thσ bacδ cove≥ fo≥ read∙ reference.
Thσá IMPLEMENTATIO╬ sectioε contain≤ thσ informatioεá yo⌡ ì
neeΣá t∩á loaΣ REVA╙ int∩ you≥ systeφ anΣ properl∙á interfacσá t∩ ì
you≥á I/╧ devices«á Thσ I/╧ jum≡ vector≤ arσ explaineΣ there¼á a≤ ì
wel∞á a≤á thσ registe≥ usagσ associateΣ witΦá I/O«á Somσá oµá thσ ì
addresse≤á anΣá thei≥ function≤ withiε REVA╙ arσ giveε t∩á permi⌠ ì
mino≥ change≤ t∩ bσ madσ iε outpu⌠ forma⌠ iµ yo⌡ wish.
ReaΣá thσ manua∞ clea≥ througΦ beforσ tryinτá t∩á operatσ ì
REVAS¼ theε refe≥ t∩ i⌠ frequently« Theε g∩ aheaΣ anΣ disassemblσ ì
something!
Onσ caution!
Thinδ carefull∙ beforσ yo⌡ usσ thσ 'Aº commanΣ o≥ thσ 'Gº ì
command«á The∙á caεá causσá ß systeφ crash╗á thσ 'Aºá commanΣá b∙ ì
assigninτá table≤á iεá ß prograφ area¼á anΣ thσá 'Gºá commanΣá b∙ ì
callinτ aε addres≤ tha⌠ i≤ no⌠ thσ subroutinσ yo⌡á intended«á Yo⌡ ì
havσá contro∞á oµá sucΦ situation≤ becausσ yo⌡ arσá thσá onσá wh∩ ì
specifie≤ thσ addres≤ fo≥ thesσ commands.
I⌠á i≤á m∙ inten⌠ t∩ furnisΦ softwarσá anΣá documentatioε ì
tha⌠á i≤á a≤á usefu∞ anΣ freσ oµ error≤ a≤á possible«á Thσá REVA╙ ì
prograφá ha≤ beeε iε constan⌠ usσ durinτ it≤á owεá development(!⌐ ì
anΣ fo≥ man∙ month≤ b∙ severa∞ user≤ beforσ thσ firs⌠ versioε wa≤ ì
released«á Al∞ knowε bug≤ havσ beeε exterminated« ╔ aφ interesteΣ ì
iε improvinτ whereve≥ possiblσ thσ qualit∙ oµ thσ prograφ anΣ it≤ ì
documentation«á Thus¼á ╔ wil∞ welcomσ anΣ responΣ t∩ comment≤ anΣ ì
recommendation≤á sen⌠ t∩ thσ addres≤ below«á (accolade≤ arσá als∩ ì
welcome!⌐ Pleasσ includσ ß stampeΣ self-addresseΣ envelopσ iµ yo⌡ ì
wisΦ ß reply.
A∞ Hawley
ì
.hσ ┴ LITTL┼ INSIGH╘
.pßè HO╫ TH┼ DISASSEMBLE╥ WORKS
Herσ i≤ ß brieµ descriptioε oµ REVAS:
Prograφá size-- 4δ byte≤
Symbo∞ tablσ location--enΣ oµ REVA╙ o≥ a≤ assigned
Symbo∞ tablσ usage--
synthetiπ symbol≤ ┤ bytes/symbol
assigneΣ label≤ ╢ bytes/label
Symbo∞ tablσ lengtΦ i≤ initiall∙ zero¼á increasinτ a≤ requireΣ t∩ ì
accomodatσ symbol≤ anΣ u≡ t∩ 68▓ labels.
Thσá objec⌠ prograφ t∩ bσ disassembleΣ mus⌠ bσ iεá memor∙ ì
a⌠á it'≤ norma∞ location«á Wheε contro∞ i≤ passeΣ t∩á REVAS¼á thσ ì
promp⌠á character(#⌐ wil∞ appea≥ anΣ yo⌡ ma∙ responΣ witΦ onσá oµ ì
thσ command≤ describeΣ iε thσ nex⌠ section«á Let'≤ star⌠ witΦ thσ ì
'Dº (displa∙ disassembly⌐ command:
REVA╙á wil∞ examinσ thσ bytσ locateΣ a⌠ thσ star⌠ addres≤ ì
anΣ analysσ i⌠ a≤ thσ firs⌠ bytσ oµ aε instructioε b∙ findinτá i⌠ ì
iε interna∞ looku≡ tables« Thσ operato≥ mnemoniπ i≤ obtaineΣ froφ ì
thσá tables¼á a≤á wel∞á a≤á thσ numbe≥ oµ byte≤á iεá thσá curren⌠ ì
instruction.
Thσ operanΣ fielΣ contents¼á iµ any¼á arσ nex⌠ determineΣ ì
b∙ ß combinatioε oµ logica∞ operation≤ anΣ tablσ lookup.
Thσ operato≥ anΣ operanΣ arσ storeΣ iε appropriatσ field≤ ì
oµ thσ linσ buffer(LB).
Next¼á thσ addres≤ oµ thσ instructioε anΣ thσ objec⌠ codσ ì
arσá storeΣ iε thσ L┬ a≤ he° characters¼á anΣ thσ objec⌠ codσá i≤ ì
converteΣá anΣá placeΣá iε thσ commen⌠ fielΣ oµá thσá buffe≥á fo≥ ì
printou⌠ a≤ ASCI╔ data.
Thσá symbo∞ table≤ arσ searcheΣ fo≥ ß labe∞á assigneΣá t∩ ì
thσ addres≤ jus⌠ defined«á Iµ ß labe∞ i≤ found¼ i⌠ i≤ inserteΣ iε ì
thσá labe∞ fielΣ oµ thσ linσ buffer«á Iµ therσ i≤ n∩ label¼á theε ì
thσ table≤ arσ searcheΣ fo≥ ß synthetiπ labe∞ t∩ insert«á Iµ nonσ ì
exists¼ theε thσ fielΣ i≤ lef⌠ blank« Label≤ caε bσ righ⌠ o≥ lef⌠ ì
justifieΣ (seσ PatcΦ Location≤ below).
No≈ thσ content≤ oµ L┬ arσ printeΣ oε thσ outpu⌠ devices¼ ì
thσ consolσ i≤ checkeΣ fo≥ an∙ pendinτ commands¼á anΣ thσ proces≤ ì
i≤ repeateΣ unti∞ terminateΣ b∙ reachinτ thσ las⌠ addres≤ o≥ b∙ ß ì
commanΣ froφ thσ console«
Thσ symbo∞ table≤ comprisσ tw∩ tables║ aε inde° tablσ anΣ ì
ß labe∞ table« Thσ inde° tablσ i≤ constructeΣ durinτ executioε oµ ì
thσá 'Bºá command«á I⌠á contain≤ thσ he° valuσá oµá eacΦá 1╢á bi⌠ ì
argumen⌠á encountereΣá iεá thσá addres≤á range≤á tha⌠á havσá beeε ì
disassembled«á I⌠á als∩á contain≤ flag≤ whicΦ indicatσá fo≥á eacΦ ì
entr∙á thσ presencσ oµ aε assigneΣ label¼á thσ modσ oµ thσá labe∞ ì
(instructioεá modσ o≥ tablσ mode)¼á anΣ ß pointe≥ t∩ thσ locatioε ì
oµ thσ assigneΣ labe∞ iε thσ seconΣ (label)table« Thσ 'Kº commanΣ ìèdelete≤ entrie≤ froφ thσ index«á Thσ 'Mº commanΣ change≤ thσ flaτ ì
whicΦ indicate≤ labe∞ mode« Thσ 'Fº commanΣ add≤ it'≤ argumen⌠ t∩ ì
thσ inde° tablσ iµ i⌠ i≤ no⌠ alread∙ there.
Thσá labe∞ tablσ (assigneΣ labels⌐ i≤ constructeΣá durinτ ì
executioεá oµ thσ 'L','S'¼á o≥ 'Tº commands«á Wheε onσá oµá thesσ ì
command≤ i≤ given¼ thσ labe∞ specifieΣ iε thσ commanΣ i≤ addeΣ t∩ ì
thσá labe∞á table«á Thσá inde°á tablσ i≤ theεá searcheΣá fo≥á thσ ì
correspondinτá he°á valuσá (addres≤ oµ thσ labe∞á iεá thσá objec⌠ ì
program⌐ anΣ ß pointe≥ i≤ entereΣ iε thσ inde° tablσ tha⌠á point≤ ì
t∩á thσá labe∞ entry«á Iµ therσ i≤ n∩ correspondinτ entr∙ iεá thσ ì
inde° table¼á theε onσ i≤ created«á Thus¼ thesσ command≤ als∩ ac⌠ ì
t∩á builΣá thσá inde° table«á Thσ 'Sº commanΣ reset≤á ßá flaτá t∩ ì
indicatσá tha⌠á thi≤ labe∞ belong≤ t∩á aεá instruction«á Thσá 'Tº ì
commanΣá set≤á thσ flaτ t∩ indicatσ tha⌠ thi≤ labe∞ belong≤ t∩á ß ì
bytσá iε ß tablσ oµ data«á Thσ 'Lº commanΣ leave≤ thσá modσá flaτ ì
unchanged.
┴á descriptioεá oµá thσ flaτ anΣ pointe≥á word≤á fo≥á thσ ì
symbo∞á table≤ i≤ includeΣ iε thσ implementatioε section«á Iµ yo⌡ ì
choosσá t∩ storσ thσ table≤ (oε tapσ o≥ disc¼á fo≥á example⌐á fo≥ ì
futurσ use¼á theε yo⌡ mus⌠ bσ surσ t∩ als∩ recorΣ thesσ location≤ ì
anΣ restorσ theφ wheε yo⌡ restorσ thσ tables.
Mode¼ Modσ Character¼ anΣ Modσ Control
Thσá characte≥á immediatel∙ followinτ thσ 'Dº o≥á 'Bºá iε ì
thosσá command≤á i≤ thσ modσ character«á Tw∩ mode≤ arσá possible║ ì
instructioε modσ anΣ tablσ mode«á Tablσ modσ i≤ specifieΣ iµá thσ ì
modσ characte≥ i≤ ß 'T'╗ an∙ othe≥ specifie≤ instructioε mode.
Iεá thσ instructioε mode¼á byte≤ froφ thσ objec⌠á prograφ ì
arσ interpreteΣ a≤ Z-8░ anΣ 808░ instructions.
Iεá thσá tablσ mode¼á byte≤ froφ thσ objec⌠á prograφá arσ ì
interpreteΣ a≤ single-bytσ constant≤ whicΦ arσ par⌠ oµ ß tablσ oµ ì
data.
Therσá arσá tw∩ flag≤ associateΣ witΦ modσá control«á Thσ ì
modσ contro∞ flaτ i≤ se⌠ (o≥ reset⌐ b∙ thσ modσ contro∞ characte≥ ì
wheε thσ 'Dº o≥ 'Bº commanΣ i≤ issueΣ t∩ REVAS«á Thσ seconΣ flag¼ ì
thσá modσ bit¼á i≤ par⌠ oµ thσ datß storeΣ fo≥ eacΦ entr∙ iεá thσ ì
inde° table« Thσ modσ bi⌠ i≤ se⌠ o≥ rese⌠ durinτ executioε oµ thσ ì
'B','M','S',anΣ 'Tº commands«á Thσ functioε oµ thσ 'Mº commanΣ i≤ ì
t∩á definσ thσ statσ oµ thσ modσ bi⌠ fo≥ ßá particula≥á (address⌐ ì
entr∙á iεá thσá inde° table¼á creatinτ ß dumm∙ entr∙ iµá nonσá i≤ ì
presen⌠ wheε thσ commanΣ i≤ given.
Operatioε oµ thσ 'Dº Command
Thσ 'Dº commanΣ display≤ thσ disassembl∙ oε thσá selecteΣ ì
outpu⌠á device(s)¼á usinτ thσ modσ contro∞ flaτ t∩ determinσá thσ ì
forma⌠ oµ thσ output.è
***Iµáá aεáá inde°á tablσá entr∙á matchinτá thσáá curren⌠ ì
instructioεá o≥ datß bytσ addres≤ i≤ encountered¼á theε thσá modσ ì
bi⌠á froφ tha⌠ tablσ entr∙ replace≤ thσ modσá contro∞á flag╗á thσ ì
outpu⌠á forma⌠á (o≥ mode⌐ i≤ controlleΣ fo≥ thi≤á anΣá subsequen⌠ ì
byte≤ b∙ thi≤ ne≈ modσ contro∞ flag.***
Clearly¼ wheε thσ inde° tablσ i≤ empt∙ (a⌠ thσ star⌠ oµ ß ì
sessioεá o≥ afte≥ thσ 'Iº command⌐ al∞ outpu⌠ forma⌠ i≤ specifieΣ ì
b∙á thσ modσ contro∞ character«á Afte≥ an∙ oµ thσ tablσá buildinτ ì
command≤á (B,L,M,S,T⌐ havσ beeε executed¼á modσ informatioεá froφ ì
thσ inde° tablσ entrie≤ wil∞ bσ useΣ a≤ appropriate.
Operatioε oµ thσ 'Bº Command
Thσ 'Bº commanΣ function≤ mucΦ likσ thσ 'Dº command«á Onσ ì
differencσ i≤ iε thσ usσ oµ thσ modσ flags.
***When¼á durinτá disassembly¼á aε inde° tablσá entr∙á i≤ ì
founΣ whicΦ matche≤ thσ curren⌠ instructioε o≥ bytσ address¼á thσ ì
modσá bi⌠á oµá thσá entr∙á i≤ changeΣá t∩á corresponΣá witΦá tha⌠ ì
specifieΣ b∙ thσ curren⌠ modσ contro∞ flag.***
Anothe≥ differencσ i≤ thσ tablσ buildinτ function« Wheε ß ì
1╢á bi⌠á argumen⌠ i≤ founΣ iε thσ curren⌠ operanΣá field¼á i⌠á i≤ ì
replaceΣ b∙ ß synthetiπ symbo∞ formeΣ b∙ thσ concatenatioε oµá aε ì
'Sº o≥ 'Tº anΣ thσ he° representatioε oµ thσ argument«á Thσ firs⌠ ì
lette≥á wil∞ bσ aε 'Sº iµ therσ i≤ n∩ inde° tablσ entry«á I⌠ wil∞ ì
bσá eithe≥á 'Sº o≥ 'Tº (dependinτ oε thσ statσ oµ thσá modσá bit⌐ ì
wheε aε entr∙ alread∙ exists«á Iµ thi≤ i≤ thσ firs⌠ occurencσá oµ ì
thσá argumen⌠ value¼á theε aε entr∙ i≤ createΣ iε thσ inde° tablσ ì
whosσá modσ bi⌠ specifie≤ instructioεá modσá ('S')«á Later¼á wheε ì
table≤á oµá datßá arσ beinτ disassembleΣ witΦ thσá 'BTºá command¼ ì
thosσá argument≤ iε thσ inde° tablσ tha⌠ refe≥ t∩ label≤á iεá thσ ì
object-prograφá tablσá areß wil∞ havσ thei≥ modσ bit≤ changeΣá t∩ ì
specif∙ tablσ ('T'⌐ mode«á Incidentally¼á thσ inde° tablσá itselµ ì
caε bσ listeΣ usinτ thσ 'DTº command.
Notσá tha⌠á iµ ß tablσ oµ datß iε thσ objec⌠á prograφá i≤ ì
disassembleΣ usinτ thσ 'B?º (┐á no⌠ ß 'T'⌐ command¼ man∙ spuriou≤ ì
argument≤á wil∞á bσ generateΣ anΣ storeΣ iε thσ inde° tablσá witΦ ì
curiou≤ effect≤ durinτ late≥ listing«á Fo≥ example¼á thσ he° codσ ì
sequencσá 2░á 20...(ASCI╔á blanks⌐á woulΣá bσá interpreteΣá a≤á ß ì
relativσ jum≡ froφ thσ Z-8░ instructioε set¼á anΣ thσ destinatioε ì
oµá thσ jum≡ woulΣ bσ storeΣ iε thσ inde° a≤ thσ curren⌠á addres≤ ì
plu≤ 20H«á simila≥ situation≤ exis⌠ fo≥ codσ sequence≤ tha⌠á looδ ì
likσ LXI¼ SHLD¼ LDA¼ etc.¼ froφ thσ 8080/Z-8░ instructioε sets.
Becausσá oµ thσ abovσ considerations¼á i⌠ i≤ usuall∙ bes⌠ ì
t∩ analysσ objec⌠ codσ initiall∙ witΦ thσ 'Dº command¼á reservinτ ì
thσ usσ oµ thσ 'Bº commanΣ unti∞ thσ instructioε anΣ tablσá area≤ ì
havσá beeεá located«á Theε thσ 'Bº commanΣ caε bσ useΣá t∩á builΣ ì
table≤á (anΣ assigε synthetiπ symbols)¼á firs⌠ t∩ thσ instructioε ì
areas¼ anΣ theε t∩ thσ table≤ oµ data«è