Register | Login
Forum Index > Bugs and Fixes > signed | unsigned comparison
Author Message
Pages: 1 2 3 4
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1627] - posted: 2015-02-04 21:45:12
The register should be as what it was before calling the macro, as macros are inlined, they use the current state of variables and registers etc.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1628] - posted: 2015-02-04 22:02:03
Seems it works smile (exept eax = al)
Code:
program RAW_IMAGE 'test';

#set bits 32;

inline function SomeInlineFunction() {
  eax as dword;
  if (eax > 0) {eax = al;}
  if ([int32]eax > 0) {eax = al;}
}

eax as int32;
if (eax > 0) {eax = al;}
if ([dword]eax > 0) {eax = al;}
SomeInlineFunction();
if (eax > 0) {eax = al;}
if ([dword]eax > 0) {eax = al;}

Result:
Code:
00000000  85C0              test eax,eax
00000002  7E03              jng 0x7
00000004  0FB6C0            movzx eax,al
00000007  85C0              test eax,eax
00000009  7603              jna 0xe
0000000B  0FB6C0            movzx eax,al
0000000E  85C0              test eax,eax
00000010  7603              jna 0x15
00000012  0FB6C0            movzx eax,al
00000015  85C0              test eax,eax
00000017  7E03              jng 0x1c
00000019  0FB6C0            movzx eax,al
0000001C  85C0              test eax,eax
0000001E  7603              jna 0x23
00000020  0FB6C0            movzx eax,al
00000023  85C0              test eax,eax
00000025  7603              jna 0x2a
00000027  0FB6C0            movzx eax,al
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1632] - posted: 2015-02-05 18:47:53
Yes, unconditional repeat requires ; as I tried to keep the syntax the same as Ziron 1, this lets the assembler know there is no until/while statement, it was intended to help performance (faster peeking).

However, in Ziron 2 i have improved the internal parser, so I will add it to my list to make this optional.

I think it no so hard to correct this.
As i understand there is not needed to be optional. Because ';' -- it just an empty operator.
We are able to write also: Code:
repeat{};;;;;;;;;;;;;
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1636] - posted: 2015-02-05 22:29:10
It is not about correcting, but was about performance. The parser must look ahead at the next identifier to know if it should continue processing or treat it as a infinite repeat (checking a simple char ';' is faster than checking for a keyword. But I have already changed this for next release.

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
[1657] - posted: 2015-02-09 13:13:38
exept eax = al


I have changed assignments to check signed against first operand, this should solve the problem and make it work as expected.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1693] - posted: 2015-02-14 11:34:04
I think it relevant to this topic.
This
Code:
program RAW_IMAGE 'test';
#set bits 32;
eax as int32;
eax >> 1;
produces
Code:
00000000  D1E8              shr eax,1

Why in this case when 'eax' is signed 'sar' instruction was not used?
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1695] - posted: 2015-02-14 16:54:20
Thanks, corrected this for next release.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1731] - posted: 2015-02-18 16:44:53
Code:
program RAW_IMAGE 'test';
#set bits 32;
if ([sysint]gp_cx > 0) {}
Result:
Code:
00000000  85C9              test ecx,ecx
00000002  7600              jna 0x4
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