tags:

views:

322

answers:

9

I'm taking a course on Microprocessor Programming as part of my Electronic Engineering degree. Unfortunately, in the labs, we have to work in DOS using MASM.

Now, I don't really find DOS a hindrance, but I just don't have it on a computer at home (and none of the computers that I have have floppy drives), so I am unable to practice writing programs. I have tried under Windows, but it just doesn't assemble (I am guessing this is because of Protected Mode).

Any advice on what should I do? Should I just learn to program in Protected Mode? Will that help me with the course? The course is focused on the 8086.

Perhaps a virtual machine could help? If so, where can I get DOS and MASM for it?

+3  A: 

I would look into running Sun's VirtualBox (Free) to run a DOS VM on any platform (Windows, Mac, Linux, ...)

Bill K
A: 

If you type COMMMAND instead of CMD from the Start menu and select run you will be in DOS.

Nissan Fan
Nissan Fan
Interesting. How compatible is that with old software? Like.. tetris for example?
jdv
I strongly recommend against doing this for the purpose of learning. There are plenty of quirks in running in virtual 8086 mode that may mislead a learner esp. at the assembly language level--and it's not available on x64 anyway.
Mehrdad Afshari
I agree with Mahrdad Afshari, this does not provide a 16-bit environment, and masm32 is for a 32-bit (Protected Mode) environment, which is very dissimilar from Saad's instruction at school.
mctylr
If you're running 64 Bit Windows 7 you could download Windows XP mode which would allow you to do it. I'm not against a VM, but if he must then Sun VirtualBox with FreeDos would be my choice. http://www.freedos.org/
Nissan Fan
I thought COMMAND and CMD were synonymous once you got to XP. I'm also not sure how well he's going to be able to poke at actual registers that are part of windows protected mode memory or direct disk writes. You can do a lot more in actual "DOS" than you can in windows itself. I'd go with a FreeDOS in a VM for less "Trouble". I'd hate to see him debugging a problem related to windows protecting the OS.
Mech Software
They are not. COMMAND is the Windows 16 bit emulator and CMD is the Windows XP Command Shell. It doesn't matter wheter you are in either as you never have access to the direct hardware (except in some rare cases with signed drivers) in any Windows greater than Windows Me as the Kernel abstracts that from you.
Nissan Fan
+1  A: 

A virtual machine would do. I'm pretty sure DOS is freely available on MSDNAA if your academic institution provides access to it. If you're using Windows, I suggest using the Microsoft Virtual PC for DOS VMs. While I personally prefer VMware as a VM host, for DOS specifically, Virtual PC seems to be doing a better job at emulation.

Mehrdad Afshari
FreeDOS is 100% free and compatible http://www.freedos.org/
Nissan Fan
I haven't really tried FreeDOS and can't say anything about the compatibility. I highly doubt it to be 100% compatible with all the bugs MS-DOS had. 100% compatibility with *any* software is next to unachievable.
Mehrdad Afshari
FreeDOS is exceptionally compatible. I wouldn't expect very many people to find differences that caused actual problems.
Brian Knoblauch
If that's the case, it should work too. Getting access to the actual MSDOS shouldn't be very hard either. Regardless, VM is the way to go. NTVDM is definitely not.
Mehrdad Afshari
+8  A: 

FreeDOS is another option, and running it in virtualbox

http://www.freedos.org/

BTW, Free DOS can also be booted from a CD. I think you can even install it on a thumb drive if so inclined.

Mech Software
I wonder how DosBox would fare... it's geared towards running old DOS games, but I know I've gotten it to run some really old GW-BASIC programs that I wrote way back in '93 and '94!
Vivin Paliath
+2  A: 

I used this emulator bochs while back together with free dos is pretty good if you just need basic dos

aaa
A: 

Inline::ASM - Write Perl Subroutines in assembler.

SYNOPSIS

   print "9 + 16 = ", add(9, 16), "\n";
   print "9 - 16 = ", subtract(9, 16), "\n";

   use Inline ASM => 'DATA', 
              AS => 'as',
              PROTO => {add => 'int(int,int)'};

   use Inline ASM => 'DATA',
              AS => 'nasm',
              ASFLAGS => '-f elf',
              PROTO => {subtract => 'int(int,int)'};

   __END__
   __ASM__

   .text
   .globl    add

   add:      movl 4(%esp),%eax
             addl 8(%esp),%eax
             ret
   __ASM__
             GLOBAL subtract
             SECTION .text

   subtract: mov eax,[esp+4]
             sub eax,[esp+8]
             ret
Anonymous
+3  A: 

I would suggest using a virtual machine such as the free VirtualBox, or qemu, an x86 (+ others) emulator. I would suggest using MS-DOS as the guest OS, as my previous attempts at trying some basic assembly under FreeDOS under VirtualBox were unreliable.

MASM v8 is available for download from Microsoft - but I don't remember if that includes a 16-bit assembler or not. Also read Randall Hyde's blurb on MASM. The Art of Assembly website is a go-to spot for learning assembly. Of course Wikipedia has a comparison of assemblers. You'll want one that is MASM compatible and runs under DOS (i.e. 16-bit).

Added Note: Older versions of MS-Windows prior to Windows XP included MS-DOS, including Windows 95 and 98. If you have or can find an old copy on CD, otherwise people will likely give the CD freely if they have one - ask friends, local computer stores, family, and you should be able to install them in a virtual machine with little or no effort.

mctylr
A: 

VMWare would do. Just find the DOS image(.iso or floppy) and install it on the VMWare. You can do whatever you want with it without any harm to your host machine. You can even play with int13 interrupt if you want ;). Oh I miss the time when I did the "resident"applications hooking interrupt subroutines under DOS on my i386 :)

Good Luck and have fun with asm.

opal
A: 

bochs or freedos in qemu

dwelch