flat assembler
Message board for the users of flat assembler.
  
       
      Index
      > Main > [SOLVED] FASM2 error on operand sizes do not match | 
  
| Author | 
  | 
              
| 
                  
                   rrq 22 Mar 2024, 07:16 
                  Put a size qualifier with the operand, as in:
 
                  
                Code: mov dword [sListViewItem + LV_ITEM.iItem],eax  | 
              |||
                  
  | 
              
| 
                  
                   Tomasz Grysztar 22 Mar 2024, 08:06 
                  The label "sListViewItem" has an associated size (the size of entire structure) and this size takes precedence over the size data of "LV_ITEM.iItem". You can see that if you reverse their order:     
                  
                Code: mov [LV_ITEM.iItem + sListViewItem],eax Code: mov [sListViewItem.iItem],eax Code: mov [ebx + LV_ITEM.iItem],eax In fasm 1 structure labels had no size data associated with them, because there was only a limited set of sizes that you could use - with fasmg this improved. Note that this allows use of constructions like "sizeof sListViewItem".  | 
              |||
                  
  | 
              
| 
                  
                   revolution 22 Mar 2024, 08:38 
                  Tomasz Grysztar wrote: The label "sListViewItem" has an associated size (the size of entire structure) and this size takes precedence over the size data of "LV_ITEM.iItem".  | 
              |||
                  
  | 
              
| 
                  
                   Tomasz Grysztar 22 Mar 2024, 08:45 
                  revolution wrote: 
 ctl3d32: You can also get the original code to assemble by modifying the "macro/struct.inc" and removing the size from the main label (it's right at the start of "struct?.instantiate" implementation).  | 
              |||
                  
  | 
              
| 
                  
                   ctl3d32 22 Mar 2024, 11:05 
                  Thank you all for the quick response!
 
                  
                Code was fixed by using offset labels as it was inteded to: Code: mov [ebx + LV_ITEM.iItem],eax  | 
              |||
                  
  | 
              
< Last Thread | Next Thread >  | 
    
Forum Rules: 
  | 
    
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.