Electronics > Projects, Designs, and Technical Stuff

Found a weird old computer dumpster diving. (z80?)

<< < (6/10) > >>

SiliconWizard:
I couldn't see much of anything under the speaker. You should put it away. Knowing how much RAM there really is will give an idea of what could be done with this board. I wouldn't bother with CP/M with less than 32KB.

Next step would be to reverse-engineer the address decoding. I think that's all you'd really need to do. And then write your own programs. I'd probably replace the EPROM with some 5V flash chip so you can reprogram it faster/make your life a bit easier.

grumpydoc:

--- Quote from: rstofer on March 28, 2020, 06:19:24 pm ---
Disassembly from a ROM dump is a fool's exercise.  All the author needs to do is put in some bogus 0x21 (LXI  H) bytes to throw off disassembly.  The next two bytes would be an operand for the LXI H but are actually the start of some other instruction because the LXI H is never executed.  The BDOS component of CP/M has this feature.  Or at least that's what I came up with when I tried to disassemble it.  The first byte of any other multi-byte instruction will do the same thing.

Just scatter so DB 0x21 instructions in the code.

--- End quote ---

IIRC this "feature" was not intended as an obfuscater but as a code-dense way of implementing a decision chain which would be expressed in C as

--- Code: ---if (a) {
    z=const1;
} else if (b) {
    z=const2;
} else if (c) {
    z=const3;
{ else.....

--- End code ---

Assuming that z can be held in an 8 bit register the 8-bit direct load is 2 bytes - if you don't mind sacrificing a 16-bit pair you construct a block of 16-bit immediate loads where the 16-bit "operand" is actually an 8-bit load.

You then jump in at an 8-bit load and "fall-through" all the 16-bit loads to the next bit of code. Saves a byte per element over a stack of

--- Code: ---    ld reg, const
    jr next_bit

--- End code ---

IIRC the Microsoft Z80 BASIC interpreter used the same trick.

As for the board - obviously a controller for the device that you mention - too little RAM (looks like the 2k "non volatile" chip is all that it has) to be much use as a general purpose computer.

james_s:

--- Quote from: SiliconWizard on March 28, 2020, 10:58:02 pm ---I couldn't see much of anything under the speaker. You should put it away. Knowing how much RAM there really is will give an idea of what could be done with this board. I wouldn't bother with CP/M with less than 32KB.

Next step would be to reverse-engineer the address decoding. I think that's all you'd really need to do. And then write your own programs. I'd probably replace the EPROM with some 5V flash chip so you can reprogram it faster/make your life a bit easier.

--- End quote ---

Depending on how the address map is arranged, adding RAM could be fairly trivial. All you need is a single SRAM chip and some address decoding which can either be done the old fashioned way or with a small CPLD.

I'd get the map worked out first though and then write a "hello world" program to blink an LED assuming there is one.

obiwanjacobi:
Confused:


--- Code: ---0x21 (LXI  H)
--- End code ---

does not sound like a Z80 instruction.

21-hex translates into 'LD HL, nn' ...?
And I have never heard of mnemonic 'LXI'...

Please explain.

greenpossum:

--- Quote from: obiwanjacobi on March 29, 2020, 06:23:19 am ---And I have never heard of mnemonic 'LXI'...

--- End quote ---

Oh dear. The Z80 instruction set is a superset of the 8080 instruction set but the designers chose to use different (and IMO better) mnemonics. LXI H is simply load immediate extended, i.e. HL, to old timers. So really the same instruction.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod