Advertisement
Guest User

Untitled

a guest
May 16th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .text
  2.    global _start            ;must be declared for using gcc
  3.    
  4. _start:                     ;tell linker entry point
  5.    mov    al, 5             ;getting 5 in the al
  6.    mov    bl, 3             ;getting 3 in the bl
  7.    or     al, bl            ;or al and bl registers, result should be 7
  8.    add    al, byte '0'      ;converting decimal to ascii
  9.    
  10.    mov    [result],  al
  11.    mov    eax, 4
  12.    mov    ebx, 1
  13.    mov    ecx, result
  14.    mov    edx, 1
  15.    int    0x80
  16.    
  17. outprog:
  18.    mov    eax,1             ;system call number (sys_exit)
  19.    int    0x80              ;call kernel
  20.    
  21. section    .bss
  22. result resb 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement