sm64

A Super Mario 64 decompilation
Log | Files | Refs | README | LICENSE

static-global.c (543B)


      1 // COMPILE-FLAGS: -O2
      2 // ASMP-FLAGS: --convert-statics=global
      3 static int xtext(int a, int b, int c);
      4 const int rodata1[] = {1};
      5 static const int rodata2[] = {2};
      6 int data1[] = {3};
      7 static int data2[] = {4};
      8 int bss1;
      9 static int bss2;
     10 
     11 GLOBAL_ASM(
     12 glabel bar
     13 lui $a0, %hi(rodata2)
     14 lw $a0, %lo(rodata2)($a0)
     15 lui $a1, %hi(data2)
     16 lw $a1, %lo(data2)($a0)
     17 lui $a2, %hi(bss2)
     18 lw $a2, %lo(bss2)($a0)
     19 jal xtext
     20 nop
     21 jr $ra
     22 nop
     23 nop
     24 nop
     25 )
     26 
     27 static int xtext(int a, int b, int c) {
     28     return 1;
     29 }
     30 
     31 void baz(void) {
     32     xtext(bss2, rodata2[0], data2[0]);
     33 }