Programming => Problems & Solutions => Topic started by: Peter on September 07, 2011, 09:59:52 AM
Title: RTL.inc
Post by: Peter on September 07, 2011, 09:59:52 AM
Deleted.....
Title: Re: RTL.inc
Post by: Charles Pegge on September 08, 2011, 02:00:10 AM
Hi Peter,
Yes I could reproduce the problem. 'A' was already defined as a global variable in RTL32. I have now removed it. (You can workaround this problem by putting a dot before it '.A:').
I have also made a slight modification to the Assemble so you can use dotted labels as well as colon labels on the same line as an Assembly code instruction.
Code: OxygenBasic
'USING LABLES ON THE SAME LINE AS INSTRUCTIONS
.a mov eax,eax
a: mov eax,eax
.a: mov eax,eax
.a print "ok"
The Oxygen 'in progress' version has been updated.
Charles
Title: Re: RTL.inc
Post by: Charles Pegge on September 08, 2011, 03:28:56 AM
Yes I see what is happening.
With the new Oxygen, you can use 'a:' or '.a' or '.a : ' but not '.a:'
I can fix the latter problem though I would not recommend that way of expressing a same-line label.
Code: OxygenBasic
sys c
mov ecx,10
mov eax,0
a: inc eax
dec ecx
jg a
mov c,eax
print c
Charles
Title: Re: RTL.inc
Post by: Charles Pegge on September 08, 2011, 04:10:26 AM
I have just posted another Oxygen 'in-progress' version which also accommodates '.a:'
Code: OxygenBasic
sys c
mov ecx,10
mov eax,0
.a: inc eax
dec ecx
jg a
mov c,eax
print c
Charles
Title: Re: RTL.inc
Post by: Charles Pegge on September 08, 2011, 05:24:25 AM
[ebx+488] is a low level call vector to ReadFile. So I think there a name conflict with your software somewhere.
You could try #undef ReadFile after RTL32 and see if that fixes the problem.
Charles
Title: Re: RTL.inc
Post by: Charles Pegge on September 08, 2011, 08:15:23 AM
This is the first time anyone but me has used the RTL.
I think we may have further name conflicts causing the problems you see.
It may be necessary to disable the rule that distinguishes a procedure call with a colon attached, from a label with a colon attached. This is causing the RTL namespace to intrude on your Application namespace with regard to labels.
Charles
Title: Re: RTL.inc
Post by: Charles Pegge on September 08, 2011, 12:04:37 PM
Yes certainly Peter. It is very important that the path for creating DLLs should be as smooth as possible.
The main issue here is that we cannot safely disambiguate between a procedure call and a label when colons are stuck on the end. Therefore the first word in a line, if it has a colon, must be assumed to be a label.
If we stick to this rule then it should eliminate many potential name conflicts when using libraries.