SHARE
TWEET

Untitled

a guest Jun 20th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define bob 10
  2. .equ bob, 10
  3.      
  4. unsigned int ted;
  5. ted:
  6. .word 0
  7.      
  8. unsigned int alice = 42;
  9. alice:
  10. .word 42
  11.      
  12. .text
  13.  
  14.     .equ x, 123
  15.     mov $x, %eax
  16.     /* eax == 123 */
  17.  
  18.     .equ x, 456
  19.     mov $x, %eax
  20.     /* eax == 456 */
  21.      
  22. as --32 -o main.o main.S
  23. objdump -Sr main.o
  24.      
  25. 00000000 <.text>:
  26.   0:   b8 7b 00 00 00          mov    $0x7b,%eax
  27.   5:   b8 c8 01 00 00          mov    $0x1c8,%eax
  28.      
  29. readelf -s main.o
  30.      
  31. Num:    Value  Size Type    Bind   Vis      Ndx Name
  32.   4: 000001c8     0 NOTYPE  LOCAL  DEFAULT  ABS x
  33.      
  34. g_pfnVectors:
  35.   .word  _estack
  36.   .word  Reset_Handler
  37.   .word  NMI_Handler
  38.   .word  HardFault_Handler
  39.   .word  MemManage_Handler
  40.   ...
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top