Just starting out? Need help? Post your questions and find answers here.
-
Piero
- Addict

- Posts: 1040
- Joined: Sat Apr 29, 2023 6:04 pm
- Location: Italy
Post
by Piero »
Does Debug consider ~a as ~integer?
Code: Select all
a.a = 1
Debug ~a ; -2
a = ~1
Debug a ; 254
-
SMaag
- Enthusiast

- Posts: 327
- Joined: Sat Jan 14, 2023 6:55 pm
- Location: Bavaria/Germany
Post
by SMaag »
PB result is absolut correct.
.a is an ASII = unsigned Byte 0..255.
Not 1 = 254 -> correct
-
mk-soft
- Always Here

- Posts: 6315
- Joined: Fri May 12, 2006 6:51 pm
- Location: Germany
Post
by mk-soft »
Be careful. The debugger considers everything as a signet. Is unfortunately so ;(
-
Piero
- Addict

- Posts: 1040
- Joined: Sat Apr 29, 2023 6:04 pm
- Location: Italy
Post
by Piero »
mk-soft wrote: Thu Feb 13, 2025 7:09 pm
Be careful. The debugger considers everything as a signet. Is unfortunately so ;(
Thanks mk-soft! …but you didn't answer to my question ;( ;( ;(
-
mk-soft
- Always Here

- Posts: 6315
- Joined: Fri May 12, 2006 6:51 pm
- Location: Germany
Post
by mk-soft »
Piero wrote: Thu Feb 13, 2025 6:08 pm
Does Debug consider ~a as ~integer?
Code: Select all
a.a = 1
Debug ~a ; -2
a = ~1
Debug a ; 254
Yes, but for the program is an unsigned byte. It's a debugger output failure ...
-
idle
- Always Here

- Posts: 6026
- Joined: Fri Sep 21, 2007 5:52 am
- Location: New Zealand
Post
by idle »
Code: Select all
a.a = 1
Debug Bin(~a,#PB_Ascii) ; -2
a = ~1
Debug Bin(~a,#PB_Ascii) ;
-
Piero
- Addict

- Posts: 1040
- Joined: Sat Apr 29, 2023 6:04 pm
- Location: Italy
Post
by Piero »
Resuming:
Bitwise operations on variables in Debug always return a (signed) Byte!
Be careful!