Jump to content

Nasm %include help


Recommended Posts

when i try to assemble this file

 

%include "io.mac"   ; to be able to us PutStr....
							 ; yet to be inserted.

section .data
 hello:  db "Hello world!",10
 hellolen  equ $-hello

section .text
global_start
_start:

 mov eax, 4	;The system call for write (sys_write)
 mov ebx, 1	;File descriptor 1 - standard in
 mov ecx, hello   ;Put the offset of hello in ecx
 mov edx, hellolen  ;hellolen is a constant,

 int 80h  ;call the kernel

 mov eax, 1   ;the system call for exit (sys_exit)
 mov ebx, 0   ;exit with return code 0 (no error)
 int 80h	;call the kernel

 

nasm -f elf hello.asm

hello.asm:2: fatal: unable to open include file `io.mac'

 

my Q is how do i include "io.mac". so i can us PutStr

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...