Commits

Paweł Wieczorek committed d410cba

adde call.while

  • Participants
  • Parent commits 5d5cae7
  • Branches very_simple_while_compiler

Comments (0)

Files changed (1)

File samples/WHILE/006_call.while

+# Compiled by Opifex, devel-version, built at Tue Aug 27 01:01:21 CEST 2013 
+
+.global WHILE_fibaux 
+.global WHILE_main 
+.global WHILE_fib 
+
+.section .text 
+
+WHILE_fibaux : 
+    pushl %ebp 
+    movl %esp , %ebp 
+    movl WHILE_VAR_n , %eax 
+    pushl %eax 
+    movl $0 , %eax 
+    pushl %eax 
+    popl %eax 
+    popl %ebx 
+    cmp %eax , %ebx 
+    jne _L0004_if_else 
+    movl WHILE_VAR_fibaux1 , %eax 
+    movl %eax , WHILE_VAR_result 
+    movl $0 , %eax 
+    movl %eax , %eax 
+    jmp _L0000_frame_leave 
+    jmp _L0003_if_after 
+_L0004_if_else : 
+_L0003_if_after : 
+    movl WHILE_VAR_n , %eax 
+    pushl %eax 
+    movl $1 , %eax 
+    pushl %eax 
+    popl %eax 
+    popl %ebx 
+    cmp %eax , %ebx 
+    jne _L0002_if_else 
+    movl WHILE_VAR_fibaux2 , %eax 
+    movl %eax , WHILE_VAR_result 
+    movl $0 , %eax 
+    movl %eax , %eax 
+    jmp _L0000_frame_leave 
+    jmp _L0001_if_after 
+_L0002_if_else : 
+_L0001_if_after : 
+    movl WHILE_VAR_fibaux1 , %eax 
+    movl %eax , WHILE_VAR_tmp 
+    movl WHILE_VAR_fibaux1 , %eax 
+    pushl %eax 
+    movl WHILE_VAR_fibaux2 , %eax 
+    pushl %eax 
+    popl %eax 
+    popl %ebx 
+    addl %eax , %ebx 
+    movl %ebx , WHILE_VAR_fibaux1 
+    movl WHILE_VAR_tmp , %eax 
+    movl %eax , WHILE_VAR_fibaux2 
+    movl WHILE_VAR_n , %eax 
+    pushl %eax 
+    movl $1 , %eax 
+    pushl %eax 
+    popl %eax 
+    popl %ebx 
+    subl %eax , %ebx 
+    movl %ebx , WHILE_VAR_n 
+    call WHILE_fibaux 
+    addl $0 , %esp 
+_L0000_frame_leave : 
+    movl %ebp , %esp 
+    popl %ebp 
+    ret 
+
+WHILE_fib : 
+    pushl %ebp 
+    movl %esp , %ebp 
+    movl $1 , %eax 
+    movl %eax , WHILE_VAR_fibaux1 
+    movl $0 , %eax 
+    movl %eax , WHILE_VAR_fibaux2 
+    call WHILE_fibaux 
+    addl $0 , %esp 
+_L0005_frame_leave : 
+    movl %ebp , %esp 
+    popl %ebp 
+    ret 
+
+WHILE_main : 
+    pushl %ebp 
+    movl %esp , %ebp 
+    call PROSTAK_readint 
+    movl %eax , WHILE_VAR_n 
+    call WHILE_fib 
+    addl $0 , %esp 
+    pushl WHILE_VAR_fibaux1 
+    call PROSTAK_writeint 
+    addl $4 , %esp 
+_L0006_frame_leave : 
+    movl %ebp , %esp 
+    popl %ebp 
+    ret 
+
+.section .data 
+
+WHILE_VAR_result : 
+    .int 0 
+
+WHILE_VAR_fibaux2 : 
+    .int 0 
+
+WHILE_VAR_n : 
+    .int 0 
+
+WHILE_VAR_fibaux1 : 
+    .int 0 
+
+WHILE_VAR_tmp : 
+    .int 0 
+
+