VOGONS


First post, by lucky7456969

User metadata
Rank Oldbie
Rank
Oldbie

Hello,
For instance, if I have
mov ah,4ch
int 21h

How can you determine what int21h returns? I am writing a debugger in my spare time. So please experts do help me.
Thanks
Jack

Reply 1 of 8, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

by looking it up in the interrupt list or whatever documentation you have ?

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 8, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Not sure what the goal is here, but INT 21/4C seems like a bad example because it terminates a program, so it doesn't "return" anything.

Reply 3 of 8, by lucky7456969

User metadata
Rank Oldbie
Rank
Oldbie

Thank you all.
Basically, When I trace my code. I have a setState function that concurrently update the states of the registers/memory. But when I run into a DOS interrupt instruction, I am stuck as I can't predict the results of the instruction. For instance
mov ax, 10
mov ch, 3

I could setState(AX, 10);
and setState(CH,3);
Thanks
Jack

Reply 4 of 8, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

But when I run into a DOS interrupt instruction, I am stuck as I can't predict the results of the instruction.

Right, and you can't predict them otherwise you'd have a full bios/dos/etc. emulator instead of a debugger.

Reply 5 of 8, by lucky7456969

User metadata
Rank Oldbie
Rank
Oldbie

May I know how DOSBOX handles it?
Thanks
Jack

Reply 6 of 8, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It emulates those that are needed.

Reply 7 of 8, by lucky7456969

User metadata
Rank Oldbie
Rank
Oldbie

Could you recommend a open source full-fledged dos-based debugger for me? I want to make modification to it to suit my needs...
Many thanks

Reply 8 of 8, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

http://www.openwatcom.org

The open watcom debugger, wd, is maybe more powerful and complex than you're looking for, though.

Are these "needs" you mention a call stack?