flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 28 Aug 2025, 23:13
A construct like this might work:
Code: macro set a,b,c,d { mov eax,a match x=,y , b { mov ebx,y add ebx,100 rept 0 {\} rept 1 { mov ebx,b \} mov ecx,c mov edx,d } set 1,2,3,4 set 1,<!,2>,3,4 Code: mov eax,0x1 mov ebx,0x2 mov ecx,0x3 mov edx,0x4 mov eax,0x1 mov ebx,0x2 add ebx,byte +0x64 mov ecx,0x3 mov edx,0x4 |
|||
![]() |
|
Roman 29 Aug 2025, 08:12
Unusual method using rept 0 {\} .
Interesting info. |
|||
![]() |
|
chiacorp 29 Aug 2025, 17:13
revolution wrote: A construct like this might work: ********************* Here is the macro I got! The goal is achieved, thanks to revolution. You need to mark the offset parameter to add the base address. macro sys f*,p1,p2,p3,p4,p5,p6{ if ~eq p6 match x=,y,p6{mov r11,y add r11,hbase rept 0{\}rept 1{mov r11,p6\} end if if ~eq p5 match x=,y,p5{mov r10,y add r10,hbase rept 0{\}rept 1{mov r10,p5\} end if if ~eq p4 match x=,y,p4{mov r9,y add r9,hbase rept 0{\}rept 1{mov r9,p4\} end if if ~eq p3 match x=,y,p3{mov r8,y add r8,hbase rept 0{\}rept 1{mov r8,p3\} end if if ~eq p2 match x=,y,p2{mov rdx,y add rdx,hbase rept 0{\}rept 1{mov rdx,p2\} end if if ~eq p1 match x=,y,p1{mov rcx,y add rcx,hbase rept 0{\}rept 1{mov rcx,p1\} end if call f} sys proc dword,<!,offset>,qwords It's not clear how it works though) |
|||
![]() |
|
revolution 30 Aug 2025, 00:55
Perhaps the formatting is confusing. Maybe if it is formatted in a more "normal" way it makes more sense?
Here is the same code, just formatted differently: Code: macro set a,b,c,d { mov eax,a ; first stage match match x=,y , b \{ mov ebx,y add ebx,100 rept 0 \{ \} ; second stage if above does not match rept 1 \{ mov ebx,b \} mov ecx,c mov edx,d } set 1,2,3,4 set 1,<!,2>,3,4 |
|||
![]() |
|
chiacorp 30 Aug 2025, 03:04
revolution wrote: Perhaps the formatting is confusing. Maybe if it is formatted in a more "normal" way it makes more sense? It is unclear by what algorithm the action is determined, the condition is missing. At least it seems so. |
|||
![]() |
|
revolution 30 Aug 2025, 03:53
match emits "rept 0" as the final line, disabling the following "rept 1".
Code: rept 0 { rept 1 { ; this now has no effect. It isn't emitted mov ... ; not emitted } |
|||
![]() |
|
chiacorp 31 Aug 2025, 04:23
The fastcall macro of the proc 64 file has a function to determine the size of the operand and whether it is an address. It is difficult to understand from the macro how it works. What is the easiest way to use this feature?
if vararg@fastcall & ~ param eq rcx movq rcx,xmm0 end if else if type@param eq addr if ~ param eq rcx lea rcx,[param] end if else if size@param = 8 if ~ param eq rcx mov rcx,param end if else if size@param = 4 if ~ param eq ecx mov ecx,param end if else if size@param = 2 if ~ param eq cx mov cx,param end if else if size@param = 1 if ~ param eq cl mov cl,param end if end if |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.