PDA

View Full Version : Oxygen module



ErosOlmi
02-12-2008, 11:50
Charles,

I see you constantly updating Oxygen sources in http://community.thinbasic.com/index.php?topic=2115.0 (a big thanks for that) but compiled module in http://community.thinbasic.com/index.php?topic=1845.0 is still the version compiled on 2nd of October.

Is it ok? I asked just for understanding how to behave when I release a new thinBasic version.

Ciao
Eros

Charles Pegge
02-12-2008, 13:24
Hi Eros,

The October version is the stable one with the assembler but without Basic. As soon as I have a stable O2H, it will replace the October version. I will probably add an extra 100k to the DLL for the Basic. I think it is best to maintain it as a single project.


Here is the first operational code - but I have loads of testing and corrections to do yet. :)



uses "OXYGEN"
uses "FILE"

dim v1,v2,v3,v4,v5 as long
dim p0,p1,p2,p3,p4 as long
dim src as string

src="
o2h

function fun1( byval v1 as long,byval v2 as long) at #p1
static c,d=29 as long
local a=2,b=42 as long
function=v1+v2*4
end function

function o2_release() as long at #p0
terminate
end function

"

o2_asmo src
v1=o2_exec

declare sub o2_release () at p0
declare function fun1 (byval v1 as long, byval v2 as long ) as long at p1

v2=fun1(3,4)
o2_release()



msgbox 0,v2

msgbox 0,"length "+o2_len+$cr+o2_error+$cr+o2_prep(src) : stop
file_save ("t.txt",o2_error+o2_prep(src)) : stop
o2_asmo src : o2_exec : msgbox 0,"0x"+hex$(vv)

ErosOlmi
02-12-2008, 13:39
wow, great :o

Now I've got how you update.

Thanks a lot.
Eros

Petr Schreiber
02-12-2008, 17:12
Hi Charles,

that looks very good, nice to see the interface is the same as for "classic" oxygen assembly.
Does the o2h on the beginning tell module it contains o2h code?


Petr

Charles Pegge
02-12-2008, 20:13
Yes Petr, it adds Basic to the Oxygen namespace. We could make it automatic but this risks breaking code written in pure Assembler which may already use some of the keywords. But I have not come to a firm decision yet.