flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Macroinstructions > How compare two irpv lists? | 
| Author | 
 | 
| Roman 14 Mar 2023, 14:15 I try this, but doubled c
 Code: AA equ ccc AA equ ccc3 BB equ ccc BB equ ccc3 CC equ inc eax CC equ inc ebx irpv c, CC { urr = 1 irpv b, AA \{ irpv v, BB \\{ if v eq b display 'ok;;' if urr = 1 c urr = 0 end if end if \\} \} } | |||
|  14 Mar 2023, 14:15 | 
 | 
| bitRAKE 14 Mar 2023, 14:30 We have eight copies of the inner branch, and four cases that pass the first if. | |||
|  14 Mar 2023, 14:30 | 
 | 
| ProMiNick 14 Mar 2023, 14:31 Code: field@struct equ hello field@struct equ hello2 field2@struct equ hello field2@struct equ hello2 field3@struct equ hello3 field3@struct equ hello2 irpv fields,field@struct { common define fields@name fields } ; taken from struct macroset irpv fields,field2@struct { common define fields2@name fields } irpv fields,field3@struct { common define fields3@name fields } if fields@name eq fields2@name display 'OK',13,10 end if if fields3@name eq fields2@name display 'noOK',13,10 end if if fields3@name eq fields@name display 'noOKtoo',13,10 end if | |||
|  14 Mar 2023, 14:31 | 
 | 
| Roman 14 Mar 2023, 14:46 ProMiNick
 Your joined all names to one. And this geting problems with compare different names. You variant compare hello,hello2 with hello,hello2 This variant not for my case. | |||
|  14 Mar 2023, 14:46 | 
 | 
| Roman 14 Mar 2023, 14:54 bitRAKE wrote: We have eight copies of the inner branch, and four cases that pass the first if. We needed normal irpvs ! And we might compared many lists(More then two). Then code look like this Code: A equ in1 A equ in2 ;many values 35 B equ in1 B equ in2 ;many values 35 C equ call procA C equ call procB ;many values 35 irpvs x,y,z A B C { if x eq y z end if } | |||
|  14 Mar 2023, 14:54 | 
 | 
| Tomasz Grysztar 14 Mar 2023, 15:08 As I understand, you want to iterate several lists in parallel. You could do that with numbered names:     Code: struc equs value& { match =.#%, .#% \{ .#% equ 0 \} rept 1 i:.#%+1 \{ .#% equ i .\#i equ value \} } A equs in1 ; A1 equ 1 A equs in2 ; A2 equ 2 ; ... B equs in1 B equs in2 ; ... C equs call procA C equs call procB ; ... ; A%, B%, C% are counts of values in each list rept A% i:1 { if A#i eq B#i C#i end if } | |||
|  14 Mar 2023, 15:08 | 
 | 
| Roman 14 Mar 2023, 15:10 Wow !
   Thanks Tomasz Grysztar. This is i wanted. | |||
|  14 Mar 2023, 15:10 | 
 | 
| Roman 14 Mar 2023, 17:28 Problem with macro.
 Code: macro attt { invoke MessageBox,0,0,0,0 } C equs attt rept A% i:1 { if A#i eq B#i C#i ;fasm error illegal instruction attt end if } | |||
|  14 Mar 2023, 17:28 | 
 | 
| macomics 14 Mar 2023, 17:34 Code: struc equs value& { match =.#%, .#% \{ .#% equ 0 \} rept 1 i:.#%+1 \{ .#% equ i .\#i equ value \} } macro invoke [name] {} macro attt { invoke MessageBox,0,0,0,0 } A equs in1 ; A1 equ 1 A equs in2 ; A2 equ 2 B equs in1 B equs in2 C equs attt C equs attt rept A% i:1 { if A#i eq B#i match x,C#i \{ x \};fasm error illegal instruction end if } | |||
|  14 Mar 2023, 17:34 | 
 | 
| Roman 14 Mar 2023, 17:39 macomics
 Thanks. Now work fine. And work without macro invoke [name] {} | |||
|  14 Mar 2023, 17:39 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.