Monday, June 4, 2018

how to install nasm and do nothing program using assembly

install nasm using this command
install nasm
$ sudo apt-get install nasm  


create directory and files as i shown in figures

edit code on nasm01.asm as showen below
nasm01.asm
section .data ;initialized allocation section 
section .bss  ; Un-initialized memory allocation section  
;------------ 
;code section 
;------------  
section .text   
global _start _start:  
;------------------- 
;begining of program 
;-------------------  
;program  
;-------------- 
;end of program 
;-------------- 
mov ebx ,0  
mov eax,1 
int 0x80      

create object and list file using below commands
compile nasm file
$ nasm -f elf64 -g -F stabs -o obj.o -l lst.l nasm01.asm $ ld -o exe.x obj.o  


how to write nasm hello-word will be on my next blog post

No comments:

Post a Comment