Oxygen Basic
Information => Latest Version => Topic started by: Charles Pegge on March 22, 2013, 04:41:17 AM
-
It's been a very busy week, I've fixed some C things but you will have to wait a little longer for the C preprocessor pass.
some new features
generic function :)
function f1(...)
...
end function
generic parameter array
for ellipsis etc
function f2(n,...)
indexbase 0
for i=1 to n
print param(i)
next
end function
f2 3,10,20,30
12:29 22/03/2013 Fix addr for strings / byref params / simple arrays / members
11:01 22/03/2013 Fix ### ### (multipass compiling) (Emil)
07:38 22/03/2013 Param[] for direct generic access to function params
06:41 22/03/2013 support ... in main code (ellipsis line non-execurable)
06:14 22/03/2013 itr thinBasic problem with string constants in app dataspace (quoted)
06:13 22/03/2013 Internal Set lcl() flag whenever lcls is() set
01:27 21/03/2013 New GetVarptr for thinBasic_Oxygen / Oxygen shell split
00:48 21/03/2013 Fix new 'extern' resets previous extern settings incl library name (auto end extern)
19:19 20/03/2013 Fix 'addr' pseudo-instruction for bstrings and strings
12:44 20/03/2013 Convert void* return type to 'sys'
12:42 20/03/2013 Various typedef function fixes (ScriptBasic Bes Header)
19:36 19/03/2013 Support void** typedef members
19:35 19/03/2013 Fix typdef members unsigned long etc
10:56 17/03/2013 Allow calling convention overrides : cdecl method ... cdecl int f()
10:56 17/03/2013 Allow unprototype methods (Emil)
10:54 17/03/2013 Allow macros inside typedefs (Emil)
Charles
-
Important Update for 64bit binary producers:
Repair 64 bit methods internal calling convention (non external classes)
Fix RTL64 val function
-
This fixes a bug which shows up itself in extern declarations, due to an uninitialised record.
And another bug affecting char* functions
Also provides support for filepath relative to ExePath.
using $ in these 2 compiler directives only.
includepath "$\inc\"
librarypath "$\"
-
This update supports direct (relative) jumps to functions. This is used for relaying callbacks into a single function.
call c2
end
extern
'
function f(...)
...
print pdata(2) ' eax=1 or eax=2
end function
c1:
=1 'eax=1
jmp f
'
c2:
=2 'eax=2
jmp f
'
end extern
Charles
-
Some bug fixes + new RTL32 (the missing -ve sign bug)
-
Thanks Charles,
test with this update return good result
-
Fix #compact option (dead code removal)
Extensions of Let syntax (more on this later)
-
Hi Charles,
The new last DLL runs with gl2d. But makes not any gl2d DLL!
I took back the older DLL and then it went again.
X
-
Hi Peter,
it looks like it does not recognise wglMakeCurrent as a procedure for some reason.
If you insert #recordof wglMakeCurrent at this point , it should return type -4, .. -7 on the top line, depending on how you have declared it.
My Opengl runs okay with the standard C headers and also with Petr's thinBasic TBGL headers
PS:
I also check Asm low level binding with the OpenGl2 example.
-
Oxygen Asm now supports the following 'n' conditionals
jnz jnge jnl jng jnle jnae jnc jnb jna jnbe jno jns jnc jne
cmovnz cmovnge cmovnl cmovng cmovnle cmovnae cmovnc cmovnb cmovna cmovnbe cmovno cmovns cmovnc cmovne
setnz setnge setnl setng setnle setnae setnc setnb setna setnbe setno setns setnc setne
-
Changes to the Embedfile command:
embedfile pointer,filename,offset,length
offset and length are optional
a negative offset counts from the end of the file
test: t.txt contains "ABCDEF":
sys p
embedfile p,"t.txt",3,2
byte b at p
print b[1] '68
zstring z at p
print z 'DE
bstring s at @p
print s " " len s 'DE 2
Charles
-
Nice Work Charles.
thanks you.
-
Fix DLL error trapping behaviour - unloading, as discussed with Peter.
RTLs for the inc/ folder are included
-
Fix for strange lurking last word comma string literal bug detected by Aurel.
-
Fix for C style prototype params with '$' suffixes
-
Hi Halim
Well, I've thought about it and, yes I think it is a good idea to autoset the optional flag, whenever a default param value is detected.
This means you won't need the optional word when assigning default values
tests:
function f(sys a=1,b) 'a and b become optional automatically (1 0)
print a " " b
end function
#recordof f
f ' 1 0
f 48 ' 48 0
f 48,96 ' 48 96
f a=12 ' 12 0
'f b=24 ' b error
'f a=6,b=12 ' b error
-
Hi Charles.
thank you very much.
-
Improved float behaviour for Peter.
function f(float a,b,c,d),external
print a " " b " " c " " d " "
end function
sys g=@f
single d
d=4.5
call g 0.0, 1.0 ,3.5, d
-
Thanks Charles,
You were able to correct your flaws. :D
Here is the proof.
include "sw.inc"
include "swgl.inc"
hwnd = Window 640,480,1 ' Or 0 for Fullscreen
hdc = InitGl(hwnd)
single r
img1= LoadImage "img/image1.bmp"
img2= LoadImage "img/image2.bmp"
img3= LoadImage "img/image3.bmp"
glClearColor 0, 0.5, 0, 1.0
While Key(27)=0
glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
glLoadIdentity
glBindTexture GL_TEXTURE_2D,img1
glTranslatef 0.0, 0.0, 0.0
glRotatef r, 0.0, 1.0, 0.0
glBegin GL_TRIANGLES
glTexCoord2f 1.0, 0.0: glVertex3f( 0.0, 0.5, 0.0)
glTexCoord2f 1.0, 1.0: glVertex3f(-0.5,-0.5, 0.5)
glTexCoord2f 0.0, 1.0: glVertex3f( 0.5,-0.5, 0.5)
glTexCoord2f 0.0, 0.0: glVertex3f( 0.0, 0.5, 0.0)
glTexCoord2f 1.0, 0.0: glVertex3f( 0.5,-0.5, 0.5)
glTexCoord2f 1.0, 1.0: glVertex3f( 0.5,-0.5,-0.5)
glTexCoord2f 0.0, 1.0: glVertex3f( 0.0, 0.5, 0.0)
glTexCoord2f 0.0, 0.0: glVertex3f( 0.5,-0.5,-0.5)
glTexCoord2f 1.0, 0.0: glVertex3f(-0.5,-0.5,-0.5)
glTexCoord2f 1.0, 1.0: glVertex3f( 0.0, 0.5, 0.0)
glTexCoord2f 0.0, 1.0 :glVertex3f(-0.5,-0.5,-0.5)
glTexCoord2f 0.0, 0.0 :glVertex3f(-0.5,-0.5, 0.5)
glEnd
r += 1.0
DoEvents
SwapBuffers hdC
SetFps (60)
Wend
QuitGl
Quit
-
Quad
include "sw.inc"
include "swgl.inc"
hwnd = Window 640,480,1
hdc = InitGl(hwnd)
single x
texture1 = Loadimage "img/angel.bmp"
texture2 = LoadImage "img/image4.bmp"
glClearColor 0.5, 0.5, 0.5, 1.0
while Key(27)=0
glClear GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
glLoadIdentity
glRotatef x,1.0,1.0,-1.0
glBindTexture GL_Texture_2D, texture2
glBegin(GL_QUADS)
glTexCoord2f(0.0, 0.0): glVertex3f(-0.5, -0.5, 0.5)
glTexCoord2f(1.0, 0.0): glVertex3f( 0.5, -0.5, 0.5)
glTexCoord2f(1.0, 1.0): glVertex3f( 0.5, 0.5, 0.5)
glTexCoord2f(0.0, 1.0): glVertex3f(-0.5, 0.5, 0.5)
glTexCoord2f(1.0, 0.0): glVertex3f(-0.5, -0.5, -0.5)
glTexCoord2f(1.0, 1.0): glVertex3f(-0.5, 0.5, -0.5)
glTexCoord2f(0.0, 1.0): glVertex3f( 0.5, 0.5, -0.5)
glTexCoord2f(0.0, 0.0): glVertex3f( 0.5, -0.5, -0.5)
glTexCoord2f(0.0, 1.0): glVertex3f(-0.5, 0.5, -0.5)
glTexCoord2f(0.0, 0.0): glVertex3f(-0.5, 0.5, 0.5)
glTexCoord2f(1.0, 0.0): glVertex3f( 0.5, 0.5, 0.5)
glTexCoord2f(1.0, 1.0): glVertex3f( 0.5, 0.5, -0.5)
glTexCoord2f(1.0, 1.0): glVertex3f(-0.5, -0.5, -0.5)
glTexCoord2f(0.0, 1.0): glVertex3f( 0.5, -0.5, -0.5)
glTexCoord2f(0.0, 0.0): glVertex3f( 0.5, -0.5, 0.5)
glTexCoord2f(1.0, 0.0): glVertex3f(-0.5, -0.5, 0.5)
glTexCoord2f(1.0, 0.0): glVertex3f( 0.5, -0.5, -0.5)
glTexCoord2f(1.0, 1.0): glVertex3f( 0.5, 0.5, -0.5)
glTexCoord2f(0.0, 1.0): glVertex3f( 0.5, 0.5, 0.5)
glTexCoord2f(0.0, 0.0): glVertex3f( 0.5, -0.5, 0.5)
glTexCoord2f(0.0, 0.0): glVertex3f(-0.5, -0.5, -0.5)
glTexCoord2f(1.0, 0.0): glVertex3f(-0.5, -0.5, 0.5)
glTexCoord2f(1.0, 1.0): glVertex3f(-0.5, 0.5, 0.5)
glTexCoord2f(0.0, 1.0): glVertex3f(-0.5, 0.5, -0.5)
glEnd()
DoEvents
SwapBuffers hdc
SetFps (60)
x += 1.0
iF x >360 Then x =-x
wend
QuitGL
CloseWindow
-
Update:
declarations now support implicit alias (quoted name immediately after declared name)
operator overloading removed.
-
Hi Charles,
thanks you very much.
-
This version allows unsigned value comparisons with these operators: (>= <= < >). The operands should also be unsigned ie: dword / unsigned int / unsigned long. thus:
dword a,b
...
if a<b
...
end if
Fortunately these are rare, since they are a potential programming hazard. Unsigned comparisons are usually for equivalence (= == <>) or zero/non zero and these do not suffer the same overflow/underflow problems.
Also, I have modified Classes to support arrays of member objects and UDTs:
class CA
...
end class
class CB
CA a[100]
...
end class
Charles
New permanent Location:
http://www.oxygenbasic.org/forum/index.php?topic=749
-
Thanks Charles..
I will test it right now with my programs.. ;)
-
Further update arising from work on DLLC:
Librarypath now working. It works like includepath, but specifies the location of dlls
13:34 28/05/2013 Fix LibraryPath (SB embed LibScriba.dll)
05:41 28/05/2013 Move all SB extension DLLs to /SB/modules
23:49 27/05/2013 Fix a[].b[] subarrays offset (DLLC SB)
18:19 25/05/2013 Endline checks for chr 10 (linux text)
18:16 25/05/2013 Support extern declarations (japi.h)
18:17 25/05/2013 Support declaration prototypes without param names (japi.h)
http://www.oxygenbasic.org/forum/index.php?topic=749.0
-
Charles
I would like to know ...
what is this ?
is this addition to oxygen core or you made some changes to core ?
-
Librarypath has been on the core list for a long time, but not working until now.
-
Minor update:
Fixed: the 'not' bitwise operator now works without brackets: a=not b
some assembly code words have been removed from the reserved list, so they can be used as Basic names, as long as they are not used as assembly code within the same scope (function etc)
db dw dd dq mov lea add sub mul div jz jnz shl sal sar
http://www.oxygenbasic.org/forum/index.php?topic=749
-
Minor update:
Including #autodim (off) fix to require iterators to to be defined before use.
Also improved optional params & default params behaviour.
http://www.oxygenbasic.org/forum/index.php?topic=749
18:42 12/07/2013 Fix Autodim 'off' for iterators
08:27 12/07/2013 Allow MultiAssign closing bracket to be on separate line.
13:23 11/07/2013 Extend support merging optional params and default params.
12:17 11/07/2013 Fix mixed number / string expression, starting with number: s = 42 s1
06:26 09/07/2013 Allow autotyped expression line break after '='
12:39 27/06/2013 Fix class factory : direct class method call without instantiating
--
09:30 25/06/2013 Fix 'Version' string
17:42 21/06/2013 new <<< rol >>> ror integer rotation operators
-
Thanks Charles for your relentless efforts in making OxygenBasic the best BASIC compiler by far.
-
Thanks Charles for your relentless efforts in making OxygenBasic the best BASIC compiler by far.
Indeed a remarkable performance!
It's just a bummer that I left Windows/OS long time ago :o
BTW: A while back there was talk about rewriting Oxygen with itself, is this still planned? It would be neat if Oxygen would spit out 100% nasm compatible code. This way Oxygen could run on native Linux and OSX. The user base could jump tremendously ;D
-
Indeed a remarkable performance!
THat's why i like OXYGEN BASIC... ;)
-
It would be neat if Oxygen would spit out 100% nasm compatible code.
If that happens, I am willing to leave this forum !
-
It would be neat if Oxygen would spit out 100% nasm compatible code.
If that happens, I am willing to leave this forum !
If Charles goes ahead and makes Oxygen OS agnostic it's his choice.
If you leave this forum because of that... it's your choice.
::)
-
NASM....
-very bad experience with this asm in EBasic compiled exes :-\
-
NASM....
-very bad experience with this asm in EBasic compiled exes :-\
Maybe you should have taken the hint from your first bad experience (EBasic) before exacerbating it with NASM.
-
If that happens, I am willing to leave this forum !
If you're accepting advice from friends, leaving O2 would be self defeating. If you ever find yourself out on the street, I have reserved a room for you at All Basic. ;)
-
Maybe you should have taken the hint from your first bad experience (EBasic) before exacerbating it with NASM.
John ..
this time you talk about things you dont know and you probably never tested ebasic compiled code
with nasm code and both gave same slow results ...so nasm is slow.
Of course i try compile programs with nasm only and also same thing...sloow for one assembler.
I think that FASM is on top of all asemblers ( maybe turbo-asm to)
end of story ....
-
Please reread/translate my post. Nowhere did it indicate I have used EBasic or NASM. The point was not expanding on your first mistake.
-
... ebasic compiled code with nasm code and both gave same slow results ...so nasm is slow.
Of course i try compile programs with nasm only and also same thing...sloow for one assembler.
I think that FASM is on top of all asemblers ( maybe turbo-asm to)
end of story ....
Aurel,
Your reference to EBasic/NASM just proves that the assembler code EBasic generated was of bad quality.
It doesn't say a thing about how good or how bad NASM is.
Every assembler NASM/FASM/YASM plays with a CPU's opcode.
If a bad sequence of opcode is chosen, does it proof that the assembler is bad?
No, it proofs that the programmer did a bad job (in EBasic's case it was Paul Turley).
Take as an example PureBasic: the Windows version uses FASM, the Linux/OSX version uses NASM...
If I write bad assembler code for FASM I cannot blame FASM for the slowness of my program.
And believe me I'm totally able to write horrible assembler code for FASM :P
-
Your reference to EBasic/NASM just proves that the assembler code EBasic generated was of bad quality
really...
So,if this is a true...how you can then explain that ebasic code > converted to NASM
run on the same (slow) speed as...
only Nasm code
One IWB forum member can cofirm this without problem...
so you can believe what you whish 8)
-
NASM is written in C and supports many object files (ELF, COFF, OMF, MACH-O, AOUT, etc).
FASM is written in assembly, generates ELF / COFF object files, and ELF / PE / MZ executables
Note NASM needs a linker for generating executables.
-
A while back there was talk about rewriting Oxygen with itself, is this still planned? It would be neat if Oxygen would spit out 100% nasm compatible code. This way Oxygen could run on native Linux and OSX. The user base could jump tremendously.
Spitting Nasm is certainly easier than spitting LLVM.
-
One IWB forum member can cofirm this without problem...
Maybe this only proofs that the IWB forum member is a bad coder as well... :-*
One thing for sure: NASM is faster than WINE ;D
-
One thing for sure: NASM is faster than WINE
Hold on there. I just got a Wine 1.6 update for i386 & amd64 and there may be new Windows magic (compatibility fixes) as part of the release. :D
Wine is more convenient than firing up a VirtualBox with XP installed.
-
Wine is more convenient than firing up a VirtualBox with XP installed.
This is certainly true.
-
Fixed problem with function params that start with a left bracket:
example:
str ((t2-t1)/fr,6)
http://www.oxygenbasic.org/forum/index.php?topic=749
-
Further Fix, concerning calls without brackets, made to functions with optional/default parameters.
Affected a few examples like oxcon.o2bas and oxide.o2bas
http://www.oxygenbasic.org/forum/index.php?topic=749
-
Oxygen update with preprocessor, (and fix for indexing arrays of UDTs).
#preprocess
resolves all %, #define, #ifdef, #ifndef, #case, before main main compiling begins. This is the same behaviour as in a C preprocessor. Use this directive if you need closer compatibility, when using C headers, but you you are also likely to need case sensitivity as well.
http://www.oxygenbasic.org/forum/index.php?topic=749
log since last update (25 Sept 2013)
06:45 28/11/2013 Fix compound type indexing. (SIB encoding allow) (bit shift error)
03:16 07/11/2013 Fix indexing from absolute addresses (thinBasic shared vars)
23:34 21/10/2013 Fix boolean comparisons equality: a=(b==c)
19:31 21/10/2013 Fix filename in error reporting
19:07 21/10/2013 Fix embedded nuls in soure code: replace with spaces
18:46 21/10/2013 New hash coder non-asm (internal)
12:05 21/10/2013 Fix gosub 64bit apps maintain 16 byte stack alignment.
05:12 20/10/2013 Refactor 'let' syntax. now supporting 'copyof'
05:47 19/10/2013 Support equate numeric expressions for CASE
22:58 18/10/2013 Fix meta compile-time equate numeric expression (summing negative numbers)
10:28 17/10/2013 Support direct pointer assignment in dim: sys*a=getmenory 1000
17:19 16/10/2013 Support C style casting a=(double*) d etc.
10:14 16/10/2013 #preprocess command
21:01 15/10/2013 Fix #compact method forward calls (detection in proclist)
11:54 14/10/2013 Separate keywords o2keyw.bas and manual data o2keyw.dat
17:02 09/10/2013 Fix operator-based line continuation for '&'
12:22 09/10/2013 Fix arith precedence in macro expressions
05:48 08/10/2013 Fix multiassign one value for floats: a=b=c=3.5
23:15 07/10/2013 inc/dynamic array macros
13:46 07/10/2013 Fix CrLf line endings (C linux header problems)
12:12 07/10/2013 Fix #compact again!
13:30 05/10/2013 Revoke embedded type definitions: dim vector{single x,y,z} a,b,c
12:54 05/10/2013 Implement preprocessor
05:22 05/10/2013 Revoke nestable #case, now plain switch.
21:22 04/10/2013 Fix TypeDef Procedures
14:55 04/10/2013 Fix types from typedef bug (internal o2sema L54)
The full log is available in inf/
-
Thanks Charles :)
when you say :
Support C style casting a=(double*) d etc.
i think that is C style casting :
a = *<double>d or something like that,is this supported to?
-
No it does not support C++ notation.
-
No it does not support C++ notation.
AIR may find that JADEd. :D
I'm looking forward to using C header files with O2.
-
Thanks Charles,
Some test are necessary.
By the way:
Amazing!
ALLBASIC has 6 members and RUBENDEV has 11 members.
RUBENDEV seems to be more interesting.
Well, quality is the best way for the prosperousness.
-
ALLBASIC has 6 members and RUBENDEV has 11 members.
There is a difference between having 6 BASIC developers rather than a few somewhat interested BASIC hobbyists. Don't go bitter on me Peter. There is already enough of that going around.
-
This was not any bitter almond for John, rather an analysis. :D
-
Your analysis would have better results if it was based on facts rather than assumptions.
-
RUBENDEV seems to be more interesting.
;D
-
It would even be more interesting if RUBENDEV is ever completed. I fear the same fate as Aurel's other adventures like AurelBasic. One can only hope Aurel can stay focus long enough to keep others interested. I'm also surprised Aurel has that many members when this has to the third or forth forum site he has created this year. ::)
-
forth forum site he has created this year
::)
which sites?
or where are those sites... ???
I have only my old ucoz site which i use to backup some stuff and nothing else.
and
Allbasic i visit from time to time and i think that there are some interesting stuff... ;)
-
Allbasic i visit from time to time and i think that there are some interesting stuff...
I have noticed you visit regularly and thanks for the interest. Something special is going on there. Stay tuned.