I have an AMD processor , and if i do a , var = bin( *usp ) ( ushort pointer ) , i have to flop every other byte , after converting them back to chr's
Does Intel have the same output, where you have to flop every other byte?
If i do var+= right( string( 16 , "0" ) + bin( *usp ) , 16 )
and then do var+= chr( val( &B" + mid( str , a , 8 ) ) ) ... The bytes are backwards , and i have to swap every other byte.
Code: Select all
screen 19
dim as string str1 = "0123456789ABCDEF"
dim as string binari = ""
dim as ushort ptr usp = cptr(ushort ptr , strptr(str1))
for a as longint = 1 to len(str1) step 2
binari+=right( string(16,"0") + bin(*usp),16)
usp+=1
next
dim as string outputs=""
for a as longint = 1 to len(binari) step 8
outputs+=chr(val("&B"+mid(binari,a,8)))
next
print str1
print outputs
sleep
end