Advertisement
Guest User

ali

a guest
Nov 26th, 2015
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .data
  2. intout: .string "Wert: %d\n"
  3. snr:    .long 1120042897 # 0100 00|10 1|100 0010 0111 11|11 1|001 0001
  4.  
  5. .text
  6. .global main
  7.  
  8. main:
  9.     movl $0, %ecx
  10.             # 7th to 9th bit
  11.     movl snr, %eax
  12.     shrl $7, %eax
  13.     andl $7, %eax
  14.     addl %eax, %ecx
  15.    
  16.             # 23rd to 25th bit
  17.     movl snr, %eax
  18.     shrl $23, %eax
  19.     andl $7, %eax
  20.     addl %eax, %ecx
  21.  
  22.     cmpl $12, %ecx
  23.     je .valid
  24.     movl $0, %eax
  25.     jmp .invalid
  26.  
  27. .valid:
  28.     movl $1, %eax
  29.  
  30. .invalid:
  31.    
  32.     pushl %eax
  33.     pushl $intout
  34.     call printf
  35.             # Exit
  36.  
  37.     movl $1, %eax
  38.     int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement