Pages: 1 [2]
|
 |
|
Author
|
Topic: who knows why masm32 doesn't generate obj file (Read 18003 times)
|
dedndave
|
well - invoke is a call, actually - it saves some typing INVOKE ExitProcess,0 is the same as push 0 call ExitProcess with masm32, there is a macro named "exit" that saves even more typing exit the print, uhex$, and inkey macros are a little more complicated to see the code they generate, refer to the masm32\macros\macros.asm file
|
|
|
Logged
|
|
|
|
jj2007
|
No. /SUBSYSTEM:WINDOWS is for GUI apps. If you want console apps, use /SUBSYSTEM:WINDOWS
Attention, TmX meant "If you want console apps, use /SUBSYSTEM: CONSOLE" If you use /SUBSYSTEM:WINDOWS, the executable will run but never exit, and you will need Task Manager to kill it.
|
|
|
Logged
|
|
|
|
clive
Hardcore x86, ARM and MIPS toolsmith
Member
    
Posts: 1230
Project Looking Glass. Following the white rabbit.
|
No. /SUBSYSTEM:WINDOWS is for GUI apps. If you want console apps, use /SUBSYSTEM:WINDOWS
/SUBSYSTEM:CONSOLE Syntax /SUBSYSTEM:{NATIVE|WINDOWS|CONSOLE|WINDOWSCE|POSIX}[,#[.##]] You can specify a subsystem, and a version there of. NATIVE - Startup environment, during initial boot WINDOWS - Window/Dialog application CONSOLE - Command Line application
|
|
|
Logged
|
It could be a random act of randomness. Those happen a lot as well.
|
|
|
clive
Hardcore x86, ARM and MIPS toolsmith
Member
    
Posts: 1230
Project Looking Glass. Following the white rabbit.
|
version masm 10 i use command line code ml /c /coff does't work MASM32 v10 or MASM (ML) v10 The MASM32 download includes MASM v6.14.8444 MASM v10 (part of MSVC Express) generates COFF by default, and requires /OMF to get the older Intel Object Module Format Copy the command line, and application output from the command console (DOS Box, Run "cmd") C:\MASM>\masm32\bin\ml -c test22.asm Microsoft (R) Macro Assembler Version 6.14.8444 Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: test22.asm
C:\MASM>dir Volume in drive C has no label. Volume Serial Number is 227D-EC0C
Directory of C:\MASM
05/30/2010 06:54 AM <DIR> . 05/30/2010 06:54 AM <DIR> .. 05/30/2010 06:53 AM 299 test22.asm 05/30/2010 06:54 AM 95 test22.obj 2 File(s) 394 bytes 2 Dir(s) 20,552,540,160 bytes free Is your problem that it isn't generating an OBJ, or that it is not generating an EXE?
|
|
|
Logged
|
It could be a random act of randomness. Those happen a lot as well.
|
|
|
dedndave
|
good tips Clive - now you are going to make me read the manual - lol
|
|
|
Logged
|
|
|
|
hutch--
Administrator
Member
    
Posts: 12013
Mnemonic Driven API Grinder
|
 > how to write with pure assembler without invoke and print and inkey Many make that assumption when they are starting up and all you need to know is how to write your own advanced runtime library in assembler.  The trick is to use what you can to learn then start doing the more advanced stuff once you have enough experience.
|
|
|
Logged
|
|
|
|
dedndave
|
right Hutch it isn't too difficult to write a "print" routine or "bin2hex", either that inkey routine is a bugger  not as easy as it should be to replace that C-runtime function best to learn the macros well enough to get around a little bit
|
|
|
Logged
|
|
|
|
andrr
Guest
|
i would like to make the perogramme in asm as it was made earlier without any macros step by step and now its getting too complicated to understand everything earlier everything was quite clear ml first.asm, first.obj, first.lst link first.obj first.exe
|
|
|
Logged
|
|
|
|
clive
Hardcore x86, ARM and MIPS toolsmith
Member
    
Posts: 1230
Project Looking Glass. Following the white rabbit.
|
i would like to make the perogramme in asm as it was made earlier without any macros step by step and now its getting too complicated to understand everything earlier everything was quite clear ml first.asm, first.obj, first.lst link first.obj first.exe
That looks more like the syntax for the older DOS era MASM (4.x, 5.x) C:\MASM>\tools\masm51\binb\masm /help Usage: masm /options source(.asm),[out(.obj)],[list(.lst)],[cref(.crf)][;]
/a Alphabetize segments /c Generate cross-reference /d Generate pass 1 listing /D<sym>[=<val>] Define symbol /e Emulate floating point instructions and IEEE format /I<path> Search directory for include files /l[a] Generate listing, a-list all /M{lxu} Preserve case of labels: l-All, x-Globals, u-Uppercase Globals /n Suppress symbol tables in listing /p Check for pure code /s Order segments sequentially /t Suppress messages for successful assembly /v Display extra source statistics /w{012} Set warning level: 0-None, 1-Serious, 2-Advisory /X List false conditionals /z Display source line for each error message /Zi Generate symbolic information for CodeView /Zd Generate line-number information Now you can have it assemble, with a listing, and link as follows ml -coff -Fl first.asm -link /SUBSYSTEM:CONSOLE C:\MASM>\masm32\bin\ml -help Microsoft (R) Macro Assembler Version 6.14.8444 Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
ML [ /options ] filelist [ /link linkoptions ]
/AT Enable tiny model (.COM file) /nologo Suppress copyright message /Bl<linker> Use alternate linker /Sa Maximize source listing /c Assemble without linking /Sc Generate timings in listing /Cp Preserve case of user identifiers /Sf Generate first pass listing /Cu Map all identifiers to upper case /Sl<width> Set line width /Cx Preserve case in publics, externs /Sn Suppress symbol-table listing /coff generate COFF format object file /Sp<length> Set page length /D<name>[=text] Define text macro /Ss<string> Set subtitle /EP Output preprocessed listing to stdout /St<string> Set title /F <hex> Set stack size (bytes) /Sx List false conditionals /Fe<file> Name executable /Ta<file> Assemble non-.ASM file /Fl[file] Generate listing /w Same as /W0 /WX /Fm[file] Generate map /WX Treat warnings as errors /Fo<file> Name object file /W<number> Set warning level /FPi Generate 80x87 emulator encoding /X Ignore INCLUDE environment path /Fr[file] Generate limited browser info /Zd Add line number debug info /FR[file] Generate full browser info /Zf Make all symbols public /G<c|d|z> Use Pascal, C, or Stdcall calls /Zi Add symbolic debug info /H<number> Set max external name length /Zm Enable MASM 5.10 compatibility /I<name> Add include path /Zp[n] Set structure alignment /link <linker options and libraries> /Zs Perform syntax check only
|
|
|
Logged
|
It could be a random act of randomness. Those happen a lot as well.
|
|
|
jj2007
|
Attached the bare minimum. include \masm32\include\masm32rt.inc
.data AppName db "Masm32:", 0 Welcome db "Hello World", 0
.code start: invoke MessageBox, 0, addr Welcome, addr AppName, MB_OK invoke ExitProcess, 0 end start
Batch file: \masm32\bin\ml.exe /c /coff %1 \masm32\bin\link /SubSystem:CONSOLE %~n1 %~n1.exe pause
|
Res.zip (0.44 KB - downloaded 291 times.)
|
|
Logged
|
|
|
|
TmX
|
Attention, TmX meant "If you want console apps, use /SUBSYSTEM:CONSOLE" If you use /SUBSYSTEM:WINDOWS, the executable will run but never exit, and you will need Task Manager to kill it.
typo... d'uh thanks for the correction 
|
|
|
Logged
|
|
|
|
hutch--
Administrator
Member
    
Posts: 12013
Mnemonic Driven API Grinder
|
andrr,
The data you need to use the correct command line options is in the masm32 help file which is where you should be looking. Clive is right, you are not building a 16 bit DOS executable and that notation has not worked for many years.
Now you have the options,
drv:\path\ml.exe /c /coff yourfile.asm
If that builds without errors then you link it with the options explained, either CONSOLE or WINDOWS.
You cannot WISH the notation you want, just look it up like everyone else does.
RE: Your desire to write pure assembler without pseudo high level notation, look in the example code under POASM\poasm1k.
|
|
|
Logged
|
|
|
|
andrr
Guest
|
ok Thanks everybody who found the time to participate
|
|
|
Logged
|
|
|
|
|
Pages: 1 [2]
|
|
|
 |