
- #Dosbox debugger how to#
- #Dosbox debugger install#
- #Dosbox debugger code#
- #Dosbox debugger download#
Their value is an address in the physical memory divided by 16. Each define a 64 Kb large region of memory space. So I feel my knowledge about it is likely incomplete)Īfter the two columns we find a bunch of Segment registers.
#Dosbox debugger code#
(The code I studied so far, does not make much use of the BP register. It is used by higher level programming language to point the beginning of parameters for a subroutine within the stack. Base pointer is an extra pointer to the stack segment. The Stack pointer point the the current stack offset within the Stack segment. The bottom two registers in the second column are the Base pointer and Stack pointer. I will explain more about how they are combined later in this post. They are used together with a section registers when working with string instructions. The second column starts with the two Index registers, Source Index and Destination Index. The general purpose registers are not 100% interchangeable, as specific ones are used as input and/or as output location for various instructions. Meaning that if EAX is set to 0xFFDD9900, AX is 0x9900, AH is 0x99 and AL is 0x00.

EAX will access all 4 bytes (32-bits), AX will access the two lower bytes (16-bits), AH will access the higher byte of AX and AL will access the lower byte of AX. For example the bytes in the Accumulator can be referenced by EAX, AX, AH and AL. The bytes in the GPs can be referenced in code by four different ways. In the first column we have the four general purpose registers (Accumulator, Base, Count and Data) and their current 32-bit value. In the above screen shot you can see that EIP was changed. Registers and flags that were changed by the previous executed instruction will be highlighted. Meaning that the most significant byte is shown first. The registers represent “memory slots” in the emulated CPU.Īll values shown are displayed in big endian fashion. It shows all the registers, flags and their current values (There is also some other stuff on the right side I haven’t 100% figured out yet). Register Overviewįirst section of the screen is the Register Overview. Almost all numbers are shown in hexadecimal. In the text below I assume you are familiar with bits, bytes and hexadecimal formatting. The commands are also listed on this page. When the execution is stopped, you can type “help” in the debug screen to see additional commands to use. Or if you want to start debugging immediately, start the application by typing “debug” before the name of the executable.

You can start an application as normal and then press Alt+Break and F5 to stop/start the execution of code.
#Dosbox debugger download#
If you already have DOSBox installed, you’ll only need to download the EXE-file and add it to the folder where regular DOSBox is installed.ĭOSBox Debugger will start as the normal version of DOSBox, but with the additional debug screen showing.
#Dosbox debugger install#
How the get the Debug screenįirstly, to even see this screen in DOSBox, You’ll need to install a special debug version if it. So I have, in order to make myself understand it better and to make it easy for anyone else who want to follow my footsteps, decided to write this overview of the screen and its parts. And when being new to both, the debug screen in DOSBox is a bit overwhelming.
#Dosbox debugger how to#
Back in the days, I remember finding and tweaking the "loiter a while" 3 hours time limit in less than 30 minutes.I have recently begun the journey of learning to code old DOS assembly and how to debug it in the debug version of DOSBox. I used it like 20 years ago and never found any other debugger as powerful as this one was. To be honest, I really missed good old SoftICE.

So, did some of you manage to use it successfully?

I'm pretty sure I'm not doing things right but even after looking for information on the internet, I can't understand why DOSBox debugger is behaving like it does with DF. And then, if it does, I can only hope current CPU registers will give me enough information. It's quite frustrating and the only solution I came into is to set breakpoints on a dozen function instructions, hoping DOSBox will eventually break into one of them. But then, either DOSBox never breaks (even if it goes through the code) or if it does, I'm unable to step over/through the following instructions using F10/F11. I'm able to locate the exact instruction where I want DOSBox to stop and put a breakpoint there. Even if I managed to understand some very useful functions and translate them from decompiled C code to DFU C# engine (see my recent PR related to NPC greetings), the main problem I have is I can't manage to use DOSBox debugger properly. However, my current method of doing it is essentially static. During the last months, I've gathered some experience at reverse engineering classic mechanics.
