Need help with assembler language

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Executable name : EATSYSCALL
; Version : 1.0
; Created date : 1/7/2009
; Last update : 2/18/2009
; Author : Jeff Duntemann
; Description : A simple program in assembly for Linux,
; using NASM 2.05, demonstrating the use of Linux INT 80H syscall
; to display text.
;
; Build using these commands:
; nasm -f elf -g -F stabs eatsyscall.asm
; ld -o eatsyscall eatsyscall.o
;
SECTION .data ; Section containing initialised data
EatMsg: db "Eat at Joe's!",10
EatLen: equ $-EatMsg
SECTION .bss ; Section containing uninitialized data
SECTION .text ; Section containing code
global _start ; Linker needs this to find the entry point!
_start:
nop ; This no-op keeps gdb happy...
mov eax,4 ; ## EXPLAIN ME ##
mov ebx,1 ; ## EXPLAIN ME ##
mov ecx,EatMsg ; ## EXPLAIN ME ##
mov edx,EatLen ; ## EXPLAIN ME ##
int 80H ; ## EXPLAIN ME ##
MOV eax,1 ; Code for Exit Syscall
mov ebx,0 ; Return a code of zero
int 80H ; Make kernel call
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



this is a code to display , i need the answers to the #EXPLAIN ME# parts as i cannot work out what they do thankyou.
You should be able to work out
int 80H ; ## EXPLAIN ME ##

because three lines later you have
int 80H ; Make kernel call

The 4 is the syscall number for write(2) when using int 80h
1, EatMsg, and EatLen are the three arguments expected by this syscall (see man 2 write)
Last edited on
Topic archived. No new replies allowed.