07-07-2006, 12:50 PM
haha yeah, if you compile a program with -r, you can see the asm output.
FB code:
Outputted ASM:
FB code:
Code:
Print "Hello world! I can count to 10, watch!"
Print
For a = 1 To 10
Print a
Next
Print
Print "See? I'm a genius!"
Outputted ASM:
Code:
.intel_syntax noprefix
#fbdemo.bas' compilation started at 02:47:25 (FreeBASIC v0.17b)
.section .text
.balign 16
.globl _main
_main:
push ebp
mov ebp, esp
and esp, 0xFFFFFFF0
sub esp, 8
mov dword ptr [ebp-4], 0
mov dword ptr [ebp-8], 0
call ___main
push dword ptr [ebp+12]
push dword ptr [ebp+8]
call _fb_Init@8
.Lt_0001:
push 1
push 38
push offset _Lt_0003
call _fb_StrAllocTempDescZEx@8
push eax
push 0
call _fb_PrintString@12
push 1
push 0
call _fb_PrintVoid@8
mov dword ptr [ebp-8], 1
.Lt_0007:
push 1
push dword ptr [ebp-8]
push 0
call _fb_PrintInt@12
.Lt_0005:
inc dword ptr [ebp-8]
.Lt_0004:
cmp dword ptr [ebp-8], 10
jle .Lt_0007
.Lt_0006:
push 1
push 0
call _fb_PrintVoid@8
push 1
push 18
push offset _Lt_0008
call _fb_StrAllocTempDescZEx@8
push eax
push 0
call _fb_PrintString@12
.Lt_0002:
push 0
call _fb_End@4
mov eax, dword ptr [ebp-4]
mov esp, ebp
pop ebp
ret
#fbdemo.bas' compilation took 1.906669568469965e-003 secs
.section .data
.balign 4
_Lt_0003: .ascii "Hello world! I can count to 10, watch!\0"
.balign 4
_Lt_0008: .ascii "See? I'm a genius!\0"