VOGONS


First post, by .-083

User metadata
Rank Newbie
Rank
Newbie

Hello. I have a few doubts... Can i normally use MASM for programming in DosBox for ancient hardware? The software compiled there will be compatible with real old hardware? Must i consider some technical things about DosBox hardware emulation?
I want to learn 16-bit ASM (I'm reading "The Art Of Assembly, 16-bits DOS Edition") and before really starting with that, i need to know if DosBox is a comfortable option or i need to get a real very old PC.
So, if your answer is yes, i'm going to print the 1033 pages of the book, for a more comfortable reading. If you say no, i'm not sure what i'm going to do...
Note: English isn't my main language.
Note2: If someone wants to take a look, the book is here: http://www.phatcode.net/articles.php?id=223
Thanks.

Reply 1 of 11, by VileR

User metadata
Rank l33t
Rank
l33t

I'm also developing a bit of an interest in tinkering with assembly these days. 16-bit MASM should work fine under DOSBox - see here: http://www.prashanthpai.com/blog/run-masm-808 … 4-using-dosbox/

Haven't tried this, but you should be able to generate 16-bit code using a 32-bit version of MASM (i.e. Windows), so you might be able to get away with assembling outside of DOSBox then testing in DOSBox itself, for speed and convenience.

hardware emulation in DOSBox isn't 100% accurate - for one thing, CPU emulation isn't cycle-exact, so you might want to take that into account when it comes to instruction timings and low-level optimizations. Others here could be more helpful about specific limitations.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 2 of 11, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

The normal reply is that dosbox is not made for 100% accuracy. So when you program and especially compile in Dosbox, little errors might creep in your binaries. So beware...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 3 of 11, by .-083

User metadata
Rank Newbie
Rank
Newbie

Thank's. I will try and see... If it doesn't work as expected, i'll try with FreeDos or VM's running MS-DOS.

Reply 4 of 11, by VileR

User metadata
Rank l33t
Rank
l33t
.-083 wrote:

or VM's running MS-DOS.

I'd recommend against that, as DOSBox emulates more hardware and does so more accurately than a typical VM. You'd be better off booting MS-DOS within DOSBox.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 6 of 11, by .-083

User metadata
Rank Newbie
Rank
Newbie

What kind of cpu does Bochs emulate? And Dosbox? I mean, how can i know the exactly hardware where i'm running DOS ? 386, AMD K7, etc...

Reply 7 of 11, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

You will need to look it up for Bochs, as for Dosbox, I'm sure it emulates intel but not a definite set, I think.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 9 of 11, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

if you're not doing any tricks like using undocumented instructions or intentionally triggering faults, then DOSBox is fine for assembler work.
I use TASM under DOSBox to build my patches, no problem there.
However, if you need really accurate CPU behaviour then Bochs is the more appropriate choice. Note that even Bochs doesn't support really old hardware behaviour like the value of sp on the stack after a push sp, or transferring control using pop cs.

Reply 10 of 11, by .-083

User metadata
Rank Newbie
Rank
Newbie

Great. And you 're working with dosbox "as-is" or with a MS-DOS install?
I 'm using the DosBox HAL9000's build with ms-dos 6.22.

Reply 11 of 11, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

I'm using DOSBox "as-is".