superfury wrote on 2025-05-20, 15:37:
Thats a summary ... it's been so long, I don't recall where I got it, quite likely I wrote it "back in the day"
when designing my first 8080 assembler (ran on my homebuilt 8080 system), no disks or text editor...
You might want to look at the one above it on my page, that's a scan[.PDF] of the actual Intel 8080
programming manual.
... My "editor assembler" (which I "hand assembled" and entered a byte at a time via my 8080 monitor
(fortunately the UNB mainframe/EElab had an 8080 assembler, and an EPROM progrmmer)
let me enter/edit ASM code and assemble it "in memory" also had commands to save/load it's text
file as well as memory blocks (so I could save the final program) to a "Tape drive"
--The tape system was "interesting" at the time I was attending UNB "University of New Brunswick", and
they had a "language lab" which was decommissioning a bunch of solenoid (remote) controlled 5" reel-to-reel
tape drives - naturally I brought a couple home, and designed my own digital recording circuitry (they were
originally audio decks) - at first I just controller them via the front panel buttons, but eventually
I expanded my 8080 machine language monitor/debugger to include "tape" operationsm and made
a software interface so any running programs could save/load to tape.
... I guess in a way, it was the first O.S. I wrote! (You can see the setup in one of my system photos on
Daves Old Computers)
It looks that pretty much most if not all those instructions can be routed to the usual modr/m based system, or flat out mapped […]
Show full quote
It looks that pretty much most if not all those instructions can be routed to the usual modr/m based system, or flat out mapped directly to x86 instructions (like CLI/STI)?
They just need manual modr/m settings for all opcodes and other immediate (byte/word) handlings, as those differ from x86 opcodes?
Also, what about it's IN/OUT instructions? Are they simply remapped to OUT imm8,AL and in AL,imm8?
Or are those faulting #UD for the emulator to handle?
Aren't the x86 0F prefixed instructions incompatible with x86 of Pentium Pro and higher (conflicting instructions and parameters)? Is it just using normal modr/m there or does it have some weird encoding?
In the last year I've released source code for pretty "Everything I've ever written" for myself (ie: not
on a contract where someone else has the rights to the code) - You can look at my Altair simulator there
I don't think any opcodes are "the same" (at least not intentionally) between 8080 and 8086,
the idea was for the 86 to be as upward source code compatible as possible (there are programs - I've
written at least 1 - which translate 8080 .ASM source code to 8086 .ASM source - making it MUCH
less work to port from one to the other)
- I basically use a indexed[by opcode] JMP table, much of which just executes one or two
8086 instructions, but some more complex ones do more.
8080 IN and OUT is just to 256 I/O ports, which is basically a separate set of selects (ie: another address space)
The 8080 IN & OUT are two byte instructions 1st being the opcode, and 2nd
being the I/O port address - the 8080 has no way to indirectly access an I/O port
(my monitor builds a little subroutine in RAM to allow the port to be specified)
[In my Altair emulator, IN/OUT cause the "CPU interpreter" call code within the
emulator in response to IN/OUT which controls the virtual instances of the real devices
I had on my Altair]
Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal