Jump to content
Sign in to follow this  
huckster505

Bug? Maybe?

Recommended Posts

Gentlemen;

 

The program fragment below illustrates what I believe to be a bug.

It is intended to drive an LED bargraph, but always produces a dark display.

When I replaced the variable governing the shift in the portb assignment, the display works properly; and the .casm results show this. However, the portc assignment results in assembly which will shift the temporary variable Con_Temp_Var85 the proper number of times with the count variable "fuel"

tracked in "W". When "W" reaches 0, the value in "W" (now 0) is moved to portc.

 

C program fragment:

disp = 0x01; // turn on bit

portb = disp << 3; // shift to desired location

disp = 0x01; // turn on bit

portc = disp << fuel; // shift to desired location

 

 

.casm file fragment:

 

disp = 0x01 // turn on bit

01AC 3001 MOVLW 0x01

01AD 00A6 MOVWF main_1_disp

 

portb = disp << 3; // shift to desired location

 

01AE 00B0 MOVWF CompTempVar84

01AF 0DB0 RLF CompTempVar84, F

01B0 0DB0 RLF CompTempVar84, F

01B1 0D30 RLF CompTempVar84, W

01B2 39F8 ANDLW 0xF8

01B3 0086 MOVWF gbl_portb

 

disp = 0x01 // turn on bit

 

01B4 3001 MOVLW 0x01

01B5 00A6 MOVWF main_1_disp

 

portc = disp << fuel; // shift to desired location

 

01B6 00B0 MOVWF CompTempVar85

01B7 0824 MOVF main_1_fuel, W

01B8 label268436719

01B8 39FF ANDLW 0xFF

01B9 1903 BTFSC STATUS,Z

01BA 29BF GOTO label268436720

01BB 1003 BCF STATUS,C

01BC 0DB0 RLF CompTempVar85, F

01BD 3EFF ADDLW 0xFF

01BE 29B8 GOTO label268436719

01BF label268436720

01BF 0087 MOVWF gbl_portc

 

On edit: using BoostC... sri

Thanks,

Huck

Edited by huckster505

Share this post


Link to post
Share on other sites

Huck,

 

Which version of BoostC are you using ?

 

Regards

Dave

Share this post


Link to post
Share on other sites

Huck,

 

Definately a bug :(

 

Regards

Dave

Share this post


Link to post
Share on other sites

This was a bug in the compiler. Now fixed. Now we look at couple more issues reported recently. Once they are fixed we plan to release a patch with all these fixes. Thanks for reporting.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...