Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

UNIX enhancements aren't.


programming / comp.lang.asm.x86 / Re: beginner assembler for windows?

SubjectAuthor
* beginner assembler for windows?paul
+- Re: beginner assembler for windows?Sjouke Burry
+* Re: beginner assembler for windows?Frank Kotler
|`* Re: beginner assembler for windows?paul
| +* Re: beginner assembler for windows?paul
| |+- Re: beginner assembler for windows?paul
| |`* Re: beginner assembler for windows?George Neuner
| | +* Re: beginner assembler for windows?paul
| | |`* Re: beginner assembler for windows?Tavis Ormandy
| | | +- Re: beginner assembler for windows?Kerr-Mudd,John
| | | `* Re: beginner assembler for windows?paul
| | |  `* Re: beginner assembler for windows?Kerr-Mudd,John
| | |   `* Re: beginner assembler for windows?paul
| | |    +* Re: beginner assembler for windows?Tavis Ormandy
| | |    |`* Re: beginner assembler for windows?paul
| | |    | +* Re: beginner assembler for windows?Tavis Ormandy
| | |    | |`* Re: beginner assembler for windows?paul
| | |    | | +- Re: beginner assembler for windows?Tavis Ormandy
| | |    | | +* Re: beginner assembler for windows?Rod Pemberton
| | |    | | |`* Re: beginner assembler for windows?paul
| | |    | | | +- Re: beginner assembler for windows?Steve
| | |    | | | +- Re: beginner assembler for windows?Kerr-Mudd,John
| | |    | | | +- Re: beginner assembler for windows?Rod Pemberton
| | |    | | | `* Re: beginner assembler for windows?George Neuner
| | |    | | |  +* Re: beginner assembler for windows?Anton Ertl
| | |    | | |  |`* Re: beginner assembler for windows?paul
| | |    | | |  | +* Re: beginner assembler for windows?Anton Ertl
| | |    | | |  | |`* Re: beginner assembler for windows?paul
| | |    | | |  | | `- Re: beginner assembler for windows?James Van Buskirk
| | |    | | |  | `* Re: beginner assembler for windows?wolfgang kern
| | |    | | |  |  `* Re: beginner assembler for windows?paul
| | |    | | |  |   `- Re: beginner assembler for windows?wolfgang kern
| | |    | | |  `- Re: beginner assembler for windows?paul
| | |    | | `* Re: beginner assembler for windows?wolfgang kern
| | |    | |  +- Re: beginner assembler for windows?Kerr-Mudd,John
| | |    | |  `- Re: beginner assembler for windows?George Neuner
| | |    | +* Re: beginner assembler for windows?R.Wieser
| | |    | |`- Re: beginner assembler for windows?George Neuner
| | |    | `* Re: beginner assembler for windows?Herbert Kleebauer
| | |    |  `* Re: beginner assembler for windows?paul
| | |    |   +* Re: beginner assembler for windows?Kerr-Mudd,John
| | |    |   |`* Re: beginner assembler for windows?wolfgang kern
| | |    |   | `- Re: beginner assembler for windows?Bernhard Schornak
| | |    |   +- Re: beginner assembler for windows?Herbert Kleebauer
| | |    |   +- Re: beginner assembler for windows?Pavel_vitsoft_Šrubař
| | |    |   `- Re: beginner assembler for windows?Rod Pemberton
| | |    +- Re: beginner assembler for windows?Frank Kotler
| | |    `* Re: beginner assembler for windows?Frank Kotler
| | |     `- Re: beginner assembler for windows?Kerr-Mudd,John
| | `- Re: beginner assembler for windows?Rickey Bowers
| `- Re: beginner assembler for windows?Frank Kotler
+* Re: beginner assembler for windows?wolfgang kern
|`* Re: beginner assembler for windows?paul
| `* Re: beginner assembler for windows?wolfgang kern
|  `- Re: beginner assembler for windows?aen
+- Re: beginner assembler for windows?Bonita Montero
`- Re: beginner assembler for windows?Rickey Bowers

Pages:123
Subject: Re: beginner assembler for windows?
From: wolfgang kern
Newsgroups: comp.lang.asm.x86
Organization: Aioe.org NNTP Server
Date: Mon, 25 Jan 2021 13:32 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nowh...@nospicedham.never.at (wolfgang kern)
Newsgroups: comp.lang.asm.x86
Subject: Re: beginner assembler for windows?
Date: Mon, 25 Jan 2021 14:32:36 +0100
Organization: Aioe.org NNTP Server
Lines: 44
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <rumhg3$1317$1@gioia.aioe.org>
References: <ru2e8g$1pp0$1@gioia.aioe.org>
<584b0ghk4a257oao5mam70p0j61gdn1rbi@4ax.com> <ru5eca$394$1@gioia.aioe.org>
<i6n4lkFmj4tU1@mid.individual.net> <ru6nt5$esj$1@gioia.aioe.org>
<XnsACB7A6869E7C6admin127001@144.76.35.252> <ru75dg$1efo$1@gioia.aioe.org>
<i6omj9F21o8U1@mid.individual.net> <ru8dct$roi$1@gioia.aioe.org>
<i6q78sFaeg8U1@mid.individual.net> <ru98pi$2nu$1@gioia.aioe.org>
<rub9me$f04$2@gioia.aioe.org> <rugiv0$i70$1@gioia.aioe.org>
<mn1r0gt7eer22ftan449h22oh8vk4t6hcu@4ax.com>
<2021Jan24.173912@mips.complang.tuwien.ac.at> <ruljk4$sm7$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="598320792bdfb386745209c728d9b89c";
logging-data="26385"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18t74oXKFat/eeLpKiylA6efpb+JSp3ra4="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:85.0) Gecko/20100101
Thunderbird/85.0
Cancel-Lock: sha1:FUumH3OpdMOVUSfnitEWTpsitA4=
View all headers
On 25.01.2021 06:06, paul wrote:
Anton Ertl wrote:

I teach about 70 noobs every year to write something in assembler for
a modern 64-bit chip, so I obviously disagree.

At some point, rather soon, I'm going to have to give up on asking and just
start following _somebody's_ tutorial on my X64 Windows 10 desktop.

Given that, what do you think of this "Understanding Windows x64 Assembly?
https://sonictk.github.io/asm_tutorial/

now there you got your win64 hello world tutorial :)

bits 64
default rel

segment .data
     msg db "Hello world!", 0xd, 0xa, 0

segment .text
global main
extern ExitProcess

extern printf

main:
     push    rbp
     mov     rbp, rsp
     sub     rsp, 32

     lea     rcx, [msg]
     call    printf

     xor     rax, rax
     call    ExitProcess
....
Anyway, I'll write my own tutorial - but it's crazy that I have to do that.
All I'm asking in this post is if the sonictk site seems reasonable to you.

good luck.
__
wolfgang



Subject: Re: beginner assembler for windows?
From: paul
Newsgroups: comp.lang.asm.x86
Organization: Aioe.org NNTP Server
Date: Mon, 25 Jan 2021 17:59 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nos...@nospicedham.nospam.invalid (paul)
Newsgroups: comp.lang.asm.x86
Subject: Re: beginner assembler for windows?
Date: Mon, 25 Jan 2021 18:59:40 +0100
Organization: Aioe.org NNTP Server
Lines: 50
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <run0ua$1282$1@gioia.aioe.org>
References: <ru2e8g$1pp0$1@gioia.aioe.org> <584b0ghk4a257oao5mam70p0j61gdn1rbi@4ax.com> <ru5eca$394$1@gioia.aioe.org> <i6n4lkFmj4tU1@mid.individual.net> <ru6nt5$esj$1@gioia.aioe.org> <XnsACB7A6869E7C6admin127001@144.76.35.252> <ru75dg$1efo$1@gioia.aioe.org> <i6omj9F21o8U1@mid.individual.net> <ru8dct$roi$1@gioia.aioe.org> <i6q78sFaeg8U1@mid.individual.net> <ru98pi$2nu$1@gioia.aioe.org> <rub9me$f04$2@gioia.aioe.org> <rugiv0$i70$1@gioia.aioe.org> <mn1r0gt7eer22ftan449h22oh8vk4t6hcu@4ax.com> <2021Jan24.173912@mips.complang.tuwien.ac.at> <ruljk4$sm7$1@gioia.aioe.org> <rumhg3$1317$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="598320792bdfb386745209c728d9b89c";
logging-data="22077"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19mFLucArwsg4Yx/BErbolIKZK1nhknC1Q="
User-Agent: ForteAgent/8.00.32.1272
Cancel-Lock: sha1:eJYQG+RPDH3pddDVTMAuh4p6QJE=
View all headers
wolfgang kern wrote:

Given that, what do you think of this "Understanding Windows x64 Assembly?
https://sonictk.github.io/asm_tutorial/

now there you got your win64 hello world tutorial :)

We already had a hello world working in this thread on January 18th.
 Message-ID: <ru342u$p8t$1@gioia.aioe.org>
But, as others may recall, it didn't use Microsoft MASM but MASM32 from
http://www.masm32.com/
Which came with its own linker
 C:\mypath\masm32\bin\ml.exe /c /Zd /coff hello.asm
 C:\mypath\masm32\bin\Link /SUBSYSTEM:CONSOLE hello.obj
Which worked fine following the steps in this hello world tutorial
   https://doc.lagout.org/operating%20system%20/Windows/winasmtut.pdf

But that used "MASM32" and not Microsoft MASM (nor NASM).

Nobody responded when I had asked if that's a decent assembler & linker.
For example, can we use _that_ linker instead of the MS Visual C link.exe?

The linker is the important step as it has to work with the assembler.
*Can someone clarify where we can get a decent linker for object modules?*

Anyway, I'll write my own tutorial - but it's crazy that I have to do that.
All I'm asking in this post is if the sonictk site seems reasonable to you.

good luck.

*I need to _simplify_ the step of obtaining a linker for the basic noob.*

I spent _hours_ downloading & creating offline installers for Visual Studio.
Just to get a linker (MS link.exe).

Given MS Visual Studio is astoundingly huge bloatware just for that linker
https://visualstudio.microsoft.com/downloads/

A very important question to resolve for a noob is _where_ to get a linker!
For example, for the assembly code that works with Nasm, can we just
substitute the MASM32 linker above instead of the MS Visual Studio linker?

I don't know what the requirements are for the linker, but I do know that
the way I obtained the linker via Visual Studio is horribly complex for a
basic noob tutorial that I'm just starting to write.

Given I need to _simplify_ the step of obtaining a linker for use with Nasm,
*can someone explain where we can get a decent linker for object modules?*
(Without having to first download & then install immense MS VS bloatware?)



Subject: Re: beginner assembler for windows?
From: paul
Newsgroups: comp.lang.asm.x86
Organization: Aioe.org NNTP Server
Date: Tue, 26 Jan 2021 07:23 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nos...@nospicedham.nospam.invalid (paul)
Newsgroups: comp.lang.asm.x86
Subject: Re: beginner assembler for windows?
Date: Tue, 26 Jan 2021 08:23:26 +0100
Organization: Aioe.org NNTP Server
Lines: 64
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <ruog1d$m34$1@gioia.aioe.org>
References: <ru2e8g$1pp0$1@gioia.aioe.org> <i6n4lkFmj4tU1@mid.individual.net> <ru6nt5$esj$1@gioia.aioe.org> <XnsACB7A6869E7C6admin127001@144.76.35.252> <ru75dg$1efo$1@gioia.aioe.org> <i6omj9F21o8U1@mid.individual.net> <ru8dct$roi$1@gioia.aioe.org> <i6q78sFaeg8U1@mid.individual.net> <ru98pi$2nu$1@gioia.aioe.org> <rub9me$f04$2@gioia.aioe.org> <rugiv0$i70$1@gioia.aioe.org> <mn1r0gt7eer22ftan449h22oh8vk4t6hcu@4ax.com> <2021Jan24.173912@mips.complang.tuwien.ac.at> <ruljk4$sm7$1@gioia.aioe.org> <2021Jan25.092806@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="01e12a0551a4b5944b757fa4e69b8fa3";
logging-data="16235"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+RKepLCjJLIYXn6Qg+C/ndkiT/5XSdbtA="
User-Agent: ForteAgent/8.00.32.1272
Cancel-Lock: sha1:flIgFWant10m9eLNb+G43qqrCkQ=
View all headers
Anton Ertl wrote:

Given that, what do you think of this "Understanding Windows x64 Assembly?
https://sonictk.github.io/asm_tutorial/

Whether it works as a tutorial, is probably
up to you to determine; I have no checklist for assembly tutorials.

Success (of sorts), at last (I think) for the 10-step hello world tutorial.

Following the previous instructions from "Tavis Ormandy" to check the
"Individual components" Visual Studio Community 2019 checkbox for
"MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.28)", I finally have
the necessary Microsoft "link.exe" linker installed (I think).

Here's where I am while trying to faithfully follow the tutorial at
https://sonictk.github.io/asm_tutorial/

(1) Onto my Win10 x64 20H2 computer, I install the latest Nasm from
    https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/nasm-2.15.05-installer-x64.exe

(2) I then install the latest Microsoft link.exe from
    https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16

(3) After installing Nasm, I check the version of nasm on Windows 10 x64
    nasm -v
    NASM version 2.15.05 compiled on Aug 28 2020

(4) Then I download the "hello_world.asm" text file to my Win10 x64 system
    https://github.com/sonictk/asm_tutorial/blob/master/hello_world.asm

(5) I then assemble that asm file into a hello_world.obj object module
    nasm -f win64 -o hello_world.obj hello_world.asm

(6) Then I try the Microsoft Visual Studio Community 2019 linker
    "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\link.exe" hello_world.obj /subsystem:console /entry:main /out:hello_world_basic.exe

(7) Drat. Errors result even when I follow the tutorial exactly.
    Microsoft (R) Incremental Linker Version 14.28.29336.0
    Copyright (C) Microsoft Corporation.  All rights reserved.

    hello_world.obj : error LNK2001: unresolved external symbol ExitProcess
    hello_world_basic.exe : fatal error LNK1120: 1 unresolved externals

(8) Given "ExitProcess" is the last line, I commented it out & tried again,
    resulting in no errors and the creation of "hello_world_basic.exe"

(9) Yet, when I ran "hello_world_basic.exe" on the Win10 x64 command line
    (or in the Win10 x64 File Explorer GUI), it didn't display the expected
    output (it actually displayed nothing - but no errors came out either).

(10) I tried "ExitProcess@4" as per this stackoverflow question
     https://stackoverflow.com/questions/4123013/error-lnk2001-unresolved-external-symbol-messagebox
     But what I simply need now is an assembly language program that works
     as the point, at the point of a "hello world" is NOT to be debugging
     bad assembly language coding (debugging programs should come way later).
     https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2001?view=msvc-160
     https://social.msdn.microsoft.com/Forums/vstudio/en-US/71a80e19-4e6a-41fe-b1db-26e331da474d/linking-errors-lnk2001-unresolved-external-symbol-when-compiled-by-nasm
     http://www.masmforum.com/board/index.php?topic=15872;prev_next=next

So the hello world is, finally, a bit closer to working with the latest Nasm
& the latest Visual Studio Community 2019, but the syntax in the hello world
example is, somehow, still a bit wrong for running at the Windows 10 x64 CLI.



Subject: Re: beginner assembler for windows?
From: wolfgang kern
Newsgroups: comp.lang.asm.x86
Organization: Aioe.org NNTP Server
Date: Tue, 26 Jan 2021 08:29 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nowh...@nospicedham.never.at (wolfgang kern)
Newsgroups: comp.lang.asm.x86
Subject: Re: beginner assembler for windows?
Date: Tue, 26 Jan 2021 09:29:18 +0100
Organization: Aioe.org NNTP Server
Lines: 34
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <ruok3e$bqm$1@gioia.aioe.org>
References: <ru2e8g$1pp0$1@gioia.aioe.org>
<584b0ghk4a257oao5mam70p0j61gdn1rbi@4ax.com> <ru5eca$394$1@gioia.aioe.org>
<i6n4lkFmj4tU1@mid.individual.net> <ru6nt5$esj$1@gioia.aioe.org>
<XnsACB7A6869E7C6admin127001@144.76.35.252> <ru75dg$1efo$1@gioia.aioe.org>
<i6omj9F21o8U1@mid.individual.net> <ru8dct$roi$1@gioia.aioe.org>
<i6q78sFaeg8U1@mid.individual.net> <ru98pi$2nu$1@gioia.aioe.org>
<rub9me$f04$2@gioia.aioe.org> <rugiv0$i70$1@gioia.aioe.org>
<mn1r0gt7eer22ftan449h22oh8vk4t6hcu@4ax.com>
<2021Jan24.173912@mips.complang.tuwien.ac.at> <ruljk4$sm7$1@gioia.aioe.org>
<rumhg3$1317$1@gioia.aioe.org> <run0ua$1282$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="01e12a0551a4b5944b757fa4e69b8fa3";
logging-data="11395"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/LDC+aVKpN42rySQaY4Z0bcIA0hY2KfHI="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:85.0) Gecko/20100101
Thunderbird/85.0
Cancel-Lock: sha1:eQ6QPqwi1MIL2Gh0eaeEv3EHThU=
View all headers
On 25.01.2021 18:59, paul wrote:
wolfgang kern wrote:

Given that, what do you think of this "Understanding Windows x64 Assembly?
https://sonictk.github.io/asm_tutorial/

now there you got your win64 hello world tutorial :)

We already had a hello world working in this thread on January 18th.
  Message-ID: <ru342u$p8t$1@gioia.aioe.org>
But, as others may recall, it didn't use Microsoft MASM but MASM32 from
  http://www.masm32.com/
Which came with its own linker
  C:\mypath\masm32\bin\ml.exe /c /Zd /coff hello.asm
  C:\mypath\masm32\bin\Link /SUBSYSTEM:CONSOLE hello.obj
Which worked fine following the steps in this hello world tutorial
    https://doc.lagout.org/operating%20system%20/Windows/winasmtut.pdf

But that used "MASM32" and not Microsoft MASM (nor NASM).

Nobody responded when I had asked if that's a decent assembler & linker.
For example, can we use _that_ linker instead of the MS Visual C link.exe?

The linker is the important step as it has to work with the assembler.
*Can someone clarify where we can get a decent linker for object modules?*

Sorry I never needed nor used any LINKer. Someone else might answer it.
RosAsm compiled text source to PEexe incl.debugger w/o a link process.
FASMW compiled asm-source to either binary (.COM) or winPE w/o linker.

NASM wont link with MASM nor MASM32 tools, but Frank knows it for sure.
__
wolfgang



Subject: Re: beginner assembler for windows?
From: James Van Buskirk
Newsgroups: comp.lang.asm.x86
Organization: A noiseless patient Spider
Date: Tue, 26 Jan 2021 12:49 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: not_va...@nospicedham.comcast.net (James Van Buskirk)
Newsgroups: comp.lang.asm.x86
Subject: Re: beginner assembler for windows?
Date: Tue, 26 Jan 2021 05:49:50 -0700
Organization: A noiseless patient Spider
Lines: 100
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <rup35q$bvi$1@dont-email.me>
References: <ru2e8g$1pp0$1@gioia.aioe.org> <i6n4lkFmj4tU1@mid.individual.net> <ru6nt5$esj$1@gioia.aioe.org> <XnsACB7A6869E7C6admin127001@144.76.35.252> <ru75dg$1efo$1@gioia.aioe.org> <i6omj9F21o8U1@mid.individual.net> <ru8dct$roi$1@gioia.aioe.org> <i6q78sFaeg8U1@mid.individual.net> <ru98pi$2nu$1@gioia.aioe.org> <rub9me$f04$2@gioia.aioe.org> <rugiv0$i70$1@gioia.aioe.org> <mn1r0gt7eer22ftan449h22oh8vk4t6hcu@4ax.com> <2021Jan24.173912@mips.complang.tuwien.ac.at> <ruljk4$sm7$1@gioia.aioe.org> <2021Jan25.092806@mips.complang.tuwien.ac.at> <ruog1d$m34$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="01e12a0551a4b5944b757fa4e69b8fa3";
logging-data="17784"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189aNZM/GLiHzsvZnc6/Wglq+Ql1LfO1FM="
Cancel-Lock: sha1:n6eDsACI+L4Cp4XiBpRKDKc8qxA=
View all headers
"paul"  wrote in message news:ruog1d$m34$1@gioia.aioe.org...

Success (of sorts), at last (I think) for the 10-step hello world tutorial.

Following the previous instructions from "Tavis Ormandy" to check the
"Individual components" Visual Studio Community 2019 checkbox for
"MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.28)", I finally have
the necessary Microsoft "link.exe" linker installed (I think).

Here's where I am while trying to faithfully follow the tutorial at
https://sonictk.github.io/asm_tutorial/

(1) Onto my Win10 x64 20H2 computer, I install the latest Nasm from

https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/nasm-2.15.05-installer-x64.exe

(2) I then install the latest Microsoft link.exe from

https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16

(3) After installing Nasm, I check the version of nasm on Windows 10 x64
    nasm -v
    NASM version 2.15.05 compiled on Aug 28 2020

(4) Then I download the "hello_world.asm" text file to my Win10 x64 system
    https://github.com/sonictk/asm_tutorial/blob/master/hello_world.asm

(5) I then assemble that asm file into a hello_world.obj object module
    nasm -f win64 -o hello_world.obj hello_world.asm

(6) Then I try the Microsoft Visual Studio Community 2019 linker
    "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\link.exe"
hello_world.obj /subsystem:console /entry:main /out:hello_world_basic.exe

(7) Drat. Errors result even when I follow the tutorial exactly.
    Microsoft (R) Incremental Linker Version 14.28.29336.0
    Copyright (C) Microsoft Corporation.  All rights reserved.

    hello_world.obj : error LNK2001: unresolved external symbol ExitProcess
    hello_world_basic.exe : fatal error LNK1120: 1 unresolved externals

ExitProcess is documented here (usually I try searching for something like
ExitProcess MSDN on google)
https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-exitprocess
The critical component it says you are missing is Kernel32.lib. You
should be able to fix that by adding the switch
/defaultlib:Kernel32
I found this by searching for link.exe in google and then got to
https://docs.microsoft.com/en-us/cpp/build/reference/defaultlib-specify-default-library?view=msvc-160

(8) Given "ExitProcess" is the last line, I commented it out & tried again,
    resulting in no errors and the creation of "hello_world_basic.exe"

(9) Yet, when I ran "hello_world_basic.exe" on the Win10 x64 command line
    (or in the Win10 x64 File Explorer GUI), it didn't display the expected
    output (it actually displayed nothing - but no errors came out either).

Yeah, that's because your program doesn't do anything obvious. You could use
the Win32 API function wsprintfA to do some output. That needs User32.lib.
alternatively you could use printf from the C library, that wold require something
like ucrt.lib. Hopefully you know or can figure out how to do basic I/O in C.

(10) I tried "ExitProcess@4" as per this stackoverflow question

https://stackoverflow.com/questions/4123013/error-lnk2001-unresolved-external-symbol-messagebox
     But what I simply need now is an assembly language program that works
     as the point, at the point of a "hello world" is NOT to be debugging
     bad assembly language coding (debugging programs should come way later).

https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2001?view=msvc-160

https://social.msdn.microsoft.com/Forums/vstudio/en-US/71a80e19-4e6a-41fe-b1db-26e331da474d/linking-errors-lnk2001-unresolved-external-symbol-when-compiled-by-nasm
     http://www.masmforum.com/board/index.php?topic=15872;prev_next=next

That won't fly because it says to use name-mangling that the STDCALL
convention uses in 32-bit Windows. In 64-bit Windows there is no name
mangling. Well there is for C++ functions, but we aren't going to go there
if we can help it. You will find
https://agner.org/optimize/calling_conventions.pdf
quite useful in this context.

So the hello world is, finally, a bit closer to working with the latest Nasm
& the latest Visual Studio Community 2019, but the syntax in the hello world
example is, somehow, still a bit wrong for running at the Windows 10 x64 CLI.

From your bio you have most of the hard stuff under control; you just
need to get over a little stumbling block!



Subject: Re: beginner assembler for windows?
From: Bonita Montero
Newsgroups: comp.lang.asm.x86
Organization: A noiseless patient Spider
Date: Wed, 27 Jan 2021 19:33 UTC
References: 1
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@nospicedham.gmail.com (Bonita Montero)
Newsgroups: comp.lang.asm.x86
Subject: Re: beginner assembler for windows?
Date: Wed, 27 Jan 2021 20:33:23 +0100
Organization: A noiseless patient Spider
Lines: 8
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <rusf66$rbl$2@dont-email.me>
References: <rtvd99$1au3$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="b4b6a5d681300a647d3bdb0f319db1ea";
logging-data="1578"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Z/M7U3eF2jBEX+duJedC1X5vi+4lkt1E="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.6.1
Cancel-Lock: sha1:mymADyrHFvw6/wcIike2u2ElFbw=
View all headers
advise for a good beginner windoze assembler?

Begin with 32 bit programming and use the inline-assembler of
MSVC (64 bit MSVC++ hasn't any inline-assembler any more). With
naked functions (functions without a compiler generated prologue
and epilogue) you don't have to learn the directives for an
assembler.



Subject: Re: beginner assembler for windows?
From: Rickey Bowers
Newsgroups: comp.lang.asm.x86
Organization: A noiseless patient Spider
Date: Mon, 8 Feb 2021 18:48 UTC
References: 1
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bitr...@nospicedham.gmail.com (Rickey Bowers)
Newsgroups: comp.lang.asm.x86
Subject: Re: beginner assembler for windows?
Date: Mon, 8 Feb 2021 10:48:31 -0800 (PST)
Organization: A noiseless patient Spider
Lines: 14
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <69b16aeb-209c-4b0e-8485-d881ddbb0377n@googlegroups.com>
References: <rtvd99$1au3$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Date: Mon, 08 Feb 2021 18:48:32 +0000
Injection-Info: reader02.eternal-september.org; posting-host="bc6a5ffc1dcf59549c4aec27658ff737";
logging-data="23782"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pRix7Gu1MF4Lh0k6eVj9liY/x5BqJF1g="
User-Agent: G2/1.0
Cancel-Lock: sha1:cvPchns2HsEQbK0VEn8XXlpah+4=
View all headers
On Saturday, January 16, 2021 at 2:54:06 PM UTC-7, paul wrote:
advise for a good beginner windoze assembler?

https://flatassembler.net/

fasm requires no installation beyond setting the include directory and has plenty of examples in 32-bit/64-bit windows. Besides comp.lang.asm.x86 it's probably the longest running community on x86. The assembler is written in x86, and open source. At just over a megabyte, it might be the smallest option as well.

disclaimer: I'm approaching 20 years of working fasm/fasmg. My x86 path was: debug, tasm, nasm, masm, fasm.



Pages:123

rocksolid light 0.8.3
clearneti2ptor