Search found 6 matches

by rmgregory
Tue Dec 17, 2019 4:19 pm
Forum: Coding Questions
Topic: Negative Longword Constants Specified Via Hexadecimal
Replies: 7
Views: 2330

Re: Negative Longword Constants Specified Via Hexadecimal

I agree that the x86 version produces the less-correct result; however, that doesn't change the picture much. Many Windows constants (of those in common use, at least 60 supplied in the PureBasic definitions) use the high bit of a longword (that is, are negative longwords): when such constants are ...
by rmgregory
Tue Oct 08, 2019 3:12 pm
Forum: Coding Questions
Topic: Negative Longword Constants Specified Via Hexadecimal
Replies: 7
Views: 2330

Re: Negative Longword Constants Specified Via Hexadecimal

I agree that the difficulty varies based on the manner in which a constant is used; however, this doesn't make it less of an issue. The behavior isn't documented and is difficult to detect: in the code below, note that the x86 behavior matches the x64 behavior except when the variable is directly ...
by rmgregory
Mon Oct 07, 2019 2:16 pm
Forum: Coding Questions
Topic: Negative Longword Constants Specified Via Hexadecimal
Replies: 7
Views: 2330

Re: Negative Longword Constants Specified Via Hexadecimal

Yes, a defect. Try:

#MyConstantA = $81010000
#MyConstantB = -2130640896 ;(same value in decimal notation)
Debug Hex(#MyConstantA, #PB_Long)
Debug Hex(#MyConstantB, #PB_Long)

YOU ARE REINFORCING MY POINT! A longword constant defined via hexadecimal notation does not behave the same as a longword ...
by rmgregory
Sun Oct 06, 2019 10:38 pm
Forum: Coding Questions
Topic: Negative Longword Constants Specified Via Hexadecimal
Replies: 7
Views: 2330

Negative Longword Constants Specified Via Hexadecimal

In versions 5.71 and 5.70 of the 64-bit Windows editions of PureBasic, a negative longword constant which is defined via hexadecimal notation is treated as a (positive) quadword (that is, as an "integer" on the platform). This can cause significant confusion!! For example:

EnableExplicit ...
by rmgregory
Tue May 28, 2019 11:51 am
Forum: Feature Requests and Wishlists
Topic: Fully Display Linker Errors
Replies: 0
Views: 1072

Fully Display Linker Errors

Currently, a link error is displayed in a fixed-size popup window and will typically be truncated (due to the display of innocuous warnings regarding variant segment attributes). It would be helpful if the complete text of any link error was displayed in the log region of the IDE.

Background: In ...
by rmgregory
Mon Jun 13, 2016 6:28 pm
Forum: Feature Requests and Wishlists
Topic: Esoteric Wish For Branch-Likely Hint
Replies: 0
Views: 1266

Esoteric Wish For Branch-Likely Hint

It would be great to be able to tag an IF as a likely branch -- perhaps LikelyBranchingIf -- causing the compiler to emit the static-branch-likely-hint prefix (0x3E) to the conditional emitted in the assembly code. Since there is a work-around (albetit rather ugly), this is a low-priority wish.

The ...