Search found 1896 matches

by srvaldez
Jun 04, 2019 23:11
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated March 25, 2019)
Replies: 516
Views: 57607

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated March 25, 2019)

hello deltarho[1859] I built fb with gcc-9.1 and it works ok when used within the gcc-toolchain, but the standalone version gives undefined symbols, I hacked the 32-bit standalone version by replacing init.o in libfb.a with the same object from the latest build by StW and also using StW's libmingw32...
by srvaldez
Jun 02, 2019 20:32
Forum: General
Topic: x64 Win asm naked function return value?
Replies: 13
Views: 362

Re: x64 Win asm naked function return value?

I had a test case where it was crashing without copying rcx to rax , but now I can't replicate the problem, if I find out, I will let you know.
by srvaldez
Jun 02, 2019 11:06
Forum: General
Topic: x64 Win asm naked function return value?
Replies: 13
Views: 362

Re: x64 Win asm naked function return value?

@SARG
I found that for naked functions one must copy rcx to rax before ret, I edited my posts above.
by srvaldez
May 29, 2019 18:58
Forum: General
Topic: timing sub vs function
Replies: 2
Views: 118

Re: timing sub vs function

thanks fxm, your version makes the times about equal, perhaps a better example would be a function/sub that modifies the values passed
by srvaldez
May 29, 2019 17:47
Forum: General
Topic: timing sub vs function
Replies: 2
Views: 118

timing sub vs function

for Windows x64 here's a vey simple test that shows that sub is faster than function compile command: FreeBASIC-1.06.0-win64\fbc -O 2 -asm intel -w all -v foobar.bas foobar.bas type bar as double d as long l as longint ld as zstring*19 sz end type function foo naked () as bar asm fldpi fstp qword pt...
by srvaldez
May 28, 2019 14:17
Forum: General
Topic: x64 Win asm naked function return value?
Replies: 13
Views: 362

Re: x64 Win asm naked function return value?

yes, I kind of thought so. :-) [dit] resolved the problem on macOS, I was doing "movl 123, %eax" when it should be "movl $123, %eax" also FB has the offsetof function to get the offset of the different members of a type, but I was looking for way to retrieve that information in asm
by srvaldez
May 28, 2019 14:05
Forum: General
Topic: x64 Win asm naked function return value?
Replies: 13
Views: 362

Re: x64 Win asm naked function return value?

hello SARG
is there a way to know the offset of the elements of a structure as in the foo-bar example?
I am having no luck in macOS, except for the first element.
by srvaldez
May 28, 2019 0:27
Forum: General
Topic: x64 Win asm naked function return value?
Replies: 13
Views: 362

Re: x64 Win asm naked function return value?

yes, I corrected my post.
by srvaldez
May 28, 2019 0:06
Forum: General
Topic: x64 Win asm naked function return value?
Replies: 13
Views: 362

Re: x64 Win asm naked function return value?

thanks SARG :-)
mov rax,.L0+8 'only copies 8 characters
mov qword ptr [rcx+32],rax 'copies the remaining characters of the string
by srvaldez
May 27, 2019 23:26
Forum: General
Topic: x64 Win asm naked function return value?
Replies: 13
Views: 362

Re: x64 Win asm naked function return value?

thank you SARG I will study your information later, right now I have a bad headache, would it be safe to say that assigning a value to this hidden variable would be equivalent to the statement Function = value ? here's another silly example type bar as double d as long l as longint ld as zstring*19 ...
by srvaldez
May 27, 2019 20:02
Forum: General
Topic: x64 Win asm naked function return value?
Replies: 13
Views: 362

Re: x64 Win asm naked function return value?

found out that the right register for the return address is rcx, also when using att syntax with -O 2 the program crashes but is OK with -O 0, but there have been problems before when using inline asm and optimization. rcx does indeed hold the address of the temporary variable, but one must copy rc...
by srvaldez
May 27, 2019 17:03
Forum: General
Topic: x64 Win asm naked function return value?
Replies: 13
Views: 362

x64 Win asm naked function return value?

I was experimenting with x64 asm, the complex addition can be implemented as a naked sub like the following type double_complex re as double im as double end type sub cadd naked cdecl(byref result as double_complex, byref x as double_complex, byref y as double_complex) asm movsd xmm0, QWORD PTR [rdx...
by srvaldez
May 26, 2019 16:12
Forum: Projects
Topic: Gas64 (no more use of gcc, only gas) :-)
Replies: 56
Views: 4097

Re: Gas64 (no more use of gcc, only gas) :-)

hello SARG :-) the following code fails to compile, however if you comment-out either sub cadd or sub csub then it compiles and runs OK type double_complex re as double im as double end type sub cadd naked cdecl(byref result as double_complex, byref x as double_complex, byref y as double_complex) as...
by srvaldez
May 23, 2019 20:57
Forum: General
Topic: Memory access ? (Solved on 64 bit distro)
Replies: 11
Views: 387

Re: Memory access ?

try using redim instead of dim
by srvaldez
May 23, 2019 20:50
Forum: General
Topic: Len() can't be 'overloaded'
Replies: 14
Views: 454

Re: Len() can't be 'overloaded'

@MrSwiss, what's the expected output?
I have a 3 year old version of FB and it compiles your code with no problem

Code: Select all

s ULI
46            test, test, blah, blah, blaaaaaaaaahhhhhhhhhh!

s ULI
35            not so funny: can't overload Len()!

Go to advanced search