Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:35 10 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Sign extending a value from any bit

Author Message
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2171
Posted: 10:49pm 31 Jan 2018
Copy link to clipboard 
Print this post

New Function posted to the library to sign extend any bit to the full 64 bit width of an integer.

Useful for making two's compliment bytes play nicely in eight byte integers (like the temperature register of the DS3231 and variants).

http://fruitoftheshed.com/MMBasic.Sign-Extend-an-Integer.ashx?&NS=MMBasic
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025