Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:00 14 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 : How to use bit manipulation

Author Message
Canada_Cold
Regular Member

Joined: 11/01/2020
Location: Canada
Posts: 48
Posted: 03:32pm 06 Jul 2020
Copy link to clipboard 
Print this post

Hi All,

I’m trying to understand how to use bit manipulation on an Micromite 28 pin device.    In the statement “PRINT HEX$(X%, 16)” what does the second parameter “16” do?

The following is from the Micromite User Manual, MMBasic Ver 5.05, Page 38

X% = &HFFFF0000FFFF0044
Y% = &H800FFFFFFFFFFFFF
X% = X% AND Y%
PRINT HEX$(X%, 16)

I have tried changing the parameter, but it does not change the printed results.

I appreciate any help you can give me with this.

Don
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10578
Posted: 03:35pm 06 Jul 2020
Copy link to clipboard 
Print this post

Try hex$(4) and hex$(4,16)
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2465
Posted: 04:13pm 06 Jul 2020
Copy link to clipboard 
Print this post

it controls padding with zeros to the left. if your number can be represented in less than 16 digits, then it will be padded with leading zeros. try the following:

X% = &HFFFF0000
Y% = &H800FFFFF
X% = X% And Y%
Print Hex$(X%, 16)
Print Hex$(X%, 8)


>
> run
00000000800F0000
800F0000
>
>



cheers,
rob   :-)
 
Canada_Cold
Regular Member

Joined: 11/01/2020
Location: Canada
Posts: 48
Posted: 09:22pm 07 Jul 2020
Copy link to clipboard 
Print this post

Hi guys,

Thanks for the input, that’s great.

Thanks, Don
 
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