6 Replies - 2521 Views - Last Post: 24 June 2013 - 03:50 AM

#1 Mbare  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 02-September 12

how start debug masm file in win?

Posted 20 June 2013 - 03:43 AM

HI
I need a simple info about start with MASM..
How I can run a file .asm on windows 7 64bit??
It seems impossible..i tried DOSBOX…but nothing, on Visual Basic express 2012 seem impossible to set an right envirorment
It works only inline in C++…PLEASE HELP ME!!!, or indicated a serius guide !!thankss
Is This A Good Question/Topic? 0
  • +

Replies To: how start debug masm file in win?

#2 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,279
  • Joined: 28-March 11

Re: how start debug masm file in win?

Posted 20 June 2013 - 07:59 PM

You don't "run" an Assembly source file (.asm), instead you Assemble and optionally link the source file, then run the resulting exe or com file. What doesn't work with DOSBox?? What are type of code are you using, 16bit or 32 bit? What only works inline in C++???

VB Express allows you to use Assembly? Never heard of that, probably why it is not working. How are you trying to Assemble your source? Post your source!!! DOSBox most definitely works for 16bit DOS code, it is a bit of a PITA to setup which is why many folks use D-Fend Reloaded which is a front end to DosBox making it easier to use.
Was This Post Helpful? 0
  • +
  • -

#3 Mbare  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 02-September 12

Re: how start debug masm file in win?

Posted 21 June 2013 - 04:55 AM

Thanks GunnerInc for your help!
ok, code that I'm trying to debug is a simple exercize on 'amperes conversion' from book:

        .386
        .model flat, c
        .stack 100h
printf  PROTO arg1:Ptr Byte,   printlist:VARARG
scanf   PROTO arg2:Ptr Sdword, inputlist:VARARG
        .data
In1fmt  byte “%d”,0    ;vale per tutti…
Msg1fmt byte 0Ah, “%s”, 0
Msg2fmt byte “%s”, 0
Msg3fmt byte 0Ah, “%s%d”, 0Ah, 0Ah, 0
Msg1    byte "Enter the number of volts: ", 0
Msg2    byte "Enter the number of ohms: “, 0
Msg3    byte "The number of amperes is: ", 0
Volts   SWORD  ?
ohms    SWORD  ?
amperes SWORD  ?
        .code
main     proc
        INVOKE  printf, ADDR msg1fmt, ADDR msg1
        INVOKE  scanf,  ADDR in1fmt,  ADDR volts
        INVOKE  printf, ADDR msg2fmt, ADDR msg2
        INVOKE  scanf,  ADDR in1fmt,  ADDR ohms

     ;amperes = Volt/ohms
        mov eax, volts
        cdg
        idiv ohms
        mov amperes, eax
        INVOKE printf, ADDR msg3fmt, ADDR msg3, amperes
        Ret
main    endp
        end




i tried DosBox, i run it from masm(version 5) directory..where also my file.asm is stored..
then:
from DB prompt: "masm filename.asm: " ;for compiling...right??here it's ok...
and after i type ":> td filename.asm" but error issue from DB --> :"unable to open input file"

i don't tried this code inline in C++ on VB, but probably it doesn't work becouse its "I/O"...i suppose.
On VB 2008 seems ther's a procedure that allows stand alone MAMS code debug..., but I have installed only 2012 version, and this code doesn't work...
but another simple inline code in C++ on VB works good...

ps. ther's a DosBox releas that seems to work on win 7 64 bit...(that it's mine..)
ps. sorry for my bad english and thanks for your help!!! :turned:
Was This Post Helpful? 0
  • +
  • -

#4 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,279
  • Joined: 28-March 11

Re: how start debug masm file in win?

Posted 21 June 2013 - 01:52 PM

Ml.exe is the Microsoft Assembler which is used to Assemble your source file into an object file (there is no masm.exe), you then need the 16 bit linker to link that into an exe file. td is the 16Bit Turbo Debugger that came with TASM, are you using TASM or MASM??? Debuggers work with executable files (dll, exe, vbx, etc...) not source files.
Was This Post Helpful? 0
  • +
  • -

#5 Mbare  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 02-September 12

Re: how start debug masm file in win?

Posted 22 June 2013 - 05:19 AM

ahh, ok now the "situation begins to be clearer"...thanks again;
well, I'm using MASM and not TASM, then what 16 bit linker I need??
when I installed DBox, I also installed masm vers.5 (as recommended in DosBox tutorial that i read;(also in VB 2012 masm version is the '11')...
ok in the MASM 5 installation directory ther's a LINK.EXE executable, then I need to call it to link my source code in .exe file??

thanks again for your forbearance!!! :death:
Was This Post Helpful? 0
  • +
  • -

#6 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,279
  • Joined: 28-March 11

Re: how start debug masm file in win?

Posted 23 June 2013 - 06:11 PM

Download MASM32, it is an SDK for MASM, contains tons of samples, help files, libraries, and other cool things.

Download RadASM v2, it is a good IDE for Assembly and has 16Bit DOS samples in the MASM\projects directory.

The version of Link that comes with MASM32, Visual Studio, and updates is the Incremental Linker, this will not work for 16bit Segmented DOS apps, instead you need the 16 bit Microsoft Segmented Linker 5.60

If you download the MASM32 SDK, rename the segemented linker to something like link16.exe and plop that into the /masm32/bin directory so you can use both versions of link. Otherwise put the renamed link into the same directory ml and link is in.

Sample command line to Assemble and link a 16bit app:
To Assemble:

Quote

ML.EXE /DMASM /DDOS /Zm /c /nologo /I"f:\masm32\Include" "filename.asm"


To Link:

Quote

link16.exe /NOLOGO "filename.obj"

Was This Post Helpful? 0
  • +
  • -

#7 Mbare  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 02-September 12

Re: how start debug masm file in win?

Posted 24 June 2013 - 03:50 AM

thanks for your precious help!!
I'll try that soon! :walkman:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1