flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Rept problem.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 08 Sep 2024, 06:21
Fasmw 1.73
Fasm error: invalid value
Code:
DbgCC equ xmDat
macro dbg [a] { rept 1 n: DbgCC+16 \{ movaps dqword [DbgCC], xmm#a
DbgCC equ n \}} 

;align 16 xmDat rd 8000
;in code 
dbg 1

    
Post 08 Sep 2024, 06:21
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20443
Location: In your JS exploiting you and your system
revolution 08 Sep 2024, 06:26
xmDat is undefined. So xmDat + 16 is also undefined.
Post 08 Sep 2024, 06:26
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 08 Sep 2024, 06:45
This variant work.
Code:
DbgCC equ 0
macro dbg [a] { rept 1 n: DbgCC+16 \{ movaps dqword [xmDat+DbgCC], xmm#a
DbgCC equ n \}} 

;align 16 xmDat rd 8000
;in code 
dbg 1

    
Post 08 Sep 2024, 06:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20443
Location: In your JS exploiting you and your system
revolution 08 Sep 2024, 06:52
Doesn't work for me.
Code:
flat assembler  version 1.73.31  (16384 kilobytes memory)
test.asm [7]:
dbg 1
test.asm [2] dbg [0]:
macro dbg [a] { rept 1 n: DbgCC+16 \{ movaps dqword [xmDat+DbgCC], xmm#a
test.asm [2] rept [0]:
macro dbg [a] { rept 1 n: DbgCC+16 \{ movaps dqword [xmDat+DbgCC], xmm#a
processed: movaps dqword[xmDat+0],xmm1
error: undefined symbol 'xmDat'.    
is still undefined, same as above.

BTW: you don't need rept there, since the "+16" can be evaluated by the assembler just fine.
Post 08 Sep 2024, 06:52
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: 20443
Location: In your JS exploiting you and your system
revolution 08 Sep 2024, 06:54
Code:
xmDat = 0x12345678

DbgCC equ 0
macro dbg [a] {
        movaps dqword [xmDat+DbgCC], xmm#a
        DbgCC equ DbgCC + 16
} 

dbg 1    
No rept required.
Post 08 Sep 2024, 06:54
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1847
Roman 08 Sep 2024, 08:13
Quote:
Doesn't work for me.

Just write in data:
Code:
 
align 16
xmDat dd or rd 800
    
Post 08 Sep 2024, 08:13
View user's profile Send private message 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.