daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest Dec 5th, 2017 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     #purpose: simple program that exits and returns a status code back to the linux kernel
  2.     #Input: none
  3.     #output: returns a status code. this can e viewed by typing echo $? after running the program
  4.     #variables: %eax holds the system call number (this is always the case)
  5.     # %ebx holds the return status
  6.     .section .data
  7.     .section .text
  8.     .globl _start
  9. _start:
  10.     movl $1, %eax #this is the linux kernel command number (system call) for exiting a program
  11.     movl $0, %ebx #this is the status number we will return to the operating system. change this around and it will return different things to echo $?
  12.     int $0x80     #this wakes up the kernel to run the exist command
RAW Paste Data
Top