Mac 0 Posted July 12, 2008 Report Share Posted July 12, 2008 Found following bit access problem using BoostC version 6.87; // BoostC code unsigned int TxChar = 0; void main() { TxChar.4 = 1; // set bit 4 TxChar.9 = 1; // set bit 9 } // assembler output sets bit 1 in the low byte rather than // bit 1 in the high byte at "gbl_TxChar+d'1'" // // 0052 1623 BSF gbl_TxChar,4 // 0053 14A4 BSF gbl_TxChar,1 Quote Link to post Share on other sites
Reynard 0 Posted July 13, 2008 Report Share Posted July 13, 2008 Definitely a bug. Workaround: set_bit(TxChar,9); or TxChar |= (1 << 9); seem to work. Cheers Reynard Quote Link to post Share on other sites
cac001 0 Posted July 14, 2008 Report Share Posted July 14, 2008 Definitely not a bug: ;Address Opcode Disassembly ; 052 1623 BSF 0x23, 0x4 ; 053 14A4 BSF 0x24, 0x1 Quote Link to post Share on other sites
Pavel 0 Posted July 14, 2008 Report Share Posted July 14, 2008 Found following bit access problem using BoostC version 6.87; // BoostC code unsigned int TxChar = 0; void main() { TxChar.4 = 1; // set bit 4 TxChar.9 = 1; // set bit 9 } // assembler output sets bit 1 in the low byte rather than // bit 1 in the high byte at "gbl_TxChar+d'1'" // // 0052 1623 BSF gbl_TxChar,4 // 0053 14A4 BSF gbl_TxChar,1 For this code correct opcodes get generated. Your program will run as intended. It's only the instruction that gets displayed incorrectly as if it uses low byte. So the reported problem seems not to be a problem but it reveals another one that is a problem though much more minor. Regards, Pavel Quote Link to post Share on other sites
Mac 0 Posted July 18, 2008 Author Report Share Posted July 18, 2008 For this code correct opcodes get generated. Your program will run as intended. It's only the instruction that gets displayed incorrectly as if it uses low byte. So the reported problem seems not to be a problem but it reveals another one that is a problem though much more minor. Regards, Pavel Thank you Pavel... Mike Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.