Search code examples
assemblyvisual-studio-2013masmmasm32dosbox

How to run a MS-DOS .asm file using VS2013 or MASM32?


Here is my test.asm code. Basically 'nothing' inside because just want to get it to build and run without errors first.

.model small
.stack 64
.data
.code

main proc
  mov ax,@data
  mov ds,ax

  mov ax,4c00h
  int 21h
main endp
end main

I have tried using visual studio 2013 include the lib, add the linkers and all those guides from websites but no luck. Always getting this error message "error A2006: undefined symbol : DGROUP" for both MASM32 and visual studio 2013.

Please guide me step by step on the build and run.. Also, i tried using dosbox and this is as far i can go.. enter image description here Keep having the illegal command. What am I doing wrong? :(


Solution

  • To paraphrase: how do I inflate a bicycle tire with a potato?

    Your assembly is 16-bit, and you're targeting MS-DOS (the int21 call is a giveaway). Neither VS2013 nor MASM32 is capable of generating DOS executables. Try a different assembler, i. e. NASM. Alternatively, read up on modern assembly.