Advertisement
Guest User

Untitled

a guest
Apr 1st, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. (defun swap-bytes (n)
  2. (rotatef (ldb (byte 8 0) n) (ldb (byte 8 24) n))
  3. (rotatef (ldb (byte 8 8) n) (ldb (byte 8 16) n))
  4. n)
  5.  
  6. (let ((n #xA1B2C3D4))
  7. (format t "~x~%" (swap-bytes n)))
  8.  
  9. --> D4C3B2A1
  10. nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement