T
T
Type Programmer2018-01-23 23:17:51
assembler
Type Programmer, 2018-01-23 23:17:51

CPU emulation, how to do OP?

I'm doing something like an emulator, a processor, or whatever I don't know.
1) There are registers, these are variables of type char, which means 256 values, which means an 8-bit processor?
2) There is an OP, well, here one cell is also a byte, it seems to me ... The array of chars is 65535, so here's how to address the entire OP using 8 bit registers, Zilog Z80 - an 8-bit processor addresses a 16-bit bus ... How come there are no 16-bit registers, mov al,[ax] won't work... I can't understand.
3) Can you tell me the key aspects of creating a processor emulator, well, something like that, my idea is that there are a bunch of commands they are in the char data type, let's say command 01 is movrr, this is rr is to move the data from the register to another register so- there is movrn to move the number of a constant into the register, and so on.
How to implement different ports there, etc. Everything in the spirit that you know

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2018-01-24
@MegaCraZy6

Zilog Z80 - 8-bit processor addresses a 16-bit bus... How come there are no 16-bit registers, mov al,[ax] won't work... I can't figure it out.

Hi, in z80 8 bit registers b, c, d, e, h and l can be used as 16 bit pairs bc, de and hl. In addition, there are registers sp, IX and IY, 16-bit.
Can you tell me the key aspects of creating a processor emulator, well, something like that, my idea is that there are a bunch of commands they are in the char data type, let's say command 01 is movrr, this is rr, this is to move data from the register to another register, so there is movrn move the number constant into the register, and so on.
How to implement different ports there, etc. Everything in the spirit that you know

If Z80 is ok for you, here is a QEMU port for z80 .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question