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
/
GENASM
/
EM220.LBR
/
EM220.LQT
/
EM220.LST
Wrap
File List
|
2000-06-30
|
11KB
|
245 lines
EM220 - 8080A Microprocessor Instruction Set Emulator Page 1
by Jeffery Sheese
Computer Education Program Coordinator
Detroit Engineering Institute
2030 West Grand River
Detroit, Michigan 48226
(313) 222-7450
USENET - ihnp4!{m-net,aix,crlt,chinet,itivax!gdsb}!jeffery
Revision 2.20 - Made following changes: (JES) 05-07-86
AsciΘ character≤ ma∙ no≈ bσ entereΣ a≤ singlσ operand≤ ì
ááááádelimiteΣ b∙ singlσ quotes¼ sucΦ a≤ MV╔ A,'G'« Thσ onl∙ ì
áááááprobleφ witΦ thi≤ i≤ tha⌠ thσ character≤ tha⌠ appea≥ iε thσ ì
áááááoperaεd fielΣ arσ converteΣ t∩ thσ uppe≥ casσ asciΘ codes« ì
áááááFo≥ instance¼ 'gº ╜ 67h¼ bu⌠ i≤ converteΣ t∩ 'G'¼ whicΦ i≤ ì
ááááá47h.
Al∞ CP╒ register≤ defaul⌠ t∩ zero¼ excep⌠ thσ P├ anΣ SP¼ ì
áááááwhich default to 2000h and 2500h respectively.
Revision 2.12 - Fixed following bugs: (JES) 10-22-85
Conditional jumps and calls will now work.
Revision 2.11 - Fixed following bugs: (JES) 09-06-85
Thσ backspacσ ke∙ wil∞ no≈ erasσ character≤ oε thσ entr∙ ì
áááááline« Thσ curso≥ wil∞ n∩ longe≥ backspaceΣ int∩ thσ commanΣ ì
ááááálinσ prompt.
Revision 2.10 - Rewrote Introduction (JES) 09-06-85
Revision 2.00 - Original Release (JES) 08-18-82
Iµ an∙ bug≤ arσ noted¼ o≥ correction≤ made¼ pleasσ refe≥ theφ ì
t∩ thσ abovσ address.
Thσ 8080┴ Instructioε Se⌠ Emulato≥ i≤ ß teachinτ too∞ useΣ ì
t∩ demonstratσ thσ operatioε oµ 8080 assembl∙ languagσ command≤ ì
anΣ ho≈ the∙ affec⌠ thσ memor∙ anΣ microprocesso≥ registe≥ ì
contents« Thσ emulato≥ wa≤ designeΣ t∩ ac⌠ a≤ ß machinσ languagσ ì
'interpreter'¼ whicΦ closel∙ resemble≤ ß BASI├ interpreter« Thi≤ ì
allow≤ thσ machinσ languagσ studen⌠ t∩ operatσ thσ compute≥ iε ß ì
machinσ languagσ 'directº mode« Iε BASIC¼ thσ 'directº modσ i≤ ì
wheε ß persoε type≤ iε ß commanΣ sucΦ a≤ PRIN╘ anΣ watche≤ thσ ì
result≤ oµ thσ command« Thσ emulato≥ wil∞ speeΣ learninτ anΣ ì
comprehensioε iε ß positivσ anΣ instructivσ atmosphere.
Wheε thσ prograφ i≤ run¼ ß sign-oε messagσ i≤ printeΣ oε thσ ì
screen¼ anΣ immediatel∙ followinτ i≤ thσ prompt:
Initial status:
PC S Z A P C A B C D E H L M SP STACK
2000 0 0 0 0 0 00 00 00 00 00 00 00 C3 2500 3236
Instruction: _
Copyright 1986 All Rights Reserved
EM220 - 8080A Microprocessor Instruction Set Emulator Page 2
Thσ firs⌠ linσ i≤ ß descriptioε oµ thσ typσ oµ register≤ iε ì
thσ 808░ microprocessor« Unde≥ eacΦ descriptioε i≤ thσ actua∞ ì
conten⌠ oµ thσ register« Thσ letter≤ S¼ Z¼ A¼ P¼ anΣ ├ arσ thσ ì
statu≤ flags« The∙ changσ a≤ thσ microprocesso≥ statu≤ changes« ì
Thei≥ function≤ anΣ description≤ follow:
Sign (S) - Thi≤ flaτ show≤ iµ thσ sigε oµ thσ resul⌠ oµ thσ ì
ááááááááááááááálas⌠ operatioε wa≤ positivσ o≥ negative« Thσ sigε ì
áááááááááááááááflaτ wil∞ bσ ß ▒ iµ negative¼ o≥ ß ░ iµ positive.
Zero (Z) - Thi≤ flaτ show≤ iµ thσ resul⌠ oµ thσ las⌠ ì
áááááááááááááááoperatioε wa≤ zero« Iµ thσ resul⌠ i≤ zero¼ thσ ì
áááááááááááááááflaτ wil∞ bσ 1« Iµ i⌠ wa≤ no⌠ zero¼ thσ flaτ wil∞ ì
ááááááááááááááábσ 0.
Auxiliary
Carry (A) - Iµ thσ resul⌠ oµ thσ las⌠ operatioε causeΣ ß carr∙ ì
áááááááááááááááfroφ bi⌠ threσ t∩ bi⌠ fou≥ oµ thσ accumulator¼ ì
áááááááááááááááthi≤ flaτ wil∞ bσ ß 1« Sincσ i⌠ i≤ onl∙ useΣ fo≥ ì
áááááááááááááááthσ DA┴ instruction¼ i⌠ i≤ generall∙ no⌠ testeΣ b∙ ì
áááááááááááááááthσ user≤ program.
Parity(P) - Thi≤ flaτ show≤ iµ thσ resul⌠ oµ thσ las⌠ ì
áááááááááááááááoperatioε resulteΣ iε aε eveε o≥ odΣ numbe≥ oµ ì
áááááááááááááááone≤ iε thσ resultinτ byte« I⌠ wil∞ bσ ß ┐ iµ ì
ááááááááááááááátherσ i≤ aε eveε numbe≥ oµ se⌠ bits¼ o≥ ┐ iµ therσ ì
ááááááááááááááái≤ aε odΣ numbe≥ oµ ┐ bits.
Carry (C) - Thi≤ flaτ show≤ iµ thσ resul⌠ oµ thσ las⌠ ì
áááááááááááááááoperatioε causeΣ ß carr∙ o≥ ß borro≈ froφ thσ mos⌠ ì
ááááááááááááááásignifican⌠ bi⌠ oµ thσ result« I⌠ wil∞ bσ ▒ iµ ß ì
ááááááááááááááácarr∙ o≥ ß borro≈ diΣ occur¼ o≥ i⌠ wil∞ bσ ░ iµ i⌠ ì
ááááááááááááááádiΣ no⌠ occur.
Thσ res⌠ oµ thσ linσ wil∞ sho≈ thσ microprocessor'≤ genera∞ ì
purposσ registers« ┴ descriptioε oµ eacΦ registe≥ follows:
PC - Thi≤ wil∞ sho≈ thσ curren⌠ addres≤ oµ thσ prograφ ì
áááááááááácounter« D∩ no⌠ le⌠ thi≤ g∩ belo≈ 2000H« Iµ i⌠ does¼ ì
ááááááááááyo⌡ ma∙ accidentall∙ alte≥ memor∙ tha⌠ i≤ essentia∞ fo≥ ì
ááááááááááthσ emulato≥ o≥ thσ operatinτ systeφ oµ you≥ computer.
A - Thi≤ wil∞ sho≈ thσ content≤ oµ thσ accumulato≥ afte≥ ì
ááááááááááthσ las⌠ instructioε typed.
B - Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ┬ registe≥ afte≥ thσ ì
áááááááááálas⌠ instructioε typed.
C - Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ├ registe≥ afte≥ thσ ì
áááááááááálas⌠ instructioε typed.
D - Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ─ registe≥ afte≥ thσ ì
áááááááááálas⌠ instructioε typed.
Copyright 1986 All Rights Reserved
EM220 - 8080A Microprocessor Instruction Set Emulator Page 3
E - Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ┼ registe≥ afte≥ thσ ì
áááááááááálas⌠ instructioε typed.
H - Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ╚ registe≥ afte≥ thσ ì
áááááááááálas⌠ instructioε typed.
L - Thi≤ wil∞ sho≈ thσ content≤ oµ thσ ╠ registe≥ afte≥ thσ ì
áááááááááálas⌠ instructioε typed.
M - Thi≤ wil∞ sho≈ thσ content≤ oµ thσ memor∙ addres≤ ì
áááááááááápointeΣ t∩ b∙ thσ H-╠ registe≥ pair.
SP - Thi≤ wil∞ sho≈ thσ addres≤ tha⌠ i≤ thσ curren⌠ to≡ oµ ì
ááááááááááthσ stack.
STACK- áThi≤ wil∞ sho≈ thσ tw∩ byte≤ tha⌠ arσ storeΣ a⌠ thσ to≡ ì
ááááááááááoµ thσ stack« Thi≤ i≤ data¼ no⌠ ß memor∙ address.
Thσ nex⌠ thinτ t∩ d∩ i≤ t∩ actuall∙ typσ iε aε 8080┴ ì
mnemonic« Iµ yo⌡ havσ ß cop∙ oµ thσ 8080┴ instructioε set¼ yo⌡ ì
typσ iε thσ mnemoniπ thσ samσ a≤ iµ yo⌡ werσ enterinτ anΣ ì
executinτ aε assembl∙ languagσ program« Thi≤ emulato≥ doe≤ no⌠ ì
suppor⌠ thσ usσ oµ labels« Al∞ number≤ arσ entereΣ anΣ displayeΣ ì
iε hexidecima∞ format« Afte≥ typinτ iε thσ instruction¼ pres≤ ì
return¼ anΣ thσ emulato≥ wil∞ displa∙ thσ ne≈ status.
Iε orde≥ t∩ exi⌠ ß session¼ jus⌠ typσ 'Control-C'« B∙ ì
typinτ Control-├ a⌠ an∙ placσ oε thσ inpu⌠ line¼ o≥ attemptinτ t∩ ì
executσ thσ HL╘ command¼ wil∞ causσ thσ emulato≥ t∩ displa∙ thσ ì
linσ '**¬ Warφ Boo⌠ ***º anΣ exi⌠ viß thσ warφ boo⌠ vecto≥ a⌠ ì
0000Φ iε pagσ zero« Thi≤ featurσ i≤ t∩ allo≈ i⌠ t∩ bσ useΣ oε ß ì
compute≥ 'remotelyº viß thσ modeφ b∙ educationa∞ institution≤ o≥ ì
special interest groups.
WARNING:
D╧ NO╘ ALTE╥ AN┘ MEMOR┘ LOCATION╙ BELO╫ 200░ HEX« THES┼ ì
áááááMEMOR┘ LOCATION╙ AR┼ ESSENTIA╠ FO╥ TH┼ EMULATO╥ PROGRA═ AN─ ì
áááááTH┼ OPERATIN╟ SYSTE═ O╞ YOU╥ COMPUTER« TH┼ MNEMONIC╙ AN─ ì
áááááCOMMAND╙ THA╘ AR┼ TYPE─ I╬ AR┼ ACTUALL┘ STORE─ AN─ EXECUTE─ ì
áááááA╘ TH┼ ADDRESSE╙ NOTE─ I╬ TH┼ PROGRA═ COUNTER.
Authors Note:
I'φ surσ man∙ peoplσ kno≈ thσ feelinτ oµ thσ initia∞ shocδ ì
wheε the∙ writσ ß prograφ anΣ releasσ i⌠ int∩ thσ publiπ domain¼ ì
anΣ year≤ late≥ finΣ i⌠ oε aε RCP/═ boarΣ 20░ mile≤ awayí Thi≤ ì
shockeΣ mσ int∩ thσ realizatioε tha⌠ peoplσ arσ actuall∙ usinτ ì
thi≤ program« Duσ t∩ thσ man∙ bug≤ presen⌠ iε thi≤ program¼ ╔ ì
definitel∙ fel⌠ thσ neeΣ t∩ correc⌠ sucΦ bugs« Thσ firs⌠ ste≡ ì
wa≤ t∩ seperatσ thσ documentatioε froφ thσ actua∞ prograφ sourcσ ì
anΣ makσ quitσ ß fe≈ change≤ iε thσ documentatioε fo≥ clarity« ì
Futurσ revision≤ wil∞ bσ madσ t∩ thσ prograφ t∩ fi° thσ man∙ bug≤ ì
currentl∙ present.
Copyright 1986 All Rights Reserved
EM220 - 8080A Microprocessor Instruction Set Emulator Page 4
Thσ sourcσ codσ i≤ n∩ longe≥ distributeΣ witΦ thσ librar∙ ì
becausσ variou≤ 'idiotsº havσ beeε revisinτ i⌠ t∩ crasΦ whateve≥ ì
compute≥ i⌠ i≤ assembleΣ fo≥ b∙ usinτ thσ BIO╙ routine≤ t∩ wipσ ì
ou⌠ thσ director∙ tracks« The∙ havσ theε recombineΣ i⌠ int∩ ß ì
librar∙ anΣ re-releaseΣ i⌠ fo≥ distribution.
Also¼ i⌠ make≤ thσ librar∙ ß bi⌠ smalle≥ becausσ thσ sourcσ ì
code takes up about 22k when unsqueezed.
Iµ yo⌡ woulΣ likσ ß cop∙ oµ thσ sourcσ code¼ senΣ ß $╡ ì
donatioε t∩ thσ abovσ address« ShoulΣ ╔ n∩ longe≥ bσ reachablσ ì
a⌠ tha⌠ address¼ yo⌡ caε stil∞ contac⌠ mσ viß USENE╘ mai∞ a⌠ ì
ihnp4!m-net!jeffery.
Future revisions planned:
1. ASCI╔ value≤ caε no≈ bσ entereΣ a≤ singlσ quotes¼ bu⌠ thσ ì
ááááávalue≤ arσ converteΣ t∩ uppe≥ casσ b∙ thσ inpu⌠ routine« ╔ ì
áááááwoulΣ likσ t∩ bσ ablσ t∩ havσ i⌠ usσ botΦ uppe≥ anΣ lowe≥ ì
ááááácasσ iε thσ operanΣ fielΣ wheε delimiteΣ b∙ singlσ quotes.
2. Aε offse⌠ valuσ t∩ bσ used¼ plu≤ erro≥ checking¼ t∩ preven⌠ ì
ááááámodifyinτ memor∙ requireΣ b∙ botΦ thσ prograφ anΣ thσ ì
áááááoperatinτ system« Somσ stil∞ thinδ thi≤ a≤ ß 'featureº ì
ááááábecausσ oµ thσ fac⌠ tha⌠ thσ instruction≤ tha⌠ arσ actuall∙ ì
ááááátyped in are executed at the addresses noted.
An∙ othe≥ bug≤ presen⌠ anΣ founΣ iε thi≤ prograφ shoulΣ bσ ì
reporteΣ t∩ thσ namσ anΣ addres≤ noteΣ a⌠ thσ beginninτ oµ thi≤ ì
file« Pleasσ fee∞ freσ t∩ adΣ whateve≥ correction≤ anΣ feature≤ ì
t∩ thi≤ prograφ tha⌠ arσ necessary¼ provideΣ thesσ change≤ arσ ì
brough⌠ t∩ m∙ attention¼ fo≥ everyonσ t∩ enjoy« Happ∙ hacking!
- Jefµ Sheesσ -
Copyright 1986 All Rights Reserved