Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 28th, 2013  |  syntax: ASM (NASM)  |  size: 0.54 KB  |  views: 152  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #ifdef __STDC__
  2. # define __CONCAT(x,y)  x ## y
  3. # define __STRING(x)    #x
  4. #else
  5. # define __CONCAT(x,y)  x/**/y
  6. # define __STRING(x)    "x"
  7. #endif
  8.  
  9. #define SET_CPUVAR(off,reg) \
  10.          mvhi    r25, hi(_C_LABEL(cpu_info_store)) ; \
  11.          ori     r25, r25, lo(_C_LABEL(cpu_info_store)) ; \
  12.          lw      reg, (r25+__CONCAT(CPU_INFO_,off))
  13.  
  14. or
  15.  
  16. .macro set_cpuvar off, reg
  17.         mvhi    r25, hi(_C_LABEL(cpu_info_store))
  18.         ori     r25, r25, lo(_C_LABEL(cpu_info_store))
  19.         lw      \reg, (r25+__CONCAT(CPU_INFO_,\off))
  20. .endm
clone this paste RAW Paste Data