mad1231999

Untitled

Apr 26th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. section .data
  2. msg db  "Hello, World!", 0x0a   ; Hello, World! and newline
  3. len equ $-msg           ; Length of msg
  4.  
  5. section .text
  6.     global _start
  7.  
  8. _start:
  9.     mov cx, 9
  10.  
  11.     loop_start:
  12.         push    cx
  13.         add     ecx, 0x30
  14.         push    cx
  15.  
  16.         mov eax, 0x04
  17.         mov ebx, 0x01
  18.         mov ecx, esp
  19.         mov edx, 0x01
  20.         int     0x80
  21.         pop     cx  ; pop non-ascii value
  22.  
  23.         pop     cx
  24.         dec     cx
  25.         cmp cx, 0x00
  26.         jge     loop_start
  27.  
  28.     ; write newline
  29.     push    0x0a
  30.     mov eax, 0x04
  31.     mov ebx, 0x01
  32.     mov ecx, esp
  33.     mov edx, 0x01
  34.     int     0x80
  35.  
  36.     mov     eax, 0x01   ; sys_exit
  37.     mov ebx, 0x00   ; no file descriptor
  38.     int     0x80
Advertisement
Add Comment
Please, Sign In to add comment