Register | Login
Forum Index > Bugs and Fixes > Not included in output file
Author Message
Pages: 1 2
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1565] - posted: 2015-01-31 02:49:53
I have now implemented this for next release.

Code:
byte b1[] = 'Hello World!';


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:
[1567] - posted: 2015-01-31 12:08:38
Code:
// not included because not used
dword d1 = 0x12345678;


Code:
// not included BUT used
dword d1 = 0x12345678;
eax = 0;
eax = [eax + @d1];


Code:
// included BUT NOT used(only address used, not value)
dword d1 = 0x12345678;
eax = @d1;


What would can be recommended?

first way: add extra option for this
second way: use option #optimise for this
third way: always include all data

As for third way then it similar to usual behavior of many other assemblers.

Just compare:

Ziron:
Code:
dword MyVariable = 0x12345678;
MyVariable; // <<-- this also need to write


Other:
Code:
MyVariable dd 0x12345678 // <<-- that's all enough!

It may be hard to determine is value used or not.
For example if programmer already knows address. He can use direct address.
Anyway such assembler restrictions not so useable. I think that programmer would like more easy way without extra actions.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1571] - posted: 2015-01-31 13:39:07
Second code, I will correct, this was a small overlook, I forgot to set var as used. I will also add directive to always write data.

Of course using vars to write data is not the norm....

Asm
Code:
MyVariable dd 0x12345678


Ziron
Code:
emit dword 0x12345678;



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
[1577] - posted: 2015-01-31 15:09:45
OK, I have corrected [@d] setting variable active and I have also added a new directive "awd" - always write data.

Code:
program RAW_IMAGE 'test';

#set bits 32;
#set awd true;

byte b1[] = 'Hello World!';


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:
[1662] - posted: 2015-02-10 17:19:40
Optimizations on high level ofcourse very useful. But not on LOW level.
i.e. for example Code:
mov al, al

Because programmer wrote it not just for fun. Therefore he need it.
May be you also will remove Code:
xchg eax, eax; (NOP)
?
My point -- optimizations need only on high level.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1668] - posted: 2015-02-11 13:46:51
I have fixed this.

Code:
eax = eax;
will be optimised by default
Code:
mov eax, eax
will be output as written.

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:
[1702] - posted: 2015-02-14 19:30:17
Here is 'dword d1' not included in output mscoff file:
Code:
program MSCOFF 'test';   
#set bits 32;
dword d1 = 1;
d1;
http://pastebin.com/Szq8Q1B3

But here is included:
Code:
program MSCOFF 'test';   
#set bits 32;
dword d1 = 1;
eax = d1;
http://pastebin.com/E180MVAr

Also seems there are unnecessary Code:
_GetProcessHeap@0
__smm_hHeap
Pages: 1 2
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 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