Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun swap-bytes (n)
- (rotatef (ldb (byte 8 0) n) (ldb (byte 8 24) n))
- (rotatef (ldb (byte 8 8) n) (ldb (byte 8 16) n))
- n)
- (let ((n #xA1B2C3D4))
- (format t "~x~%" (swap-bytes n)))
- --> D4C3B2A1
- nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement