News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

how to build apps with Jwasm

Started by vogelsang, August 15, 2013, 03:03:57 PM

Previous topic - Next topic

vogelsang

hi folks,

i've downloaded Jwasm. aslo downloaded Jwlink and WinInc. i tried to make a simple 64 bit hello world app, but dont know how to link it. I'm also not sure do i assembled it right. which include files and libs use and how to use them?

could someone show me how to build console and gui helloworld with jwlink or other linker.

thanks in advance.

japheth


There are several 64-bit samples included in the jwasm package ( names beginning with Win64* ). At the start of each source file there is a comment how it is supposed to be built.

vogelsang

yes, that's true. I've tried to build few of them, but for example if i try to make Win64_3.asm i get this error message:


E:\JWA\Samples>JWasm -win64 Win64_3.asm
JWasm v2.10, Apr 20 2013, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

Win64_3.asm: 236 lines, 3 passes, 15 ms, 0 warnings, 0 errors

E:\JWA\Samples>jwlink format win pe ru win file Win64_3.obj op start=WinMainCRTS
tartup
JWlink Version 1.9beta 11
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
loading object files
searching libraries
Warning! W1008: cannot open kernel32.lib : No such file or directory
Warning! W1008: cannot open user32.lib : No such file or directory
Error! E2028: GetModuleHandleA is an undefined reference
Error! E2028: GetCommandLineA is an undefined reference
Error! E2028: ExitProcess is an undefined reference
Error! E2028: LoadIconA is an undefined reference
Error! E2028: LoadCursorA is an undefined reference
Error! E2028: RegisterClassExA is an undefined reference
Error! E2028: CreateWindowExA is an undefined reference
Error! E2028: ShowWindow is an undefined reference
Error! E2028: UpdateWindow is an undefined reference
Error! E2028: GetMessageA is an undefined reference
Error! E2028: TranslateMessage is an undefined reference
Error! E2028: DispatchMessageA is an undefined reference
Error! E2028: PostQuitMessage is an undefined reference
Error! E2028: DefWindowProcA is an undefined reference
creating a 64-bit PE executable
file Win64_3.obj(Win64_3.asm): undefined symbol GetModuleHandleA
file Win64_3.obj(Win64_3.asm): undefined symbol GetCommandLineA
file Win64_3.obj(Win64_3.asm): undefined symbol ExitProcess
file Win64_3.obj(Win64_3.asm): undefined symbol LoadIconA
file Win64_3.obj(Win64_3.asm): undefined symbol LoadCursorA
file Win64_3.obj(Win64_3.asm): undefined symbol RegisterClassExA
file Win64_3.obj(Win64_3.asm): undefined symbol CreateWindowExA
file Win64_3.obj(Win64_3.asm): undefined symbol ShowWindow
file Win64_3.obj(Win64_3.asm): undefined symbol UpdateWindow
file Win64_3.obj(Win64_3.asm): undefined symbol GetMessageA
file Win64_3.obj(Win64_3.asm): undefined symbol TranslateMessage
file Win64_3.obj(Win64_3.asm): undefined symbol DispatchMessageA
file Win64_3.obj(Win64_3.asm): undefined symbol PostQuitMessage
file Win64_3.obj(Win64_3.asm): undefined symbol DefWindowProcA

E:\JWA\Samples>


after a few tries, I gave up. I was looking for a similar forum topics, but didn't found what i need. your asm really keeps newbies off;)

japheth

Quote from: vogelsang on August 15, 2013, 05:03:41 PM
after a few tries, I gave up. I was looking for a similar forum topics, but didn't found what i need. your asm really keeps newbies off;)

True, jwasm is not for newbies. And this is even more true for WinInc and jwlink ( I'd say jwlink is for fairly advanced users only! ). All tools expect some basic knowledge and that the user doesn't fear the command line. If these prerequisites are not met, it is expected that the newbie has enough motivation to learn and finally fix the issues him-/herself.

vogelsang


i found solution for ms link
you must replace:


    includelib kernel32.lib
    includelib user32.lib


with the location where you got those two libs. I got in:


    includelib e:\masm64\lib\kernel32.lib
    includelib e:\masm64\lib\user32.lib


this for other newbies.
jwlink will take me more time.


jj2007

Quote from: vogelsang on August 15, 2013, 06:26:36 PM
    includelib e:\masm64\lib\kernel32.lib
    includelib e:\masm64\lib\user32.lib

Yes, that's often better than setting environment variables like LIBPATH (see my PM).
However, includelib \masm64\..., i.e. without the drive letter, would make sure that your code still works if one day your new notebook has no E: drive. "\whatever\" means "folder whatever in the root of the current drive".

vogelsang

#6
by setting this to:


    includelib e:\masm64\lib\kernel32.lib
    includelib e:\masm64\lib\user32.lib


i wanted to show people that we need to tell linker where to search libs. I know that without e: is better, but less descriptive in this case.

i forgot add something. i have downloaded masm64 so i got those libs with it and link.exe. this topic applies to the examples x64 from jwasm packege.

thanks all for help

Magnum

I noticed that windows and asc files don't like RichMasm for some reason.

I got not get the 2 associated.

I did see the reg file.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

jj2007

Quote from: Magnum on August 17, 2013, 07:27:34 AM
I noticed that windows and asc files don't like RichMasm for some reason.

I got not get the 2 associated.

Yes, I have noticed that, too (and not only with RichMasm) - newer Windows versions list only registered programs in the "official" folders.

The RichMasm_C.reg should work; if your Masm32 drive is not C:, you can edit the reg file, or change HKEY_CLASSES_ROOT\Assembler_source_code\shell\open\command by hand.

Magnum

I am using XP Pro.

I have seen that with other programs. M.S. just doesn't want to get their grubby hands off of file extension.

They think they own them.

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

ren970122

    includelib   user32.lib
    includelib   kernel32.lib
    under the JWasm catalogue LIB64 found this .and include it in X64 Code.

dedndave

Quote from: jj2007 on August 17, 2013, 08:01:28 AM
The RichMasm_C.reg should work; if your Masm32 drive is not C:, you can edit the reg file, or change HKEY_CLASSES_ROOT\Assembler_source_code\shell\open\command by hand.

HKCR is a virtual key
better to make changes in HKLM\SOFTWARE\Classes   :t

mineiro

Quote from: vogelsang on August 15, 2013, 05:03:41 PM
your asm really keeps newbies off;)
I cannot understand this, If I like an assembler hard to deal, I write all my programs using just hexadecimal numbers, my own parser, lexical analyser, my own machine translator, my own filetypes output, calling conventions, stack balance, ... .
I hope assemblers do our life easy instead of hard or they will not make any sense.

vogelsang