Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Bugs and Fixes

Wrong opcodes

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

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

I don't see the problem? You enabled imm_roll....

As for expressions, as I stated, expressions support only + and -, no complex operations, + and - have the same precedence.

As for your example, this is a problem that I need to look at further and come up with a solution. I plan to have complex expressions at some point that will use sse instructions (by option)

0CodErr member
Posts
201
Threads
37
Location
Unknown
I don't see the problem? You enabled imm_roll....

Problem is incorrect result. And i give you link to result. Ok, i post part of result here

#
00000277  66153412          adc ax,0x1234
#
0000027B  81D3341281D1      adc ebx,0xd1811234
#
00000281  3412              xor al,0x12
#
00000283  81D2341281D6      adc edx,0xd6811234
#
00000289  3412              xor al,0x12
#
0000028B  81D7341281D5      adc edi,0xd5811234
#
00000291  3412              xor al,0x12
#
00000293  81D434126605      adc esp,0x5661234
#
00000299  3412              xor al,0x12
#
0000029B  81C3341281C1      add ebx,0xc1811234
#
000002A1  3412              xor al,0x12
#
000002A3  81C2341281C6      add edx,0xc6811234
#
000002A9  3412              xor al,0x12
#
000002AB  81C7341281C5      add edi,0xc5811234
#
000002B1  3412              xor al,0x12
#
000002B3  81C434126625      add esp,0x25661234
#
000002B9  3412              xor al,0x12
#
000002BB  81E3341281E1      and ebx,0xe1811234
#
000002C1  3412              xor al,0x12
#
000002C3  81E2341281E6      and edx,0xe6811234
#
000002C9  3412              xor al,0x12
#
000002CB  81E7341281E5      and edi,0xe5811234
#
000002D1  3412              xor al,0x12
#
000002D3  81E43412663D      and esp,0x3d661234
#
000002D9  3412              xor al,0x12
#
000002DB  81FB341281F9      cmp ebx,0xf9811234
#
000002E1  3412              xor al,0x12
#
000002E3  81FA341281FE      cmp edx,0xfe811234
#
000002E9  3412              xor al,0x12
#
000002EB  81FF341281FD      cmp edi,0xfd811234
#
000002F1  3412              xor al,0x12
#
000002F3  81FC341266B8      cmp esp,0xb8661234
#
000002F9  3412              xor al,0x12
Colin admin
Posts
928
Threads
49
Location
Bulgaria

Aha, sorry I'm missing a lot of things these past days.. guess I am tired :P thanks for pointing that out, I will take a look.

Colin admin
Posts
928
Threads
49
Location
Bulgaria

I have just tested your code, and having problems to replicate the issue, can you confirm you are using the latest beta release?

Colin admin
Posts
928
Threads
49
Location
Bulgaria
Ok, how it would be in my example above? Code: eax = ebx + eax

I have added error when referencing the assignment operand for now.

0CodErr member
Posts
201
Threads
37
Location
Unknown
can you confirm you are using the latest beta release?

This version already support $labelref().

It no so easy to distinguish versions. Because in beta all versions are the same (2.0.0.22).

And maybe you also need to check version that you used for this test? :)

0CodErr member
Posts
201
Threads
37
Location
Unknown
I have added error when referencing the assignment operand for now.

There is a way to do like in SphinxC-- in the order in which they are written.

Then we can translate

eax = ebx & ecx + edi - ebp | edx ^ esi

to

eax  = ebx;
eax &= ecx;
eax += edi;
eax -= ebp;
eax |= edx;
eax ^= esi;

Also this

eax = -~-~ebx

can be directly translated as

eax = ebx;
~eax; 
-eax; 
~eax; 
-eax;

Problem is that it way will conflict with constant expressions operator precedence which already exist.

Colin admin
Posts
928
Threads
49
Location
Bulgaria

I was still not able to recreate the problem with imm_roll, I will make a new release hopefully today, could you test again then and let me know if it happens still?