Byte swap in C Backend?

Bare metal programming in PureBasic, for experienced users
Wolfram
Enthusiast
Enthusiast
Posts: 604
Joined: Thu May 30, 2013 4:39 pm

Byte swap in C Backend?

Post by Wolfram »

How can I do a 16Bit or 32Bit Byte swap in C?
In Assembly I can use one operation to do it. How can I get the same result of Code in PB C Backend?

16 Bit
!rol ax, 8

32Bit
!bswap eax
macOS Catalina 10.15.7
infratec
Always Here
Always Here
Posts: 7616
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Byte swap in C Backend?

Post by infratec »

Wolfram
Enthusiast
Enthusiast
Posts: 604
Joined: Thu May 30, 2013 4:39 pm

Re: Byte swap in C Backend?

Post by Wolfram »

👍
macOS Catalina 10.15.7
Post Reply