Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Language?
#3
haha yeah, if you compile a program with -r, you can see the asm output.

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"
Reply


Messages In This Thread
New Language? - by zwillis091 - 07-07-2006, 11:19 AM
New Language? - by voodooattack - 07-07-2006, 12:18 PM
New Language? - by Anonymous - 07-07-2006, 12:50 PM
New Language? - by na_th_an - 07-07-2006, 02:36 PM
New Language? - by Deleter - 07-07-2006, 03:25 PM
New Language? - by na_th_an - 07-07-2006, 04:15 PM
New Language? - by TheAdventMaster - 07-07-2006, 07:28 PM
New Language? - by Anonymous - 07-07-2006, 11:56 PM
New Language? - by Zap - 07-08-2006, 12:43 AM
New Language? - by Dr_Davenstein - 07-28-2006, 11:31 AM
New Language? - by torstum - 07-30-2006, 11:00 PM
New Language? - by Skyler - 08-14-2006, 06:48 AM
New Language? - by thegrogen - 08-20-2006, 08:47 AM
New Language? - by Blitz - 12-05-2006, 08:32 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)