flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > include data only once |
Author |
|
macomics 22 Dec 2024, 16:03
Code: macro vecAdd v1=we1,v2=we2 { local .a movups xmm0,dqword [v1] movups xmm1,dqword [v2] addps xmm1,xmm0 if ~defined we1 | @f @@: jmp .a we1 dd 0,0,0,0 we2 dd 0,0,0,0 .a: end if } Start: vecAdd ;ok vecAdd ;fasm error symbol we1 already defined. |
|||
22 Dec 2024, 16:03 |
|
Roman 22 Dec 2024, 17:46
this work.
Code: macro vecAdd v1=we1,v2=we2 { local aa movups xmm0,dqword [v1] movups xmm1,dqword [v2] addps xmm1,xmm0 if ~definite we1 jmp aa we1 dd 0,0,0,0 we2 dd 0,0,0,0 aa: end if } Start: vecAdd vecAdd |
|||
22 Dec 2024, 17:46 |
|
Overclick 23 Jan 2025, 10:08
You can try multisection mode:
Code: macro vecAdd v1=we1,v2=we2 { local aa movups xmm0,dqword [v1] movups xmm1,dqword [v2] addps xmm1,xmm0 .dataonce vecAdd we1 dd 0,0,0,0 we2 dd 0,0,0,0 .code } Start: vecAdd vecAdd Or even like this: Code: macro vecAdd v1=we1,v2=we2 { local aa movups xmm0,dqword [v1] movups xmm1,dqword [v2] addps xmm1,xmm0 ..dataonce we1, we1 dd 0,0,0,0 ..dataonce we2, we2 dd 0,0,0,0 } Start: vecAdd vecAdd Or even by stream: Code: macro vecAdd v1=we1,v2=we2 { local aa movups xmm0,dqword [v1] movups xmm1,dqword [v2] addps xmm1,xmm0 .frameonce vecAdd we1 dd 0,0,0,0 we2 dd 0,0,0,0 .code } .multisection section .data data readable writeable .stream vecAdd section .code code readable executable Start: vecAdd vecAdd Any of this examples will free your code from using extra jumps at least |
|||
23 Jan 2025, 10:08 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.