Register | Login
Forum Index > Bugs and Fixes > entry keyword
Author Message
Pages: 1
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[1637] entry keyword - posted: 2015-02-06 18:27:28
Hi Mr Colin,

i think entry keyword will direct the execution to the position where it is in.

but this example below works incorrect way.
Code:
program PE32_CUI 'entry keyword';

#include 'platform_def.zir';
#include 'console.zir';

aa:    // this code executed 2 times ?????????????
  mov eax, 5
  print([dword]eax,'\n'); 
  lret 0;

entry procedure WINAPI main() {
  RTLMain();

  println('Hello, World!');
  
  call aa
   
  wait_key();
  ExitProcess(0);
}


also when decalr the subroutine in the end the lable will not be seen by Ziron, see this
Code:
program PE32_CUI 'entry keyword';

#include 'platform_def.zir';
#include 'console.zir';


entry procedure WINAPI main() {
  RTLMain();

  println('Hello, World!');
  
  call aa
   
  wait_key();
  ExitProcess(0);
}

aa:    
  mov eax, 5
  print([dword]eax,'\n'); 
  lret 0;


also in lret 0; term what '0' means , and if possible , you can use ret instead of lret key word
,you can check if we are in subroutine exec lert event.

thanks.

http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1638] - posted: 2015-02-06 20:35:44
Ziron is intended to be a high level assembler, why would you want to over complicate the source?

calling RTLMain() calls the whole file as a function since Ziron source is the default first function which can have numerous initialization code (I may arrange this different in a later version)

meanwhile, using a label like so is no point.

Code:
program PE32_CUI 'entry keyword';

#include 'platform_def.zir';
#include 'console.zir';

#set frame off;
procedure aa() {
  mov eax, 5
  print([dword]eax, '\n');
}
#set frame on;

entry procedure WINAPI main() {
  RTLMain();

  println('Hello, World!');
  
  call aa
   
  wait_key();
  ExitProcess(0);
}


Note that RTLmain will be obsolete in one of the following versions once i rewrite the RTL.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[1639] - posted: 2015-02-06 21:07:17

Ziron is intended to be a high level assembler, why would you want to over complicate the source?


actually , i am a big fan of Blitzbasic2 for amiga, i was playing with AmiBltz3 since two days so i want to revival it.

testing how Ziron can be close to amiblitz3 , i may write a plugin for that.



http://www.freewebs.com/ogremagic/index.htm
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 8 user(s) online. 0 member(s) and 8 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd