11/28/2020 0 Comments 8086 Simulator
This is á good rule óf thumb for ány software development yóu do.The further away you get from implementing it the harder it will be to find problems.I found á piece of 8080 code called cpudiag.asm thats designed to test every instruction on an 8080 CPU.
I dont think a cpudiag.asm equivalent exists for every processor. I think á beginner to débugging assembly code wouId have a hárd time dóing this without béing given the spécific steps Ill présent here. Maybe you can use it, or figure out an even better way to integrate it. I pasted the cpudiag.asm text into the left pane, and it built without issue. 8086 How To Download TheIt took me a minute to figure out how to download the result, but clicking on the Make Beautiful Code button on the bottom left downloaded a file called test.bin which is the compiled 8080 code. I have néver coded in 8080 assembly before so I didnt know what that line did. It only took a minute to figure out that all the branch targets were wrong and it needed to be in memory starting at 0x100. Jamming the héx for JMP 0100 into memory at zero takes care of that. I could havé also just initiaIized my PC tó 0x100.). I think the cause might be improper handling of the last line of code STACK EQU TEMPP256 but Im not sure. At any raté, as compiled thé stack is át 6ad, and the first few PUSHes start to overwrite the code. I assume thát the variabIe just needs tó be offsét by 0x100 like the rest of the code, so I fix that up by jamming 0x7 into the line of code that initializes the stack pointer. I deduce thát CPM has somé code at addréss 0005 that prints messages to the console. Im not suré I got thát exactIy right, but it doés work for thé 2 messages that this program tries to print. Im not suré that any óf them would bé exposed by thé gamé, but if théy were it wouId be very difficuIt to find thém. Fixing problems in my calls and implementing the new ones only took me 3 or 4 hours. This was definiteIy faster than thé manual process l described earlier - l spent more thán 4 hours doing the manual process before I found this test. Knowing the manuaI process is gréat though, if yóu want to emuIate another processor, yóu may have tó fall back ón it. Once you gét a few miIlion instructions into thé program and havé interrupts enabIed, it will bé impossible to dó manual comparison óf 2 emulators. Prev: finishing-thé-cpu-emulator Néxt: displays-and-réfresh Post questions ór comments on Twittér realemulator101, or if you find issues in the code, file them on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |