It will also store the bit that is removed doing a shift or rotate operation. Carry Flag - Is set to 1 when the result of an arithmetic operation goes over max value or under min value for the register.I will quickly go over them here, but I do feel they need a blog post of their own, for a more in-depth look. They can be changed when an instruction is executed and will also determine what some instruction will do when being executed. They are all single bit values, which means they can only be either zero or one. Together with CS it points the memory location of the next instruction to be executed.Īfter all the registers and segments, we have the Flags. The last register is the Instruction pointer. In DOSBox the pairing a segment and register will look like DS:SI, CS:IP, SS:SP etc in the Code overview. Because they can overlap, different looking segment + offset combinations can point to the same physical address. Hexadecimal:ĭifferent segments can overlap and even point to exact same region. You get the physical addresses from a segment and pointer by multiply the segment with 16 and then adding the pointer value to it.įor example if DS is 0x2052 and SI is 0x05BC, the physical address will be 0x20ADC. Together with a register in the second column they can point to a specific address in the memory. FS and GS can be referred to as Far segment and Global segment respectively, but there is no difference between them. 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. (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. 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. 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. I have recently begun the journey of learning to code old DOS assembly and how to debug it in the debug version of DOSBox.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |