Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def hexdo (a : UInt32)
- ptr_result=Pointer(UInt8).malloc(8, 10_u8)
- add_this=0x2020202020202020_u64
- puts pointerof(add_this).address
- asm("
- movl ($0), %eax
- movd %eax, %mm0
- shrl $$4, %eax
- movd %eax, %mm1
- punpcklbw %mm0, %mm1
- paddb ($2), %mm1
- movq %mm1, ($1)
- " :: "r"(pointerof(a).address),"r"(ptr_result.address),"r"(pointerof(add_this)
- ptr_result
- end
- x=0xA0B1C2D3_u32
- sp=Slice.new(hexdo(x), 8)
- puts sp.map{|c| c.unsafe_chr }.join
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement