Unsigned dword/qword

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Unsigned dword/qword

Post by idle »

,trying to do unsigned x86/x64 asm c backend and arm is messy,
Please add unsigned types.
Quin
Addict
Addict
Posts: 1125
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Unsigned dword/qword

Post by Quin »

+1
User avatar
Mijikai
Addict
Addict
Posts: 1517
Joined: Sun Sep 11, 2016 2:17 pm

Re: Unsigned dword/qword

Post by Mijikai »

+1
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Unsigned dword/qword

Post 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   
moricode
Enthusiast
Enthusiast
Posts: 162
Joined: Thu May 25, 2023 3:55 am

Re: Unsigned dword/qword

Post by moricode »

this is year 2024 , we still need to request this unsigned things to go to the space station
Post Reply