Register | Login
Forum Index > Source Help > compiling error
Author Message
Pages: 1 2 3 4
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[147] compiling error - posted: 2011-10-26 21:45:33
hi

when compiling the next code i got that error

[9,3]: Expected : but found { in [test.zir]
code:
{
Code:
program WIN32CUI 'test';

#include 'console.zir';

char buf = loadfs('.\\fpu_opcodes.txt')
char LineIn[1024];

function* GetNextLine(char* strbuf)
{
   Esi = @strbuf;
   Edi = @LineIn;
   while( char[Esi] != 0)
    {
       if(char[Esi] == 13) 
        {
          char[Edi] = 0; 
          break;
        }
       al = char[Esi]; 
       char[Edi] = al;  
       Esi++;
       Edi++;
   }
   return @LineIn; 
}


WriteLn(GetNextLine(@buf));

wait_key(nil);

ExitProcess(0);


any help please.


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[148] - posted: 2011-10-26 23:23:59
first mistake i see is

Code:
function* GetNextLine(char* strbuf)


the * is used to create a function prototype with pointer. Removing that from what i see else look ok

Code:
function GetNextLine(char* strbuf)


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[150] - posted: 2011-10-27 15:53:41
sorry 1 other thing i missed last night

Code:
char buf = loadfs('.\\fpu_opcodes.txt')


this should be a const

Code:
const buf = loadfs('.\\fpu_opcodes.txt');


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
[152] - posted: 2011-10-27 18:36:21

ok , here is my updating code . but it refuses to compile.

Code:
program WIN32CUI 'test';

#include 'console.zir';

const  buf = loadfs('fpu_opcodes.txt');
char LineIn[1024];

function GetNextLine(char* strbuf)
{ 
   Eax = 0;
   Esi = strbuf;
   Edi = @LineIn;
   while( char[Esi] != 0)
    {
       if(char[Esi] == 13) 
        {
          char[Edi] = 0; 
          Eax++; 
          break;
        }
       bl = char[Esi]; 
       char[Edi] = bl; 
       Eax++; 
       Esi++;
       Edi++;
   }
   //return i; 
}

int32 k = GetNextLine(@buf);

repeat {
  WriteLn(@LineIn);
  Eax = @buf;
  add Eax , k   // ------------ this line give error
  k = GetNextLine(Eax);
} while (k > 0);

wait_key(nil);

ExitProcess(0);


also i tried the next code but it gave error
Code:
Eax = @buf + k;



http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[154] - posted: 2011-10-27 18:55:13

this also does not compiled
Code:
print(GetNextLine(@buf), '\r\n');


http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[155] - posted: 2011-10-27 19:08:55

this also gave error in return statement
Code:
function GetNextLine1(char* strbuf)
{
   Esi = strbuf;
   Edi = @LineIn;
   while( char[Esi] != 0)
    {
       if(char[Esi] == 13) 
        {
          char[Edi] = 0; 
          break;
        }
       al = char[Esi]; 
       char[Edi] = al;  
       Esi++;
       Edi++;
   }
   return @LineIn; 
}


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[161] - posted: 2011-10-27 19:59:45
ok first there seems to be a bug with moving @vars to eax so return @... is bug i will fix.

because maths functions are all on my extend and upgrade list, some do not work as planned, for now i would have to say to a mov, add mov

Code:
  ecx = k; //add Eax , k
  add eax, ecx
  k = eax;


once i fix these opcodes, it could then be changed, there was also a bug with repeat while and repeat until which i have just fixed.

try if it reports an error.

Code:
} while k > 0);


and finally, your functions that change esi, edi etc need uses clause.

Code:
function GetNextLine(char* strbuf)
{ 
   uses edi esi;


i will try to get an update out as soon as possible with more fixes.

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
[162] - posted: 2011-10-27 20:01:52
yes , it gave error.

http://www.freewebs.com/ogremagic/index.htm
Pages: 1 2 3 4
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