Register | Login
Forum Index > Bugs and Fixes > Unexpected symbol @
Author Message
Pages: 1 2 3
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1705] - posted: 2015-02-15 13:59:01
Code:
program RAW_IMAGE 'test';
#set bits 32;
dword x, y;
y = @x;

Code:
program RAW_IMAGE 'test';
#set bits 32;
dword x = @x;

Operand 2 is invalid
Admin
Site Admin

avatar

(send private message)

Posts: 932
Topics: 54

Location:
OverHertz Studio
[1710] - posted: 2015-02-15 16:05:20
Thanks, fixed 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:
[1720] - posted: 2015-02-17 11:41:23
Currently this
Code:
program RAW_IMAGE 'test';

#set bits 32;

dword x = @x;

x;

translated to
Code:
00000000  C7050A0000000A00  mov dword [dword 0xa],0xa
         -0000
0000000A  0000              add [eax],al
0000000C  0000              add [eax],al
it wrong result.

Also this cannot be compiled:
Code:
program RAW_IMAGE 'test';

#set bits 32;


const MY_CONST_STRING = 'some string';
const ADDRESS_Of_MY_CONST_STRING = @MY_CONST_STRING;

Unexpected symbol @
Admin
Site Admin

avatar

(send private message)

Posts: 932
Topics: 54

Location:
OverHertz Studio
[1737] - posted: 2015-02-19 20:51:26

translated to
Code:
00000000 C7050A0000000A00 mov dword [dword 0xa],0xa
-0000
0000000A 0000 add [eax],al
0000000C 0000 add [eax],al
it wrong result.


Why is this wrong result? If you mean that it doesn't initialize as the address, this I will add later after fixing rest of the bugs from the list. (I will add it to my list)

I will take a look at const, but I'm not sure I will add this as a const should be constant data, where as an address requires fixups, relocations etc 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:
[1738] - posted: 2015-02-19 21:11:56
If you mean that it doesn't initialize as the address
Yes, I mean this.

This will be right
Code:
mov dword [dword 0xa],0xa

in case
Code:
dword x;
x = @x;


I will take a look at const, but I'm not sure I will add this as a const should be constant data, where as an address requires fixups, relocations etc etc
But other assemblers allow to do it. If Ziron also is assembler then why not?
Admin
Site Admin

avatar

(send private message)

Posts: 932
Topics: 54

Location:
OverHertz Studio
[1747] - posted: 2015-02-20 14:37:38
I have added initialized data addresses for variables.

For consts I may consider it, but I'm still not sure if it is not worth it as it has no usability except to over complicate source.

Maybe is the next release I will add it after fixing a few other things.

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:
[1756] - posted: 2015-02-22 15:47:22
Maybe it relevant to this topic:
Code:
program RAW_IMAGE 'test';

#set bits 32;

sysword Values[5];                                                      
eax = @Values[3];

Result:
Code:
00000000  B805000000        mov eax,0x5
00000005  0000              add [eax],al
00000007  0000              add [eax],al
00000009  0000              add [eax],al
0000000B  0000              add [eax],al
0000000D  0000              add [eax],al
0000000F  0000              add [eax],al
00000011  0000              add [eax],al
00000013  0000              add [eax],al
00000015  0000              add [eax],al
00000017  0000              add [eax],al
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1761] - posted: 2015-02-23 01:50:02
Also similar problem:
Code:
program RAW_IMAGE 'test';

#set bits 32;

sysword dValues;
inline procedure TestX() {
  $X = 0;
  $repeat 5:
    ecx = $X; 
    ecx << $log2i(sizeof sysword); 
    ecx += @dValues;
    $X = $X + 1;
  $end
}
testX();

Result:
Code:
00000000  33C9              xor ecx,ecx
00000002  C1E102            shl ecx,0x2
00000005  33C9              xor ecx,ecx
00000007  C1E102            shl ecx,0x2
0000000A  33C9              xor ecx,ecx
0000000C  C1E102            shl ecx,0x2
0000000F  33C9              xor ecx,ecx
00000011  C1E102            shl ecx,0x2
00000014  33C9              xor ecx,ecx
00000016  C1E102            shl ecx,0x2
00000019  0000              add [eax],al
0000001B  0000              add [eax],al
Pages: 1 2 3
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 1 user(s) online. 0 member(s) and 1 guest(s)
Most users ever online was 999, May 11, 2018, 10:01 am.


Statistics:
Threads: 224 | Posts: 1847 | Members: 50 | Active Members: 50
Welcome to our newest member, NobodyAtWork
const Copyright = '2011-2021 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd