Wiki improvements
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Wiki improvements
@fxm may be you could write a short note at KeyPgDdfbargv about:
End main( __FB_ARGC__, __FB_ARGV__ )
Calling END will never call any active destructure or make a reference to the description of the END command under the list
See also:
End main( __FB_ARGC__, __FB_ARGV__ )
Calling END will never call any active destructure or make a reference to the description of the END command under the list
See also:
- __FB_ARGC__
- Command
- End <-- add this
Re: Wiki improvements
Why not rightly simplify the code of the example:
(moreover, this use of END or SYSTEM to terminate a program is discouraged for FB)
[edit]
Done:
KeyPgDdfbargv → fxm [simplified example]
(moreover, this use of END or SYSTEM to terminate a program is discouraged for FB)
Code: Select all
Sub displayCommandLineArguments( ByVal argc As Integer, ByVal argv As ZString Ptr Ptr )
Dim i As Integer
For i = 0 To argc - 1
Print "arg "; i; " = '"; *argv[i]; "'"
Next i
End Sub
displayCommandLineArguments( __FB_ARGC__, __FB_ARGV__ )
Sleep
[edit]
Done:
KeyPgDdfbargv → fxm [simplified example]
Last edited by fxm on Jul 06, 2022 5:37, edited 1 time in total.
Reason: Update.
Reason: Update.
-
- Posts: 606
- Joined: Nov 28, 2012 1:27
- Location: CA, USA moving to WA, USA
- Contact:
Re: Wiki improvements
Perhaps a good change might be:zero terminated command line arguments passed in on the command line
zero terminated command line and arguments passed in on the command line
david
Re: Wiki improvements
The corresponding sentence has already recently been amended as follows (proposed by @SARG):
see __FB_ARGV__.Substituted with a pointer to a list of pointers to the zero terminated command line arguments passed in on the command line including the name of the executable.
Re: Wiki improvements
In the ASC page there is a small problem with the texts related to unicode example.
'will produce the output:' is before the code and the ouput is at the bottom of the page (after platform differences, etc).
'will produce the output:' is before the code and the ouput is at the bottom of the page (after platform differences, etc).
Re: Wiki improvements
Known formatting problem, only for the manual.chm (wiki is OK), but no solution found yet.
I can't do new tests now because the daily builds for the manual.chm are broken.
Same problem for INSTR, INSTRREV, LEFT, MID (Function), RIGHT, WCHR and WSTRING pages.
I can't do new tests now because the daily builds for the manual.chm are broken.
Same problem for INSTR, INSTRREV, LEFT, MID (Function), RIGHT, WCHR and WSTRING pages.
Re: Wiki improvements
In executables pages https://www.freebasic.net/wiki/ProPgExecutables
a64 can be removed/replaced by asm as -gen gas64 generates, now, files with the normal extension for assembler.
a64 can be removed/replaced by asm as -gen gas64 generates, now, files with the normal extension for assembler.
Re: Wiki improvements
Can you be more specific for me to properly update this documentation page: gas64 change date or since which fbc version?
This information, in the documentation page, is taken from:
This information, in the documentation page, is taken from:
coderJeff wrote: ↑Jan 30, 2021 14:56 Compile process for an executable
When fbc compiles basic source code, it translates the source in to another format that can be used by other tools that eventually create an executable. By default, fbc will use these other tools automatically.
To see all the steps that fbc uses, specify '-v' on the command line to see the steps.
For example, on win32:Tools:Code: Select all
$ fbc a.bas -v FreeBASIC Compiler - Version 1.08.0 (2021-01-24), built for win32 (32bit) Copyright (C) 2004-2021 The FreeBASIC development team. standalone target: win32, 486, 32bit backend: gas compiling: a.bas -o a.asm (main module) assembling: D:\fb.git\bin\win32\as.exe --32 --strip-local-absolute "a.asm" -o "a.o" linking: D:\fb.git\bin\win32\ld.exe -m i386pe -o "a.exe" -subsystem console "D:\fb.git\lib\win32\fbextra.x" --stack 1048576,1048576 -s -L "D:\fb.git\lib\win32" -L "." "D:\fb.git\lib\win32\crt2.o" "D:\fb.git\lib\win32\crtbegin.o" "D:\fb.git\lib\win32\fbrt0.o" "a.o" "-(" -lfb -lgcc -lmsvcrt -lkernel32 -luser32 -lmingw32 -lmingwex -lmoldname -lgcc_eh "-)" "D:\fb.git\lib\win32\crtend.o"
- [ fbc ] compiler translate *.bas in to *.a64 or *.asm or *.c files
- [ gcc ] compiler translate *.c files in to *.asm files
- [ as ] assembler translate *.asm/*.a64 files in to *.o object files
- [ ld ] linker join *.o files (and other files) in to executable files
- emscripten backend has other tools
- llvm backend has other tools
GNU assembler 32-bit backend (-gen gas)
*.bas => [ fbc ] => *.asm compile (first stage) to assembly (-r or -rr, -R or -RR)
*.asm => [ as ] => *.o assemble to object file (-c, -C)
*.o => [ ld ] => *[.exe] link to executable
GNU assembler 64-bit backend (-gen gas64)
*.bas => [ fbc ] => *.a64 compile (first stage) to assembly (-r or -rr, -R or -RR)
*.a64 => [ as ] => *.o assemble to object file (-c, -C)
*.o => [ ld ] => *[.exe] link to executable
GCC compiler backend (-gen gcc)
*.bas => [ fbc ] => *.c compile (first stage) to C (-r, -R)
*.c => [ gcc ] => *.asm compile (second stage) to assembly (-rr, -RR)
*.asm => [ as ] => *.o assemble to object file (-c, -C)
*.o => [ ld ] => *[.exe] link to executable
Options controlling compile / assemble / link stages:
There are a few options that can control what fbc does with the intermediate files and at what point the process may be stopped early.
-r, -rr, -c : stop the compile / assemble process sometime before the link stage
-R, -RR, -C : keep intermediate files at compile / assemble stages then continue to next stage
Compiler Option -r : compile up to first stage, keep file (*.asm/*.a64/*.c), and stop
Compiler Option -rr : compile up to second stage, keep file (*.asm), and stop
Compiler Option -c : compile up to assembly stage, keep file (*.o), and stop
Compiler Option -R : don't delete compile (first stage) intermediate file (*.asm/*.a64/*.c)
Compiler Option -RR : don't delete compile (second stage) intermediate file (*.asm)
Compiler Option -C : don't delete assemble stage intermediate file (*.o)
-r : option overrides -rr, -RR, -c, -C
-rr : overrides overrides -c, -C
-r and -rr : behave the same if there is only one compile stage
-R and -RR : behave the same if there is only one compile stage
-r, -rr, -c : override the default behaviour of creating an implicit "main" entry point, and no "main" function is created by default. To have a "main" entry point when using the -r, -rr, -c, options, then '-m module' option needs to be used to indicate which module should have an "main" function.
-dll and -lib options
In general, the above for -r, -R, -rr, -RR, -c, -C should hold true for -lib and -dll, however default behaviours for the implicit main are probably different? I haven't verified for myself yet....
Re: Wiki improvements
@fxm
Sorry not at home (bicycle ride) this afternoon I just read the post now.
You are right.
Thanks for the update.
Sorry not at home (bicycle ride) this afternoon I just read the post now.
You are right.
Thanks for the update.
Re: Wiki improvements
Update done:
ProPgExecutables → fxm [since fbc version 1.09.0, '.a64' (from gas64) replaced by '.asm' to be coherent]
ProPgExecutables → fxm [since fbc version 1.09.0, '.a64' (from gas64) replaced by '.asm' to be coherent]
Re: Wiki improvements
@fxm
With the help of Jeff I can now create an uptodate manual when necessary.
Lastest version : https://users.freebasic-portal.de/sarg/fbdoc.chm
With the help of Jeff I can now create an uptodate manual when necessary.
Lastest version : https://users.freebasic-portal.de/sarg/fbdoc.chm
Re: Wiki improvements
Very good news after Jeff's ability to build an update patch for windows standalone fbc 1.09.0 to fbc 1.10.0 winlibs/gcc-9.3 - 32bit and 64bit combined version (fbc32.exe & fbc64.exe).
You could also put an advert in the thread: Where can I get a Recent-Git-Build of FreeBASIC?
You could also put an advert in the thread: Where can I get a Recent-Git-Build of FreeBASIC?