Let's Write an Intel 8080 Disassembler

preview_player
Показать описание
Let's take a look at the steps for writing a simple disassembler for the Intel 8080 in C.

Resources used in this video:

Рекомендации по теме
Комментарии
Автор

Why did you have rhe case structure? It's easier to take a table of instructions (00h, nop, 1), ( and so on), for the 256 op-codes. You add the number to program counter (PC) for the next op-code. So you have only one comparison in a loop and compare until you find the opcode in the table.
If you find one you print out the op-code at second position and add the number at
third position to PC, then break. Take the next op-code at PC until end of file. You need an array of 256 x 3 from the instructions table.

If there is a branch you can calculate the target address and print it after the op-code.

viktorhugo
Автор

Hello!
How do I find areas that contain numeric constants, such as an array of sines? Do I have to track the Program Counter and isolate the non-program area?

wlodii
Автор

better read the instruction set from a file, so you dont have to add cases

gregoryzanforlin
Автор

why are you calling the stream pointer a program counter? ahah

gregoryzanforlin