Multiplatform coroutines in C and also in FreeBasic

General discussion for topics related to the FreeBASIC project or its community.
marcov
Posts: 3404
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Multiplatform coroutines in C and also in FreeBasic

Post by marcov »

exagonx wrote: Dec 02, 2022 0:13 For the rest, when I refer to a 16-bit executable it means that the interpreter executes it in 16-bit real mode, the fact that it then loads 32-bit data into memory in protected mode this in fact does not make it a 32-bit NT executable or Linux
But it doesn't make it an all 16-it process either.

Note that most Windows (win32, NT binaries are rare) binaries still have a 16-bit mode stub to printout "this program requires microsoft windows to run" or something like that. Doesn't make all win32 applications 16-bits msdos EXEs.
exagonx
Posts: 283
Joined: Mar 20, 2009 17:03
Location: Italy
Contact:

Re: Multiplatform coroutines in C and also in FreeBasic

Post by exagonx »

marcov wrote: Dec 02, 2022 15:04
exagonx wrote: Dec 02, 2022 0:13 For the rest, when I refer to a 16-bit executable it means that the interpreter executes it in 16-bit real mode, the fact that it then loads 32-bit data into memory in protected mode this in fact does not make it a 32-bit NT executable or Linux
But it doesn't make it an all 16-it process either.

Note that most Windows (win32, NT binaries are rare) binaries still have a 16-bit mode stub to printout "this program requires microsoft windows to run" or something like that. Doesn't make all win32 applications 16-bits msdos EXEs.
You are right I hadn't thought it could just be pre-execution code
Roland Chastain
Posts: 976
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Multiplatform coroutines in C and also in FreeBasic

Post by Roland Chastain »

Very interesting! Thank you angros47. (Thanks also to Tourist Trap for the command line tip.)

Here, on Linux 64, it works well too. (I used the first link.)

Code: Select all

[roland@localhost libco (master)]$ gcc -c libco.c
[roland@localhost libco (master)]$ fbc libco.o ex1.bas
/usr/bin/../bin/ld : avertissement : /usr/bin/../lib/freebasic/linux-x86_64/fbextra.x contient des sections de sortie; avez-vous oublié -T?
[roland@localhost libco (master)]$ ./ex1
this is main
this is the thread, iteration  1
this is main
this is the thread, iteration  2
...
Post Reply