Author Topic: How to make my first MASM program under VS Code  (Read 92 times)

ulrick

  • Regular Member
  • *
  • Posts: 2
How to make my first MASM program under VS Code
« on: November 04, 2019, 10:04:35 AM »
Dear all,
I am new here.
I installed MASM from masm32 web site and VS Code from MS website.
Before I make any program I guess I have to link VS Code and MASM, no?
I wrote the following

.code
main    proc
        mov rax, 123
        ret
main    endp
end

which I save as a masm file. VS Code attaches the .inc extension to it.
I select the code with select all then run the selected text option in the Terminal menu.
But, it does not work.
Any help?
Thank you.

jj2007

  • Member
  • *****
  • Posts: 9743
  • Assembler is fun ;-)
    • MasmBasic
Re: How to make my first MASM program under VS Code
« Reply #1 on: November 04, 2019, 10:39:22 AM »
VS Code might be an overkill. Try something simpler:
- open \Masm32\qeditor.exe
- paste the code below
- save as test.asm
- use menu Project/build+run

If that works, you are ready for more ambitious tasks :smiley:

Welcome to the Forum :thup:

Code: [Select]
include \masm32\include\masm32rt.inc ; contains 90% of all requisites for Win32 programming

.code
AppName db "Masm32:", 0

start: MsgBox 0, "Hello World, how are you?", addr AppName, MB_OK
exit

end start

ulrick

  • Regular Member
  • *
  • Posts: 2
Re: How to make my first MASM program under VS Code
« Reply #2 on: November 04, 2019, 08:23:01 PM »
Thanks a lot jj2007, this works!
Have a good day.
ulrick