flat assembler
Message board for the users of flat assembler.

Index > Main > Two problems FASM 1.66.7; using struct

Author
Thread Post new topic Reply to topic
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 22 Aug 2006, 18:10
Hi,
Since when did FASM start checking for running instances - its rather annoying when all my files open up in one window as tabs. I want to keep projects in separate windows, because I can't tell FASM which files go with which project Sad I didn't find any new flags that I can tick. Btw, FASM 1.66 doesn't have this problem and so I make use of this when I want to open more instances.
Will it be reverted yes / no / that's my own fault?

Second one is about using struct:
Code:
struct IHDR
    length rd 1
    width  rd 1
    height rd 1
    bitdep rb 1
    coltyp rb 1
    commet rb 1
    filmet rb 1
    intmet rb 1
ends 
    

someone might recognize the PNG there Smile
Using this is in fact very easy:
Code:
    ;esi points to the beginning of a PNG-file
    mov     ecx,[esi+8]                 ; Length of header
    bswap   ecx
    mov     [ihdr.length],ecx 
    

The problem is that the addressing mode is too long and I would like
to make it register-based:
Code:
    mov     edi,ihdr
    mov     ecx,[esi+8]                 ; Length of header
    bswap   ecx
    mov     [edi+ihdr.length-ihdr],ecx 
    

Oh that horror Sad edi=ihdr so its comes out pretty pointless:
Code:
[ihdr+ihdr.length-ihdr] ; Very Happy heh
;of course .length is not defined:
[edi+.length] ; an error
    


My question is if there is a more elegant solution or maybe somehow I can
tell ihdr.length that its not absolute, but ihdr-based ^o)

Thanks

_________________
My updated idol Very Happy http://www.agner.org/optimize/
Post 22 Aug 2006, 18:10
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8358
Location: Kraków, Poland
Tomasz Grysztar 22 Aug 2006, 18:22
Madis731 wrote:
Hi,
Since when did FASM start checking for running instances (...)?

Since this: http://board.flatassembler.net/topic.php?t=5510

Madis731 wrote:
Will it be reverted yes / no / that's my own fault?

All I can do about it is maybe an option to create a new instances.

Madis731 wrote:
Second one is about using struct: (...)

First of all, I'd recommend reading carefully the docs.
And look also here: http://board.flatassembler.net/topic.php?t=1905
(and maybe also here: http://board.flatassembler.net/topic.php?t=4893 and here: http://board.flatassembler.net/topic.php?t=4612).
Post 22 Aug 2006, 18:22
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 22 Aug 2006, 18:30
The aswer was there Very Happy - if I only had looked more carefully. At first I didn't understand the "carefully"...
...I need to point to the structure NOT the instance of that structure Razz

Sorry!
Post 22 Aug 2006, 18:30
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8358
Location: Kraków, Poland
Tomasz Grysztar 22 Aug 2006, 18:37
You can still create a specialized instance for the register-based addressing, however it seems people are not so enthusiastic about this feature. Wink
Post 22 Aug 2006, 18:37
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.