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
A community discussion post from the original code:zIRON forum.
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
while (edi > 0);
did not compile ok!!!!!!!!!
http://www.freewebs.com/ogremagic/index.htm
yes as i said in other post, it is a bug for next patch release,
change it to while edi > 0)
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
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 ;)
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
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);
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;
}