Author Topic: MASM output is not displayed  (Read 3703 times)

filxy

  • Guest
MASM output is not displayed
« on: October 23, 2012, 05:29:00 AM »
I wrote a file in cmd as .asm and it is linking but when i write the file name in c:/masm> first.asm like this it displays the the whole code in visual studio and it does not print a output i am using windows 7 32 bit

dedndave

  • Member
  • *****
  • Posts: 8734
  • Still using Abacus 2.0
    • DednDave
Re: MASM output is not displayed
« Reply #1 on: October 23, 2012, 05:39:45 AM »
welcome to the forum   :t

ummm - could we see the code ?   :biggrin:

you would probably get more out of writing 32-bit code

Gunther

  • Member
  • *****
  • Posts: 3515
  • Forgive your enemies, but never forget their names
Re: MASM output is not displayed
« Reply #2 on: October 23, 2012, 06:55:47 AM »
Hi filxy,

welcome to the forum.

As Dave wrote: please post your code and we'll see what happens.

Gunther
Get your facts first, and then you can distort them.

nidud

  • Member
  • *****
  • Posts: 1370
    • https://github.com/nidud/asmc
Re: MASM output is not displayed
« Reply #3 on: October 23, 2012, 08:00:08 AM »
The file-type .ASM may be handled by VC, like .TXT files is opened with notepad.

Try c:\masm>first.exe

dedndave

  • Member
  • *****
  • Posts: 8734
  • Still using Abacus 2.0
    • DednDave
Re: MASM output is not displayed
« Reply #4 on: October 23, 2012, 01:54:01 PM »
ASM files may or may not be associated with VC
but, EXE files aren't likely to be   :P

nidud

  • Member
  • *****
  • Posts: 1370
    • https://github.com/nidud/asmc
Re: MASM output is not displayed
« Reply #5 on: October 23, 2012, 05:34:48 PM »
Debug the message:

Quote
I wrote a file in cmd as .asm
console window (cmd.exe, edit)
Quote
and it is linking
using command line args to link..
Quote
but when i write the file name in c:/masm> first.asm like this
like this: C:\masm>first.asm (enter)
Quote
it displays the the whole code in visual studio
from console window to VC – must be associated
Quote
and it does not print a output
“Hello world!” was expected?

Quote
but, EXE files aren't likely to be
I put this in my .asm file
Quote
sub eax,eax
mov [eax],eax
Then VC associate it self to both the .asm file and .exe file, creates a project and everything :biggrin:

MichaelTripi68

  • Guest
Re: MASM output is not displayed
« Reply #6 on: January 02, 2013, 01:07:29 PM »
I am a newbie but I didn't know you can run .ASM code files directly in CMD as the file is just source code.  My understanding is that you need to assemble your code with an assembler such as MASM, MASM32, TASM, NASM, or FASM.  Once your code file is assembled you can run it by typing just the base name (i.e. no extension).  Based on your memory model it may be a .COM (tiny model only) or a .EXE (all other models).
 
As far as it loading in VC is most likely due to the extension (.asm) being associated with that application.  Of course, when it loads in VC it will just display the file because it is just a source code file.  Source code files are not directly executable.  They must be transformed in an executable format.
 
Any of you code gurus out there correct me if I'm wrong with what I said here...