Page 6 of 6

Re: Unsigned dword/qword

Posted: Sun Jan 14, 2024 3:32 am
by idle
,trying to do unsigned x86/x64 asm c backend and arm is messy,
Please add unsigned types.

Re: Unsigned dword/qword

Posted: Sun Jan 14, 2024 10:58 pm
by Quin
+1

Re: Unsigned dword/qword

Posted: Sun Jan 14, 2024 11:24 pm
by Mijikai
+1

Re: Unsigned dword/qword

Posted: Mon Jan 15, 2024 3:02 am
by idle
For instance this looks like complicated goop because ROR and ROL cant be done in a macro because of SAR <<
and even then it might still fail if the assignments cast to signed

Code: Select all

Procedure speck_decrypt(*ct.speck_arl,*pt.speck_arl,*k.speck_arl)
  
  Protected t.l, i.l 
  *pt\e[0]= *ct\e[0] 
  *pt\e[1]= *ct\e[1]
  
  For i = 0 To 26 
    *pt\e[0] ! *pt\e[1]
    t = *pt\e[0] 
    CompilerIf #PB_Compiler_Backend = #PB_Backend_Asm  
      !ror dword [p.v_t] , 3 
    CompilerElse 
      !unsigned int tt =  (unsigned int) v_t;  
      !v_t = (unsigned int) ((tt >> 3) | (tt << ((32) - 3))); 
    CompilerEndIf   
    *pt\e[0] = t 
    *pt\e[1] ! *k\e[26 - i]
    *pt\e[1] - *pt\e[0] 
    t = *pt\e[1]
    CompilerIf #PB_Compiler_Backend = #PB_Backend_Asm   
      !rol dword [p.v_t],8  	
    CompilerElse 
      !tt =  (unsigned int) v_t;  
      !v_t = (unsigned int) ((tt << 8) | (tt >> ((32) - 8)));
    CompilerEndIf  
    *pt\e[1] = t
  Next 
  
EndProcedure   

Re: Unsigned dword/qword

Posted: Mon Jan 15, 2024 3:09 am
by moricode
this is year 2024 , we still need to request this unsigned things to go to the space station