Advertisement
hackercademy

Cond

Dec 19th, 2013
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 0.79 KB | None | 0 0
  1. .data
  2.    
  3.     HelloWorld:
  4.         .asciz "Hello World!\n"
  5.  
  6.     ZeroFlagSet:
  7.         .asciz  "Zero Flag was Set!"
  8.  
  9.     ZeroFlagNotSet:
  10.         .asciz  "Zero Flag Not Set!"
  11.  
  12.  
  13. .text
  14.  
  15.     .globl _start
  16.  
  17.     _start:
  18.  
  19.         nop
  20.         movl $10, %eax
  21.         xorl %eax, %eax
  22.         jz PrintHelloWorld
  23.  
  24.     FlagNotSetPrint:
  25.         movl $4, %eax
  26.         movl $1, %ebx
  27.         leal ZeroFlagNotSet, %ecx
  28.         movl $19, %edx
  29.         int $0x80
  30.         jmp ExitCall
  31.  
  32.  
  33.  
  34.     FlagSetPrint:
  35.         movl $4, %eax
  36.         movl $1, %ebx
  37.         leal ZeroFlagSet, %ecx
  38.         movl $19, %edx
  39.         int $0x80
  40.         jmp ExitCall
  41.  
  42.  
  43.     ExitCall:
  44.         movl $1, %eax
  45.         movl $0, %ebx
  46.         int $0x80
  47.  
  48.     PrintHelloWorld:
  49.         movl $10, %ecx
  50.         PrintTenTimes:
  51.             pushl %ecx
  52.             movl $4, %eax
  53.             movl $1, %ebx
  54.             leal HelloWorld, %ecx
  55.             movl $14, %edx
  56.             int $0x80
  57.             popl %ecx
  58.         loop PrintTenTimes
  59.         jmp ExitCall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement