Answer
Create your assembly language source file. The Ex__3_hello_x64.asm
file contains the following example solution to this exercise:
.code includelib libcmt.lib includelib legacy_stdio_definitions.lib extern printf:near extern exit:near public main main proc ; Reserve stack space sub rsp, 40 ; Print the message lea rcx, message call printf ; Exit the program with status 0 xor rcx, rcx call exit main endp .data message db "Hello, Computer Architect!",0 end
Open the x64 Native Tools Command Prompt for VS 2019 and change to the directory containing your source file.
Build the executable with this command:
ml64 /Fl /Zi /Zd Ex__3_hello_x64.asm
This is the output produced by the program:
C:\>Ex__3_hello_x64.exe Hello, Computer Architect!
This is the listing file created by the build procedure:
Microsoft (R) Macro Assembler (x64) Version 14.24.28314.0 01/15/20 18:44:39 Ex__3_hello_x64.asm...