Author Topic: how to build apps with Jwasm  (Read 15536 times)

vogelsang

  • Member
  • **
  • Posts: 64
how to build apps with Jwasm
« on: August 15, 2013, 03:03:57 PM »
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.
"How beautiful this world ruled by dibs, not a gun!"
...

japheth

  • Guest
Re: how to build apps with Jwasm
« Reply #1 on: August 15, 2013, 03:47:17 PM »

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

  • Member
  • **
  • Posts: 64
Re: how to build apps with Jwasm
« Reply #2 on: August 15, 2013, 05:03:41 PM »
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:

Code: [Select]
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;)
"How beautiful this world ruled by dibs, not a gun!"
...

japheth

  • Guest
Re: how to build apps with Jwasm
« Reply #3 on: August 15, 2013, 05:43:40 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

  • Member
  • **
  • Posts: 64
Re: how to build apps with Jwasm
« Reply #4 on: August 15, 2013, 06:26:36 PM »

i found solution for ms link
you must replace:

Code: [Select]
    includelib kernel32.lib
    includelib user32.lib

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

Code: [Select]
    includelib e:\masm64\lib\kernel32.lib
    includelib e:\masm64\lib\user32.lib

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

"How beautiful this world ruled by dibs, not a gun!"
...

jj2007

  • Member
  • *****
  • Posts: 10644
  • Assembler is fun ;-)
    • MasmBasic
Re: how to build apps with Jwasm
« Reply #5 on: August 15, 2013, 06:37: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

  • Member
  • **
  • Posts: 64
Re: how to build apps with Jwasm
« Reply #6 on: August 15, 2013, 08:57:01 PM »
by setting this to:

Code: [Select]
    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
« Last Edit: August 16, 2013, 05:32:18 AM by vogelsang »
"How beautiful this world ruled by dibs, not a gun!"
...

Magnum

  • Member
  • *****
  • Posts: 2354
Re: how to build apps with Jwasm
« Reply #7 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.

I did see the reg file.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

jj2007

  • Member
  • *****
  • Posts: 10644
  • Assembler is fun ;-)
    • MasmBasic
Re: how to build apps with Jwasm
« Reply #8 on: August 17, 2013, 08:01:28 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

  • Member
  • *****
  • Posts: 2354
Re: how to build apps with Jwasm
« Reply #9 on: August 17, 2013, 09:31:48 AM »
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

  • Guest
Re: how to build apps with Jwasm
« Reply #10 on: November 06, 2013, 10:03:31 PM »
    includelib   user32.lib
    includelib   kernel32.lib
    under the JWasm catalogue LIB64 found this .and include it in X64 Code.

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
Re: how to build apps with Jwasm
« Reply #11 on: November 07, 2013, 03:12:54 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

  • Guest
Re: how to build apps with Jwasm
« Reply #12 on: November 20, 2013, 11:49:52 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

  • Member
  • **
  • Posts: 64
Re: how to build apps with Jwasm
« Reply #13 on: November 22, 2013, 02:26:36 AM »
It was a joke and quiet refrence to this thread.

http://masm32.com/board/index.php?topic=1675.0

best
vogelsang
"How beautiful this world ruled by dibs, not a gun!"
...