Difference between revisions of "ScriptBasic:UsersGuide 6.1"

From ScriptBasic
Jump to: navigation, search
m (Unprotected "ScriptBasic:UsersGuide 6.1")
(added note about using the full path with scriba when using the -K option)
 
Line 11: Line 11:
  
 
When the interpreter starts first it check if the last 15 bytes start with the string <font size="3"><tt>SCRIPTBASIC</tt></font>. If it does not then the interpreter continues in normal operation processing the command line parameters. However if the last 15 bytes start with the string <font size="3"><tt>SCRIPTBASIC</tt></font> then the executable is a ScriptBasic generated executable and it loads the code from the executable starting at the byte offset specified by the last four bytes of the file.
 
When the interpreter starts first it check if the last 15 bytes start with the string <font size="3"><tt>SCRIPTBASIC</tt></font>. If it does not then the interpreter continues in normal operation processing the command line parameters. However if the last 15 bytes start with the string <font size="3"><tt>SCRIPTBASIC</tt></font> then the executable is a ScriptBasic generated executable and it loads the code from the executable starting at the byte offset specified by the last four bytes of the file.
 +
 +
Under Linux, use the full path to '''scriba''' when using the -K option to build a standalone executable. Under Windows the full path isn't required for scriba.
 +
 +
/usr/bin/scriba -Ko standalone_program_name pgm.bas
 +
 +
  
 
----
 
----
  
 
[[ScriptBasic:UsersGuide_6|[<<<]]] [[ScriptBasic:UsersGuide_7|[>>>]]]
 
[[ScriptBasic:UsersGuide_6|[<<<]]] [[ScriptBasic:UsersGuide_7|[>>>]]]

Latest revision as of 02:56, 8 December 2007

[Contents]

6. Compiling BASIC program to EXE

6.1. BASIC to EXE compilation technical details

[<<<] [>>>]


Under Windows and Linux an executable file is loaded into the system without caring too much the length of the file. This is the feature that let viruses attach themselves to executable file under Windows. When ScriptBasic is started with the option `-E' the interpreter makes a copy of the executable of itself and appends the compiled intermediate code after the executable code. Finally it prints the eleven characters string SCRIPTBASIC and a four byte file byte offset pointing after the end of the executable part of the file.

When the interpreter starts first it check if the last 15 bytes start with the string SCRIPTBASIC. If it does not then the interpreter continues in normal operation processing the command line parameters. However if the last 15 bytes start with the string SCRIPTBASIC then the executable is a ScriptBasic generated executable and it loads the code from the executable starting at the byte offset specified by the last four bytes of the file.

Under Linux, use the full path to scriba when using the -K option to build a standalone executable. Under Windows the full path isn't required for scriba.

/usr/bin/scriba -Ko standalone_program_name pgm.bas



[<<<] [>>>]