flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > [solved]Declare equ as structure

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 27 Jul 2020, 21:25
Hi
Is it possible to redeclare 'equ' as structure somehow?


Last edited by Overclick on 31 Jul 2020, 10:15; edited 1 time in total
Post 27 Jul 2020, 21:25
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1839
Roman 28 Jul 2020, 07:43
maybe help virtual ?

Code:
virtual at esi
some_struct
mov [esi.elem], 0
end virtual
    
Post 28 Jul 2020, 07:43
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 30 Jul 2020, 14:19
I mean:
Code:
struc equ [data] {
   common
   .     equ data
   .a    dd 0
   .b    dd 0
   .c    dd 0
}
    
Post 30 Jul 2020, 14:19
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 30 Jul 2020, 14:24
Did you try it?

There is no harm in trying.
Post 30 Jul 2020, 14:24
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 30 Jul 2020, 14:38
It's not working this way. Of course I did try it.
Post 30 Jul 2020, 14:38
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 30 Jul 2020, 14:40
Your code works for me.
Code:
1 passes, 0 bytes.    
Post 30 Jul 2020, 14:40
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1839
Roman 30 Jul 2020, 14:48
revolution
Quote:

Your code works for me.

How test ? Please show your code.


Last edited by Roman on 30 Jul 2020, 14:56; edited 1 time in total
Post 30 Jul 2020, 14:48
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 30 Jul 2020, 14:56
Roman wrote:
Quote:

Your code works for me.

How test ? Please show your code.
It is the OPs code. I made no alterations.
https://board.flatassembler.net/topic.php?p=215051#215051
Post 30 Jul 2020, 14:56
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 30 Jul 2020, 15:00
revolution. did you tried to use it? I did. No success.
Compiled <> working
Post 30 Jul 2020, 15:00
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 30 Jul 2020, 15:03
What usage do you expect? Show us what you tried. We don't know what you are doing.
Post 30 Jul 2020, 15:03
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 30 Jul 2020, 15:14
Code:
.data
struc equ [somedata] {
        common
        .               equ somedata
        .id             dd 0
}                
test_3 equ 'something'
.code
        mov             [test_3.id],20202020h
    


processed: mov[test_3.id],20202020h
error: undefined symbol 'test_3.id'.
Post 30 Jul 2020, 15:14
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 31 Jul 2020, 00:10
Maybe with fix:
Code:
struc my_equ [somedata] {
        common
        .       equ somedata
        .id     dd 0
}
equ     fix my_equ
test_3  equ 'something'
        mov     [test_3.id],20202020h
        db      test_3    
Post 31 Jul 2020, 00:10
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 31 Jul 2020, 00:25
processed: test_3.id dd 0
error: symbol already defined.
Post 31 Jul 2020, 00:25
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 31 Jul 2020, 00:33
Please show the code you are assembling.
Post 31 Jul 2020, 00:33
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 31 Jul 2020, 10:14
"fix" doesn't work with my multisection macro. It's ignore if..end if condition. That why it tries to declare structure twice.
Otherwise it works fine
Post 31 Jul 2020, 10:14
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 31 Jul 2020, 10:16
I suggest not to use fix anyway. Just use the "my_equ" structure directly.

It is confusing to have EQU do something else IMO.
Post 31 Jul 2020, 10:16
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 31 Jul 2020, 10:36
I would like to use it at short period to declare 50+ imported dialogue items:
Code:
IDC_CDelay0             equ 100
IDC_CDelay1             equ 101
IDC_CDelay2             equ 102
IDC_CDelay3             equ 103
IDC_CDelay4             equ 104
IDC_CDelay5             equ 105
IDC_CDelay6             equ 106
IDC_CDelay7             equ 107    


How to restore "equ" after all?
Code:
restruc equ
restore equ
    

or
use "fix" again?
Post 31 Jul 2020, 10:36
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 31 Jul 2020, 10:42
Are you using your new "equ" or ordinary equ?

Usually dialog IDs use normal =
Code:
IDC_CDelay0             = 100    
Post 31 Jul 2020, 10:42
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 31 Jul 2020, 10:45
I don't choose it, its already like this


Description:
Filesize: 25.49 KB
Viewed: 14340 Time(s)

Capture.PNG


Post 31 Jul 2020, 10:45
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 31 Jul 2020, 10:49
If you are asking how to undo fix then do this:
Code:
A fix B ; now all A's are B's
A fix A ; now all A's are A's    
Post 31 Jul 2020, 10:49
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:  
Goto page 1, 2  Next

< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.