Author Topic: RTL.inc  (Read 3033 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
RTL.inc
« on: September 07, 2011, 09:59:52 AM »
Deleted.....
« Last Edit: May 05, 2015, 12:25:51 PM by Peter »

Charles Pegge

  • Guest
Re: RTL.inc
« Reply #1 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
  1.  
  2.   'USING LABLES ON THE SAME LINE AS INSTRUCTIONS
  3.  
  4.   .a  mov eax,eax
  5.   a:  mov eax,eax
  6.   .a: mov eax,eax
  7.   .a  print "ok"
  8.  

The Oxygen 'in progress' version has been updated.

Charles

Charles Pegge

  • Guest
Re: RTL.inc
« Reply #2 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
  1. sys c
  2.  
  3.    mov ecx,10
  4.    mov eax,0
  5. a: inc eax
  6.    dec ecx
  7.    jg a
  8.    mov c,eax
  9.  
  10.    print c
  11.  
  12.  


Charles
« Last Edit: September 08, 2011, 03:36:00 AM by Charles Pegge »

Charles Pegge

  • Guest
Re: RTL.inc
« Reply #3 on: September 08, 2011, 04:10:26 AM »
I have just posted another Oxygen 'in-progress' version which also accommodates '.a:'

Code: OxygenBasic
  1.  
  2. sys c
  3.  
  4.     mov ecx,10
  5.     mov eax,0
  6. .a: inc eax
  7.     dec ecx
  8.     jg a
  9.     mov c,eax
  10.  
  11.     print c
  12.  

Charles
« Last Edit: September 08, 2011, 04:13:43 AM by Charles Pegge »

Charles Pegge

  • Guest
Re: RTL.inc
« Reply #4 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

Charles Pegge

  • Guest
Re: RTL.inc
« Reply #5 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

Charles Pegge

  • Guest
Re: RTL.inc
« Reply #6 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.

Charles