Download and Install NASM and Write and Test first Assembly Program on Windows - Practical Demo

preview_player
Показать описание
This video step by step demonstrates how to Install NASM on Windows and How to Write and Test the First Assembly Program on Windows. Following steps are performed in this video.

Step-1 Download Code Blocks - 32 Bit Windows with MingW

Step-2 Download NASM - 32 Bit Windows

Step-3 Extract NASM Installer in C:\Program Files (x86)\CodeBlocks\MinGW\bin

global _main
extern _printf
section .text
_main:
push message
call _printf
add esp, 4
ret
message:
db 'Hello World From Dr. Parag Shukla', 0

Step-5 Open Command Prompt and use cd command to change directory to bin
cd "C:\Program Files (x86)\CodeBlocks\MinGW\bin"

Step-6 Generate Object File

Step-7 Generate Exe file using GCC

Step-8 Run Exe file to produce the output

Thank You

For Learning More about Programming
Рекомендации по теме
Комментарии
Автор

real thanks... at first I thought that I should not download the 32 bit version and I downloaded the 64 bit version and I got a bunch of errors. Then I deleted everything and followed the steps and downloaded the 32 bit version and everything is working properly.
thanks again

mohammedhajomar
Автор

Thank you so much, when trying on windows before, directly downloading gcc from other sources was unsuccessful, but now it works!

maohupi
Автор

It's really easy if you do not have a D drive, you can use an USB(D) pen drive. I did the same and it worked.

its.skywalker
Автор

hello brother it is saying -fuse-linker-plugin but liblto_plugin-0.dll not found what should i do now

f-ght
Автор

Thanks ♥
I love that you explained every step very detailed

ctpax
Автор

thanks, you just made a dream come true

yanikinauen
Автор

In my msys folder there are both mingw32 and mingw64, can I use the mingw32 instead of code block?And I saw the gcc in mingw64 folder and I set it to PATH.Will this gcc work if i type it in the command line?

laplacechang
Автор

in my case i had to use gcc -m32 otherwise i get error undefined reference to `WinMain'

HRJosef
Автор

Could you please show us where to exactly store the demo1.asm file in Windows 11

thenetworkguru
Автор

'nasm' is not recognized as an internal or external command,
operable program or batch file

code_bava
Автор

Can I install the 64 bit version my computer is 64 bit.
Great video by the way thanks👏 👍

bestprogramming
Автор

not only for this my cmd always terminate the compilation by reportiong the fatel error

daniyalakbar
Автор

The last portion is where I am a bit lost please create a video of this with baby steps so absolute beginners such as myself can follow

thenetworkguru
Автор

how do you call the object file in windows 64

thenetworkguru
Автор

C:\Program Files (x86)\CodeBlocks\MinGW\bin

gerardovilledadev
Автор

Went to the code block website and got a virus 👍

kingcmb
Автор

nasm -f win32 d:\ASM\main.asm -o d:\ASM\main.obj

gerardovilledadev
Автор

hey! when trying this code:

section .text
global _start ;must be declared for linker (ld)

_start: ;tells linker entry point
mov edx, len ;message length
mov ecx, msg ;message to write
mov ebx, 1 ;file descriptor (stdout)
mov eax, 4 ;system call number (sys_write)
int 0x80 ;call kernel

mov eax, 1 ;system call number (sys_exit)
int 0x80 ;call kernel

section .data
msg db 'Hello, world!', 0xa ;string to be printed
len equ $ - msg ;length of the string

it gets me this error:

I learn programs through the Internet, so what I know about the program is not much

megaballvn
Автор

I installed nasm 64bit and gcc 64 bit but ran same commands and got this error:
relocation truncated to fit: IMAGE_REL_AMD64_ADDR32 against `.text'
C:/Program undefined reference to `_printf'
C:/Program C:/Program undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status

timnako