sm64

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

pascal.p (1365B)


      1 { COMPILE-FLAGS: -O2 }
      2 
      3 function foo(x: integer): integer;
      4 begin
      5     foo := x * 3
      6 end;
      7 
      8 GLOBAL_ASM(
      9 .section .data
     10 .word 0x2323
     11 
     12 .late_rodata
     13 .word 0x123123
     14 .word 0x456456
     15 .word 0x789789
     16 .text
     17 glabel test
     18 /* 000090 00400090 27BDFFF8 */  addiu $sp, $sp, -24
     19 /* 000094 00400094 18A00009 */  blez  $a1, .L004000BC
     20 /* 000098 00400098 AFA00004 */   sw    $zero, 4($sp)
     21 .L0040009C:
     22 /* 00009C 0040009C 8FAE0004 */  lw    $t6, 4($sp)
     23 /* 0000A0 004000A0 008E7821 */  addu  $t7, $a0, $t6
     24 /* 0000A4 004000A4 A1E00000 */  sb    $zero, ($t7)
     25 /* 0000A8 004000A8 8FB80004 */  lw    $t8, 4($sp)
     26 /* 0000AC 004000AC 27190001 */  addiu $t9, $t8, 1
     27 /* 0000B0 004000B0 0325082A */  slt   $at, $t9, $a1
     28 /* 0000B4 004000B4 1420FFF9 */  bnez  $at, .L0040009C
     29 /* 0000B8 004000B8 AFB90004 */   sw    $t9, 4($sp)
     30 .L004000BC:
     31 /* 0000BC 004000BC 10000001 */  b     .L004000C4
     32 /* 0000C0 004000C0 00000000 */   nop
     33 .L004000C4:
     34 /* 0000C4 004000C4 03E00008 */  jr    $ra
     35 /* 0000C8 004000C8 27BD0008 */   addiu $sp, $sp, 24
     36 )
     37 
     38 GLOBAL_ASM(
     39 .section .data
     40 .word 0x3434
     41 
     42 .late_rodata
     43 .word 0x1
     44 .double 1.1
     45 .word 0x2, 0x3
     46 .text
     47 glabel test2
     48 nop
     49 nop
     50 nop
     51 nop
     52 nop
     53 nop
     54 nop
     55 nop
     56 nop
     57 nop
     58 nop
     59 nop
     60 nop
     61 nop
     62 nop
     63 nop
     64 nop
     65 )
     66 
     67 GLOBAL_ASM(
     68 .late_rodata
     69 .double 2.1
     70 .text
     71 glabel test3
     72 nop
     73 nop
     74 nop
     75 nop
     76 nop
     77 nop
     78 nop
     79 nop
     80 nop
     81 nop
     82 nop
     83 nop
     84 nop
     85 nop
     86 nop
     87 nop
     88 nop
     89 )
     90 
     91 function bar(x: integer): integer;
     92 begin
     93     return x * 3
     94 end;
     95