pm85 - 8085 DRC
pullmoll
Posts: 817
Since the Z80 recompiling core is too big to throw an instruction exerciser at, I decided to make a stripped down 8085 only version from it. Renamed all functions to 8085ish, threw out the Z80 only opcodes and inserted the 8085 ones for them. This one should at some point run the EX8080.COM test, at least I hope it will. The pm85_demo code contains a small BDOS emulation for the functions 2 (char out) and 9 (string out), just enough to get the test going. The EX8080.COM is loaded at 100H, where also CP/M would load it. Then the code is run.
Right now it seems to be stuck forever in the initmask loop (see EX.MAC) and I have no clue why. You can see the compiler read the 3 consecutive RRC opcodes ($0f) and the surrounding code. It must be one of the more elementary opcodes that is broken in a way that prevents the initmask function from finishing its job. For some reason HL and DE point to 0 at the start, while they should point to the table in EX.MAC as far as I understood the code.
Oh, I should perhaps explain the debug output. The numbers in the columns are, from left to right:
<Z80 PC>:<opcode> <DE> <HL> <AF> <length of code snippet> <total cog longs to execute>
The 1s pause is right before each compiled output is executed.
Edit: After nailing some bugs here is version 0.0.3 for you to peek at.
0.0.2 - This also introduces an 8080 vs. 8085 compile time switch.
0.0.3 - Changed everything to byte sized registers B, C, D... composing BC, DE, HL on occasion only. This saves many longs.
Juergen
PS: Thanks to Cluso99 for the fine Debug_1pinTV code.
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Post Edited (pullmoll) : 3/11/2010 12:00:44 PM GMT
Right now it seems to be stuck forever in the initmask loop (see EX.MAC) and I have no clue why. You can see the compiler read the 3 consecutive RRC opcodes ($0f) and the surrounding code. It must be one of the more elementary opcodes that is broken in a way that prevents the initmask function from finishing its job. For some reason HL and DE point to 0 at the start, while they should point to the table in EX.MAC as far as I understood the code.
Oh, I should perhaps explain the debug output. The numbers in the columns are, from left to right:
<Z80 PC>:<opcode> <DE> <HL> <AF> <length of code snippet> <total cog longs to execute>
The 1s pause is right before each compiled output is executed.
Edit: After nailing some bugs here is version 0.0.3 for you to peek at.
0.0.2 - This also introduces an 8080 vs. 8085 compile time switch.
0.0.3 - Changed everything to byte sized registers B, C, D... composing BC, DE, HL on occasion only. This saves many longs.
Juergen
PS: Thanks to Cluso99 for the fine Debug_1pinTV code.
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Post Edited (pullmoll) : 3/11/2010 12:00:44 PM GMT
Comments
Sorry as I say it ¨- But it is only PM8080 not PM8085 simulation.
To 8085 it needs some more Restart instructions.
RST55
RST65
RST75
Not mention as Intels 8085 Had some Undocumented instruction's
Regards
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
Perhaps so but the EX instruction set exerciser that Pullmoll is running does not need any RST or undocumented instructions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I know excerciser not ned them.
But many programs I used on 8085 need that RST instructions.
Undocumented instructions are mostly curiosa - But much usable on this CPU in advanced programing --- NOT needed for CP/M
Regards
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I know about the differences between the 8085 and the 8080. They are rather well documented in MAME and I just introduced a compile time define to produce either a 8080 core or an 8085. The next version will contain both options. If and when interrupts come into play depends on what this core will be used for.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
There's a difference between the software RST opcodes and the 8085 multi level prioritized RST x.5 hardware interrupts. This allowed for easier fine grained hierarchy of external hardware, for example higher priority floppy disk, middle timer interrupt, and low keyboard. Further the 8085 had two serial I/O pins that could be set and read by software. The 8080 did not have such a thing.
Well, babbling too much, back to coding [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Question: what's wrong about this code to exchange HL and DE (i.e. EX DE,HL)?
See it? No? Me neither for some days...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
XOR HL, HL will just clear HL. doesn't it ????
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
Yes, indeed. It should read "xor HL, DE" of course. The three lines is a nifty trick to swap 2 variables without intermediate buffer, and though it isn't strictly necessary in this case (I have temp buffer) I used it. So this happens if you want to be cooler than cool.
LOL! See the attachment.. that was quick! This thing is playing games with me. There is more than just 1 test, stupid!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Post Edited (pullmoll) : 3/10/2010 9:25:44 PM GMT
About a year ago I found a camera battery charger with a 8085 in it, with a 81xx ram and I/O chip. Like an idiot I chucked it out, I never dreamt that it would handle CP/M.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
Exactly. And OR A was a short hand for "CLC" i.e. clear carry. They have forgotten this instruction. There's SCF to set and CCF to complement the carry, but noone would use SCF/CCF to clear the carry
Haha.. perhaps some old school engineer designed the charger and decided to go with parts he knew. "Hey, what does your battery charger run?" "It runs MP/M with 6 users, all watching out for the battery level in turns around the clock."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I now wrote a variant of pm85 where the registers are 8 bit and BC, DE, HL are composed whenever they are used as 16-bit. This saves several dozen longs, because decomposing the 8 bit registers from the words is more complicated. After all the changes, this variant behaves exactly the same with regards to EX8080.COM, so I know I haven't touched the buggy opcode... also 8080 and 8085 do the same, so it's not in the 8085 only opcodes either.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.
Post Edited (pullmoll) : 3/11/2010 11:11:57 AM GMT
please give some good link to start 8085........