Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Source Help

compiling error

A community discussion post from the original code:zIRON forum.

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

also rather than alot of mem access

push edi
edi = GetNextLine(@buf);

repeat {
  WriteLn(@LineIn);
  Eax = @buf;
  
  add eax, edi
  
  edi = GetNextLine(Eax);
} while (edi > 0);

int32 k = edi;
pop edi
Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt
while (edi > 0);

did not compile ok!!!!!!!!!

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

yes as i said in other post, it is a bug for next patch release,

change it to while edi > 0)

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok , here it is until fixing come.

while(edi > 0)
{
  WriteLn(@LineIn);
  Eax = @buf;
  
  add eax, edi
  
  edi = GetNextLine(Eax);
} 

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

i'd like to know that when writing console app you can include 'ch.zir'

it is a basic error output, access violations etc, will help you debug your code ;)

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok i will.

i want you to help me in the following code. i have logical error this code always print

the first line of fpu_opcodes.txt .

program WIN32CUI 'test';

#include 'console.zir';
#include  'ch.zir'

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

function GetNextLine(char* strbuf)
{ 
   global int32 Incr=0; 
   uses edi esi;
   Eax = 0;
   Ecx = Incr;  
   Esi = strbuf;
   add Esi,Ecx
   Edi = @LineIn;
   while( char[Esi] != 0)
    {
       if(char[Esi] == 13 and char[esi+1] == 10) 
        {
          char[Edi] = 0; 
          Ecx = Incr;
          add Ecx,Eax
          add Ecx,2
          Incr = Ecx;  
          break;
        }
       bl = char[Esi]; 
       char[Edi] = bl; 
       Eax++; 
       Esi++;
       Edi++;
   }
}

push edi
edi = GetNextLine(@buf);
while(edi > 0)
{
  WriteLn(@LineIn);
  edi = GetNextLine(@buf);
} 
int32 k = edi;
pop edi

wait_key(nil);

ExitProcess(0);

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

also from what i understand; what you want is:

program WIN32CUI 'test';

#include 'console.zir';
#include 'ch.zir';

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

function GetNextLine(char* strbuf) { 
	uses esi edi;
	eax = xor;
	
	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++;
	}
}


push edi
ecx = @buf; //eax would be changed by GetNextLine
edi = GetNextLine(eax);

while(edi > 0) {
  WriteLn(@LineIn);
  
  add ecx, edi  
  edi = GetNextLine(ecx);
} 

int32 k = edi;
pop edi


wait_key(nil);

ExitProcess(0);
Colin admin
Posts
928
Threads
49
Location
Bulgaria

another change that would be important:

function GetNextLine(char* strbuf) { 
	uses esi edi;
	eax = xor;
	
	esi = strbuf;	
	edi = @LineIn;
	
	while( char[esi] != 0) {
		if (char[esi] == 13) {
			eax++; 
			break;
		}
		bl = char[Esi]; 
		char[edi] = bl; 
		eax++; 
		esi++;
		edi++;
	}
	char[edi] = 0; 	
}