Page 1 of 1

Bitwise Debug

Posted: Thu Feb 13, 2025 6:08 pm
by Piero
Does Debug consider ~a as ~integer?

Code: Select all

a.a = 1
Debug ~a ; -2
a = ~1
Debug  a ; 254

Re: Bitwise Debug

Posted: Thu Feb 13, 2025 6:41 pm
by SMaag
PB result is absolut correct.
.a is an ASII = unsigned Byte 0..255.
Not 1 = 254 -> correct

Re: Bitwise Debug

Posted: Thu Feb 13, 2025 7:09 pm
by mk-soft
Be careful. The debugger considers everything as a signet. Is unfortunately so ;(

Re: Bitwise Debug

Posted: Thu Feb 13, 2025 8:50 pm
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 ;( ;( ;(

Re: Bitwise Debug

Posted: Thu Feb 13, 2025 9:21 pm
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 ...

Re: Bitwise Debug

Posted: Thu Feb 13, 2025 9:36 pm
by idle

Code: Select all

a.a = 1
Debug Bin(~a,#PB_Ascii) ; -2
a = ~1
Debug Bin(~a,#PB_Ascii) ;

Re: Bitwise Debug

Posted: Thu Feb 13, 2025 10:11 pm
by Piero
Resuming:
Bitwise operations on variables in Debug always return a (signed) Byte!
Be careful!