Perfect FPS Framerate calculation

Game development specific discussions.
Post Reply
goldbaby777
Posts: 10
Joined: Jun 15, 2012 16:50
Contact:

Perfect FPS Framerate calculation

Post by goldbaby777 »

This code I obtained from this forum except for the code I created for perfect frame rates. What it does is calculate the number of clock cycles it takes to draw the screen of graphics, calculate that value with a pre-calculated number of clock cycles per second the cpu of the machine the program is running on, what Hz it is at, and then we find out the amount of 1 second times percentage divided by 100 to obtain the ms value in decimal fraction form it took to create the frame, and then we sleep (I suggest using sleep, everything else I tried as a form of delay in ms decimal fraction form sucks, so it is , say, 60 is a chosen frame rate, 1000 ms divided by our frame rate, 60, subtracted by our decimal fraction calculation of ms it took to create the frame, and we have a loop of near perfect frame rate, and believe me, this stuff is amazing at frame rates, because it is machine language orientated clock cycle code, and I found the Free Basic compiler can create code that runs just as fast as writing code for the FPU to calculate or SSE or whatever. I hope I wrote that properly.


Here is the code: (edited)

Code: Select all

#include once "windows.bi"
screenres 1024,768,32

dim shared as longint counter_cycles
dim shared as integer _process_priority_class_, _thread_priority_
dim shared as longint total_cycles
dim shared totalcycles as longint

dim shared as integer _loop_count_, _loop_counter_

#macro COUNTER_BEGIN( loop_count, process_priority, thread_priority )
_loop_count_ = loop_count
_process_priority_class_ = GetPriorityClass(GetCurrentProcess())
_thread_priority_ = GetThreadPriority(GetCurrentThread())
SetPriorityClass(GetCurrentProcess(), process_priority)
SetThreadPriority(GetCurrentThread(), thread_priority)
_loop_counter_ = _loop_count_
asm
xor eax, eax
cpuid
rdtsc
push edx
push eax
xor eax, eax
cpuid
.balign 16
0:
sub DWORD PTR _loop_counter_, 1
jnz 0b
xor eax, eax
cpuid
rdtsc
pop ecx
sub eax, ecx
pop ecx
sbb edx, ecx
push edx
push eax
xor eax, eax
cpuid
rdtsc
push edx
push eax
mov eax, _loop_count_
mov _loop_counter_, eax
xor eax, eax
cpuid
.balign 16
1:
end asm
#endmacro

#macro COUNTER_END()
asm
sub DWORD PTR _loop_counter_, 1
jnz 1b
xor eax, eax
cpuid
rdtsc
pop ecx
sub eax, ecx
pop ecx
sbb edx, ecx
pop ecx
sub eax, ecx
pop ecx
sbb edx, ecx
mov DWORD PTR [counter_cycles], eax
mov DWORD PTR [counter_cycles+4], edx
end asm
SetPriorityClass(GetCurrentProcess(),_process_priority_class_)
SetThreadPriority(GetCurrentThread(),_thread_priority_)
counter_cycles /= _loop_count_
#endmacro
dim fps as double
dim flag as byte
dim calc1 as double
dim key as string
dim lx as integer
dim ly as integer
fps=33
print"Calculating clock cycles per second on this machine............"
counter_begin(1,HIGH_PRIORITY_CLASS,2)
sleep (1000,1)
  counter_end()

  total_cycles=counter_cycles
print"Calculated: ";total_cycles;"Hz"
sleep (2000,1)

screenset 1,0
cls
screencopy
do
counter_begin(1,HIGH_PRIORITY_CLASS,2)

color rgb(int(rnd(1)*255)+1,int(rnd(1)*215)+1,0),rgb(int(rnd(1)*255)+1,int(rnd(1)*215)+1,0)
print".........Warning, this is not a test........"
lx=pos
ly=csrlin
color rgb(255,215,0),rgb(0,0,0)
locate 1,1:print"fps: ";int(fps);".......Let brotherly love continue......."
locate ly,lx

if fps<33 then flag=0
 if flag=0 then fps=fps+.333
 if flag=1 then fps=fps-.333
screencopy
key=inkey
if key=chr(27) then end
counter_end()
calc1=1000*(counter_cycles*100/total_cycles/100)
if (1000/fps-calc1)<0 then
flag=1
else
sleep (1000/fps-calc1,1)
end if
screencopy
loop

Enjoy!
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Perfect FPS Framerate calculation

Post by MrSwiss »

The problem here, is inherited from the used Assembly code (by MichaelW), because:
it doesn't run with FBC64, aka: FBC32 only!
You would have to implement both Assembly versions (and, some pre-processor
instructions) to make it usable, for both compilers! (Aka: less than perfect!)
C:\DEV-Tools\FreeBASIC\FB-DEV64\fbc -s console "FbTemp.bas"
FbTemp.asm: Assembler messages:
FbTemp.asm:120: Error: operand type mismatch for `push'
FbTemp.asm:123: Error: operand type mismatch for `push'
FbTemp.asm:153: Error: operand type mismatch for `pop'
FbTemp.asm:159: Error: operand type mismatch for `pop'
FbTemp.asm:165: Error: operand type mismatch for `push'
FbTemp.asm:168: Error: operand type mismatch for `push'
FbTemp.asm:180: Error: operand type mismatch for `push'
FbTemp.asm:183: Error: operand type mismatch for `push'
FbTemp.asm:186: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:189: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:224: Error: operand type mismatch for `pop'
FbTemp.asm:230: Error: operand type mismatch for `pop'
FbTemp.asm:236: Error: operand type mismatch for `pop'
FbTemp.asm:242: Error: operand type mismatch for `pop'
FbTemp.asm:356: Error: operand type mismatch for `push'
FbTemp.asm:359: Error: operand type mismatch for `push'
FbTemp.asm:389: Error: operand type mismatch for `pop'
FbTemp.asm:395: Error: operand type mismatch for `pop'
FbTemp.asm:401: Error: operand type mismatch for `push'
FbTemp.asm:404: Error: operand type mismatch for `push'
FbTemp.asm:416: Error: operand type mismatch for `push'
FbTemp.asm:419: Error: operand type mismatch for `push'
FbTemp.asm:422: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:425: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:643: Error: operand type mismatch for `pop'
FbTemp.asm:649: Error: operand type mismatch for `pop'
FbTemp.asm:655: Error: operand type mismatch for `pop'
FbTemp.asm:661: Error: operand type mismatch for `pop'
goldbaby777
Posts: 10
Joined: Jun 15, 2012 16:50
Contact:

Re: Perfect FPS Framerate calculation

Post by goldbaby777 »

I didn't clue in to it to send the 64 bit version because i wrote the 32 bit program in about within an hour and did not want to continue working on it and also i knew already they would find the clock cycle 64 bit macro code on the forum when you google it i was tired and just got back to checking the replies............... I sent this code because its exact frame rate (down to clock cycles used per frame) and saw the forum lacked an exact frame rate post and added it in a jiffy....... Here is the fastest conversion to 64 bit of the source code i can do from copy and paste and edit:




Also thought of something of a calculation of exact frame rate calculation down to the decimal point available......... let's see..... answer (possibly ) is fps*((1000/fps-calc1)*100/(1000/fps)/100) put that where it prints the frames per second with out the int() might give you whole number with decimal fraction exact frame rate or not, something like that :) i don't have 64 bit version of freebasic on my computer because i copied it over to 32bit and am working on a fmodex software Crazy Machine on sourceforge.net that won't work yet with the latest fmod library available until i sit down and convert it over (unless someone else reading this feels like posting such a thing)...... in the include file......... I gotta take a look at any function name changes in the new version of fmod before converting it over for example......

below is the new calculation for fps in 64 bit code:

Code: Select all

#include once "windows.bi"
screenres 1024,768,32

dim shared as longint counter_cycles
dim shared as integer _process_priority_class_, _thread_priority_
dim shared as longint total_cycles
dim shared totalcycles as longint

dim shared as integer _loop_count_, _loop_counter_

#macro COUNTER_BEGIN( loop_count, process_priority, thread_priority )
_loop_count_ = loop_count
_process_priority_class_ = GetPriorityClass(GetCurrentProcess())
_thread_priority_ = GetThreadPriority(GetCurrentThread())
SetPriorityClass(GetCurrentProcess(), process_priority)
SetThreadPriority(GetCurrentThread(), thread_priority)
_loop_counter_ = _loop_count_
asm
xor eax, eax
cpuid
rdtsc
push rdx
push rax
xor eax, eax
cpuid
.balign 16
0:
sub DWORD PTR _loop_counter_, 1
jnz 0b
xor eax, eax
cpuid
rdtsc
pop rcx
sub eax, ecx
pop rcx
sbb edx, ecx
push rdx
push rax
xor eax, eax
cpuid
rdtsc
push rdx
push rax
mov eax, _loop_count_
mov _loop_counter_, eax
xor eax, eax
cpuid
.balign 16
1:
end asm
#endmacro

#macro COUNTER_END()
asm
sub DWORD PTR _loop_counter_, 1
jnz 1b
xor eax, eax
cpuid
rdtsc
pop rcx
sub eax, ecx
pop rcx
sbb edx, ecx
pop rcx
sub eax, ecx
pop rcx
sbb edx, ecx
mov DWORD PTR [counter_cycles], eax
mov DWORD PTR [counter_cycles+4], edx
end asm
SetPriorityClass(GetCurrentProcess(),_process_priority_class_)
SetThreadPriority(GetCurrentThread(),_thread_priority_)
counter_cycles /= _loop_count_
#endmacro
dim fps as double
dim flag as byte
dim calc1 as double
dim key as string
dim lx as integer
dim ly as integer
fps=33
print"Calculating clock cycles per second on this machine............"
counter_begin(1,HIGH_PRIORITY_CLASS,2)
sleep (1000,1)
  counter_end()

  total_cycles=counter_cycles
print"Calculated: ";total_cycles;"Hz"
sleep (2000,1)

screenset 1,0
cls
screencopy
do
counter_begin(1,HIGH_PRIORITY_CLASS,2)

color rgb(int(rnd(1)*255)+1,int(rnd(1)*215)+1,0),rgb(int(rnd(1)*255)+1,int(rnd(1)*215)+1,0)
print".........Don't forsake love, love is your momma from above........"
lx=pos
ly=csrlin
color rgb(255,215,0),rgb(0,0,0)
locate 1,1:print"fps: ";fps*((1000/fps-calc1)*100/(1000/fps)/100);".......Let brotherly love continue......."
locate ly,lx

if fps<33 then flag=0
 if flag=0 then fps=fps+.333
 if flag=1 then fps=fps-.333
screencopy
key=inkey
if key=chr(27) then end
counter_end()
calc1=1000*(counter_cycles*100/total_cycles/100)
if (1000/fps-calc1)<0 then
flag=1
else
sleep (1000/fps-calc1,1)
end if
screencopy
loop
and 32 bit code version......

Code: Select all

#include once "windows.bi"
screenres 1024,768,32

dim shared as longint counter_cycles
dim shared as integer _process_priority_class_, _thread_priority_
dim shared as longint total_cycles
dim shared totalcycles as longint

dim shared as integer _loop_count_, _loop_counter_

#macro COUNTER_BEGIN( loop_count, process_priority, thread_priority )
_loop_count_ = loop_count
_process_priority_class_ = GetPriorityClass(GetCurrentProcess())
_thread_priority_ = GetThreadPriority(GetCurrentThread())
SetPriorityClass(GetCurrentProcess(), process_priority)
SetThreadPriority(GetCurrentThread(), thread_priority)
_loop_counter_ = _loop_count_
asm
xor eax, eax
cpuid
rdtsc
push edx
push eax
xor eax, eax
cpuid
.balign 16
0:
sub DWORD PTR _loop_counter_, 1
jnz 0b
xor eax, eax
cpuid
rdtsc
pop ecx
sub eax, ecx
pop ecx
sbb edx, ecx
push edx
push eax
xor eax, eax
cpuid
rdtsc
push edx
push eax
mov eax, _loop_count_
mov _loop_counter_, eax
xor eax, eax
cpuid
.balign 16
1:
end asm
#endmacro

#macro COUNTER_END()
asm
sub DWORD PTR _loop_counter_, 1
jnz 1b
xor eax, eax
cpuid
rdtsc
pop ecx
sub eax, ecx
pop ecx
sbb edx, ecx
pop ecx
sub eax, ecx
pop ecx
sbb edx, ecx
mov DWORD PTR [counter_cycles], eax
mov DWORD PTR [counter_cycles+4], edx
end asm
SetPriorityClass(GetCurrentProcess(),_process_priority_class_)
SetThreadPriority(GetCurrentThread(),_thread_priority_)
counter_cycles /= _loop_count_
#endmacro
dim fps as double
dim flag as byte
dim calc1 as double
dim key as string
dim lx as integer
dim ly as integer
fps=33
print"Calculating clock cycles per second on this machine............"
counter_begin(1,HIGH_PRIORITY_CLASS,2)
sleep (1000,1)
  counter_end()

  total_cycles=counter_cycles
print"Calculated: ";total_cycles;"Hz"
sleep (2000,1)

screenset 1,0
cls
screencopy
do
counter_begin(1,HIGH_PRIORITY_CLASS,2)

color rgb(int(rnd(1)*255)+1,int(rnd(1)*215)+1,0),rgb(int(rnd(1)*255)+1,int(rnd(1)*215)+1,0)
print".........Don't forsake love, love is your momma from above........"
lx=pos
ly=csrlin
color rgb(255,215,0),rgb(0,0,0)
locate 1,1:print"fps: ";fps*((1000/fps-calc1)*100/(1000/fps)/100);".......Let brotherly love continue......."
locate ly,lx

if fps<33 then flag=0
 if flag=0 then fps=fps+.333
 if flag=1 then fps=fps-.333
screencopy
key=inkey
if key=chr(27) then end
counter_end()
calc1=1000*(counter_cycles*100/total_cycles/100)
if (1000/fps-calc1)<0 then
flag=1
else
sleep (1000/fps-calc1,1)
end if
screencopy
loop
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Perfect FPS Framerate calculation

Post by MrSwiss »

You are still using 32 bit assembly, which won't work with FBC 64.
C:\FreeBASIC\FB1050\64bit\fbc -s console "FbTemp.bas"
FbTemp.asm: Assembler messages:
FbTemp.asm:191: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:194: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:429: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:432: Error: incorrect register `eax' used with `q' suffix
goldbaby777
Posts: 10
Joined: Jun 15, 2012 16:50
Contact:

Re: Perfect FPS Framerate calculation

Post by goldbaby777 »

My regards to MichaelW code he had to debug of assembly language, and many other people on this forum are extremely talented at programming and deserve a clap of the hands and who ever is a computer programmer is a problem solving type of person, so let's be at peace and love and joy from me to you in about a month it is Christmas you were right, i should have posted the 64 bit as well, in fact all i had to do was change the 32 bit push and pop instructions from i.e. eax to rax.......... unless there was something i overlooked, the source code for 64 bit fps clock cycle calculations should be compiling i dont have freebasic 64 as a mentioned above............. cheers!
goldbaby777
Posts: 10
Joined: Jun 15, 2012 16:50
Contact:

Re: Perfect FPS Framerate calculation

Post by goldbaby777 »

It's the same with the original 64 bit code will not work either.......... perhaps there has been a version change in the 64 bit compiler, because i remember compiling in 64 bit freebasic that clock cycle code before, i just do not know why it won't work now........ btw the error messages were the same as the original code from MichaelW for 64 bit.........

MrSwiss wrote:You are still using 32 bit assembly, which won't work with FBC 64.
C:\FreeBASIC\FB1050\64bit\fbc -s console "FbTemp.bas"
FbTemp.asm: Assembler messages:
FbTemp.asm:191: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:194: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:429: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:432: Error: incorrect register `eax' used with `q' suffix
goldbaby777
Posts: 10
Joined: Jun 15, 2012 16:50
Contact:

Re: Perfect FPS Framerate calculation

Post by goldbaby777 »

MrSwiss wrote:You are still using 32 bit assembly, which won't work with FBC 64.
C:\FreeBASIC\FB1050\64bit\fbc -s console "FbTemp.bas"
FbTemp.asm: Assembler messages:
FbTemp.asm:191: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:194: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:429: Error: incorrect register `eax' used with `q' suffix
FbTemp.asm:432: Error: incorrect register `eax' used with `q' suffix

64 BIT FIXED GOT AROUND TO DOING IT

Code: Select all

#include once "windows.bi"
screenres 1024,768,32

dim shared as longint counter_cycles
dim shared as integer _process_priority_class_, _thread_priority_
dim shared as longint total_cycles
dim shared totalcycles as longint

dim shared as integer _loop_count_, _loop_counter_

#macro COUNTER_BEGIN( loop_count, process_priority, thread_priority )
_loop_count_ = loop_count
_process_priority_class_ = GetPriorityClass(GetCurrentProcess())
_thread_priority_ = GetThreadPriority(GetCurrentThread())
SetPriorityClass(GetCurrentProcess(), process_priority)
SetThreadPriority(GetCurrentThread(), thread_priority)
_loop_counter_ = _loop_count_
asm
xor rax, rax
cpuid
rdtsc
push rdx
push rax
xor rax, rax
cpuid
.balign 16
0:
sub qWORD PTR _loop_counter_, 1
jnz 0b
xor rax, rax
cpuid
rdtsc
pop rcx
sub rax, rcx
pop rcx
sbb rdx, rcx
push rdx
push rax
xor rax, rax
cpuid
rdtsc
push rdx
push rax
mov rax, _loop_count_
mov _loop_counter_, rax
xor rax, rax
cpuid
.balign 16
1:
end asm
#endmacro

#macro COUNTER_END()
asm
sub qWORD PTR _loop_counter_, 1
jnz 1b
xor rax, rax
cpuid
rdtsc
pop rcx
sub rax, rcx
pop rcx
sbb rdx, rcx
pop rcx
sub rax, rcx
pop rcx
sbb rdx, rcx
mov qWORD PTR [counter_cycles], rax
mov qWORD PTR [counter_cycles+4], rdx
end asm
SetPriorityClass(GetCurrentProcess(),_process_priority_class_)
SetThreadPriority(GetCurrentThread(),_thread_priority_)
counter_cycles /= _loop_count_
#endmacro
dim fps as double
dim flag as byte
dim calc1 as double
dim key as string
dim lx as integer
dim ly as integer
fps=33
print"Calculating clock cycles per second on this machine............"
counter_begin(1,HIGH_PRIORITY_CLASS,2)
sleep (1000,1)
  counter_end()

  total_cycles=counter_cycles
print"Calculated: ";total_cycles;"Hz"
sleep (2000,1)

screenset 1,0
cls
screencopy
do
counter_begin(1,HIGH_PRIORITY_CLASS,2)

color rgb(int(rnd(1)*255)+1,int(rnd(1)*215)+1,0),rgb(int(rnd(1)*255)+1,int(rnd(1)*215)+1,0)
print".........Don't forsake love, love is your momma from above........"
lx=pos
ly=csrlin
color rgb(255,215,0),rgb(0,0,0)
locate 1,1:print"fps: ";fps*((1000/fps-calc1)*100/(1000/fps)/100);".......Let brotherly love continue......."
locate 2,1:print"clock cycles per frame:";counter_cycles;"/";total_cycles;"    "
locate 3,1:print"Press ESC to exit"
locate ly,lx

if fps<33 then flag=0
 if flag=0 then fps=fps+.333
 if flag=1 then fps=fps-.333
screencopy
key=inkey
if key=chr(27) then end
counter_end()
calc1=1000*(counter_cycles*100/total_cycles/100)
if (1000/fps-calc1)<0 then
flag=1
else
sleep (1000/fps-calc1,1)
end if
screencopy
loop

leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Perfect FPS Framerate calculation

Post by leopardpm »

hmmm...not working here,but my setup is probably wrong in some fashion...

Code: Select all

Command executed:
"C:\Program Files (x86)\FreeBASIC\fbc.exe" "C:\FreeBasic2\FBIDETEMP.bas"

Compiler output:
C:\FreeBasic2\FBIDETEMP.asm: Assembler messages:
C:\FreeBasic2\FBIDETEMP.asm:69: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:74: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:78: Error: invalid instruction suffix for `sub'
C:\FreeBasic2\FBIDETEMP.asm:80: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:84: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:86: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:89: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:94: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:95: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:96: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:103: Error: invalid instruction suffix for `sub'
C:\FreeBasic2\FBIDETEMP.asm:105: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:109: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:111: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:113: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:115: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:116: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:117: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:186: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:191: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:195: Error: invalid instruction suffix for `sub'
C:\FreeBasic2\FBIDETEMP.asm:197: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:201: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:203: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:206: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:211: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:212: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:213: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:458: Error: invalid instruction suffix for `sub'
C:\FreeBasic2\FBIDETEMP.asm:460: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:464: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:466: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:468: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:470: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:471: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:472: Error: too many memory references for `mov'

Results:
Compilation failed

System:
FBIde: 0.4.6
fbc:   FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win32 (32bit)
OS:    Windows NT 6.2 (build 9200)
goldbaby777
Posts: 10
Joined: Jun 15, 2012 16:50
Contact:

Re: Perfect FPS Framerate calculation

Post by goldbaby777 »

you are trying to compile a 64 bit program as a 32 bit program probably......... download freebasic 64 bit fbc.exe and use that it will compile..... (should anyways)


leopardpm wrote:hmmm...not working here,but my setup is probably wrong in some fashion...

Code: Select all

Command executed:
"C:\Program Files (x86)\FreeBASIC\fbc.exe" "C:\FreeBasic2\FBIDETEMP.bas"

Compiler output:
C:\FreeBasic2\FBIDETEMP.asm: Assembler messages:
C:\FreeBasic2\FBIDETEMP.asm:69: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:74: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:78: Error: invalid instruction suffix for `sub'
C:\FreeBasic2\FBIDETEMP.asm:80: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:84: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:86: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:89: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:94: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:95: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:96: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:103: Error: invalid instruction suffix for `sub'
C:\FreeBasic2\FBIDETEMP.asm:105: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:109: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:111: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:113: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:115: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:116: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:117: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:186: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:191: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:195: Error: invalid instruction suffix for `sub'
C:\FreeBasic2\FBIDETEMP.asm:197: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:201: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:203: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:206: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:211: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:212: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:213: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:458: Error: invalid instruction suffix for `sub'
C:\FreeBasic2\FBIDETEMP.asm:460: Error: too many memory references for `xor'
C:\FreeBasic2\FBIDETEMP.asm:464: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:466: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:468: Error: too many memory references for `sub'
C:\FreeBasic2\FBIDETEMP.asm:470: Error: too many memory references for `sbb'
C:\FreeBasic2\FBIDETEMP.asm:471: Error: too many memory references for `mov'
C:\FreeBasic2\FBIDETEMP.asm:472: Error: too many memory references for `mov'

Results:
Compilation failed

System:
FBIde: 0.4.6
fbc:   FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win32 (32bit)
OS:    Windows NT 6.2 (build 9200)
Post Reply