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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...