Author Topic: error with the latest Oxygen DLL  (Read 11963 times)

0 Members and 1 Guest are viewing this topic.

Emil_halim

  • Guest
error with the latest Oxygen DLL
« on: April 19, 2014, 03:18:26 AM »
Hi Charles,

I have just download the latest Oxygen DLL , then i tested on of my old HLasm with OXYgenbasic.

i got a wrong result with new upgrade.

here is my example
Code: [Select]
//*********************************
//*  test program by Emil Halim   *
//*       5 / 4 / 2013            *
//*********************************

indexbase 0
includepath "$/inc/"
$ filename "AscToDword.exe"
#include "RTL32.inc"

zstring a[]="12345"

   addr edx,a : gosub AscToDwor_proc : add eax , 10
   print eax   //12355
end

==========================
AscToDwor_proc:

          xor eax, eax               ; clear eax
 ^  @@:   movzx byte ecx, [edx]      ; move 1 byte into ecx
 ^        lea eax, [eax+eax*4]       ; eax = 5 * eax
 ^        lea eax, [eax*2+ecx-30h]   ; eax = 2 * eax + (ecx-30h)
 ^        edx++                      ; inc edx
 ^        cmp byte[edx], 0           ; if end of string then return
 ^        jne @b
 ^        ret
 
Quote
it prints 212353  instead of 12355

any help please?

Emil_halim

  • Guest
Re: error with the latest Oxygen DLL
« Reply #1 on: April 19, 2014, 08:30:40 AM »
Hi Peter,

welcome to Oxygen basic forum.

thanks you , i think the problem is old oxy dll was know the hex syntax 30h , but the new one did not.

Charles can you fix this please.

Emil_halim

  • Guest
Re: error with the latest Oxygen DLL
« Reply #2 on: April 19, 2014, 12:21:35 PM »

Hi Charles,

I have found another problem with the new oxy dll.

i have a declared dll function like this
Code: [Select]
! Graphics3D       "_Graphics3D@20"(Dword Width,Height,depth=32, boolean fullScrn=false,VSync=false)

it was working okay, and now give me this error
Quote
ERROR:   parameters mismatch for procedure graphics3d:
params given : #long#long#long#long#long#long@000_00

OPTIONS:
graphics3d(dword,dword,dword,dword,dword)

WORD:    0
LINE:    28
FILE:    main source
PASS:    2
>Exit code: 0

i call it like this
Code: [Select]
Graphics3D(800,600)

so what could be the error here?

Aurel

  • Guest
Re: error with the latest Oxygen DLL
« Reply #3 on: April 19, 2014, 02:45:17 PM »
I think that something is wrong with new dll
because with old my programs work but with new i receive strange errors like
is on pic...

.

Emil_halim

  • Guest
Re: error with the latest Oxygen DLL
« Reply #4 on: April 19, 2014, 11:33:10 PM »
Hi Peter,

thanks , BTW that means the old version was buggy so it accepted boolean type.

any way , my big wish is that Oxygen basic is a bug free, so that i can trust in it's results.
 

Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #5 on: April 19, 2014, 11:53:52 PM »
Hi Emil,

Yes, I was attempting to remove undesirable number suffixes: h and o and e should be allowed through.

quick dll update:
http://oxygenbasic.org/o2zips/Oxygen.zip

As in C, bool is really an 32 bit integer

Test code:
Code: [Select]

typedef bool boolean
def true -1
def false 0


function Graphics3D "_Graphics3D@20" _
(Dword Width,Height,depth=32, boolean fullScrn=false,VSync=false)
print "depth " depth
end function

Graphics3D 100,200


---------------

'numbers with suffixes:

print 101h      '257
print 101o      '65
print 101.0e-4  '0.0101

Aurel, can you please provide an example of the string problem

Mike Lobanovsky

  • Guest
Re: error with the latest Oxygen DLL
« Reply #6 on: April 20, 2014, 12:07:57 AM »
What is the exact idea behind TRUE = -1, Charles?
« Last Edit: April 20, 2014, 12:25:44 AM by Mike Lobanovsky »

Emil_halim

  • Guest
Re: error with the latest Oxygen DLL
« Reply #7 on: April 20, 2014, 12:13:08 AM »
thanks Charles,

i have another problem , see this declaration
Code: [Select]
! LoadMesh           "_LoadMesh@12"(char* file="", sys EntityParent=0, char* meshName="") as sys
when calling it like that
Code: [Select]
ogrehead = LoadMesh("ogrehead.mesh",0)

i got this error
Quote
Linker found unidentified names:
file:   level 0
meshname:   level 0

BTW , the function accepts an empty NULL string as a default parameter , not a null pointer.

any help please.

Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #8 on: April 20, 2014, 02:29:31 AM »
Emil,

(re-edited)
 I had not not considered using strings as default params.

there is an issue with '*' and default values

One solution is to use string instead of char*. They are compatible in this context.

Another is to create a char* type

Code: [Select]
typedef char *pchar

function f(pchar s="")
print strptr s
end function

f

Mike, -1 is a Basic truth :). Oxygen only does bitwise logic, currently.
« Last Edit: April 20, 2014, 06:43:30 AM by Charles Pegge »

Mike Lobanovsky

  • Guest
Re: error with the latest Oxygen DLL
« Reply #9 on: April 20, 2014, 03:06:40 AM »
Bulgarians nod to say "No" and shake their heads to say "Yes". :D

Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #10 on: April 20, 2014, 02:25:55 PM »
Is this correct?

With nose pointing in the z axis

Bulgarian Yes:  glRotatef 20,0,0,1
Bulgarian No:   glRotatef  20,1,0,0

Mike Lobanovsky

  • Guest
Re: error with the latest Oxygen DLL
« Reply #11 on: April 20, 2014, 04:58:58 PM »
Yes Charles, (that's a usual human "yes" :D )

You're perfectly correct. In fact, I was even trying to look up a better English word than "shake" in the dictionary but I failed - you don't have any other one to convey negation (neither do we BTW). By "shaking one's head" negatively, the English and the rest of the world (oh, those imperialistic lingual relics! ;) ) imply

glRotate(+/-20,0,1,0)

a few times and that's only natural and clear for all other earthlings but Bulgarians. They would convey negation by a one-time nod

glRotate(-/+20,1,0,0)

while their agreement would be conveyed with a one-time tilt

glRotate(-/+20,0,0,1)

of their head to their left shoulder, both gestures being performed invariably in that particular polarity.

It's almost impossible to communicate with a Bulgarian waiter in a restaurant; you have to ask them again and again until they would vocalize their answers.

But in ordinary life it's a convenient and customary simplification to say that Bulgarians just do it "the other way round" compared to us ordinary mortals. :)

Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #12 on: April 20, 2014, 07:48:14 PM »

Indian folks often do a few glRotatef +/-10,0,0,1 to indicate they agree with you. That could be a 'yes' but it certainly confused the Brits.

Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #13 on: April 20, 2014, 08:35:30 PM »
Another update for Emil. This fixes the default param '*' problem

quick dll update:
http://oxygenbasic.org/o2zips/Oxygen.zip

Code: [Select]
function f(char*s="Hello")
print s
end function

f

f "Hello World!"

Emil_halim

  • Guest
Re: error with the latest Oxygen DLL
« Reply #14 on: April 21, 2014, 07:37:51 AM »

thank's Charles.

works well here.

may i ask you about the states of c style syntax please.