Hi, I'm working with the DSP56F803 for sometime in C and I just begun using inline assembly in my code today. unsigned int To_Out; To_Out = 0x40A1 asm (move To_Out,A); asm (rol A); asm (move A,To_Out); Since the carry was 1, the contents of A1 was 0x8123 after the rol instruction. The problem is with the "move A,To_Out". After the move instruction, the contents of To_Out was 0x7FFF not 0x8123. I tried other value and it's work fine for some. Thanks for the help. Bruno |
|
Strange assembler move instruction
Started by ●February 19, 2003
Reply by ●February 19, 20032003-02-19
One thing you could check is the setting of the OMR's Saturation (SA),
Rounding (R), and Condition Code (CC) bits, which affect the saturation, limiting, and rounding of the data in the accumulators (A and B). Please see the following Sections in the DSP56800 Family Manual: Section 3.4 "Saturation and Data Limiting" Section 3.4.2 "MAC Output Limiter" Section 3.5 "Rounding" Section 3.6 "Condition Code Generation" Section 5.1.9 "Operating Mode Register" I hope this helps. Regards, Art Johnson Senior Systems Analyst PMC Prime Mover Controls Inc. 3600 Gilmore Way Burnaby, B.C., Canada V5G 4R8 Phone: 604 433-4644 FAX: 604 433-5570 Email: http://www.pmc-controls.com -----Original Message----- From: Bruno Tremblay [mailto:] Sent: Wednesday, February 19, 2003 9:50 AM To: Subject: [motoroladsp] Strange assembler move instruction Hi, I'm working with the DSP56F803 for sometime in C and I just begun using inline assembly in my code today. unsigned int To_Out; To_Out = 0x40A1 asm (move To_Out,A); asm (rol A); asm (move A,To_Out); Since the carry was 1, the contents of A1 was 0x8123 after the rol instruction. The problem is with the "move A,To_Out". After the move instruction, the contents of To_Out was 0x7FFF not 0x8123. I tried other value and it's work fine for some. Thanks for the help. Bruno _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/motoroladsp More Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/ |
|
Reply by ●February 19, 20032003-02-19
Thanks Art and Chuck, I found the answer in the section 3.4.1. By using A1 instead of A, it disable the limiter that cause the saturation. Bruno --- In , "Art Johnson" <art@p...> wrote: > One thing you could check is the setting of the OMR's Saturation (SA), Rounding (R), and Condition Code (CC) bits, which affect the saturation, limiting, and rounding of the data in the accumulators (A and B). Please see the following Sections in the DSP56800 Family Manual: > Section 3.4 "Saturation and Data Limiting" > Section 3.4.2 "MAC Output Limiter" > Section 3.5 "Rounding" > Section 3.6 "Condition Code Generation" > Section 5.1.9 "Operating Mode Register" > > I hope this helps. > > Regards, > > Art Johnson > Senior Systems Analyst > PMC Prime Mover Controls Inc. > 3600 Gilmore Way > Burnaby, B.C., Canada > V5G 4R8 > Phone: 604 433-4644 > FAX: 604 433-5570 > Email: art@p... > http://www.pmc-controls.com > > -----Original Message----- > From: Bruno Tremblay [mailto:btremblay@g...] > Sent: Wednesday, February 19, 2003 9:50 AM > To: > Subject: [motoroladsp] Strange assembler move instruction > Hi, > > I'm working with the DSP56F803 for sometime in C and I just begun using > inline assembly in my code today. > unsigned int To_Out; > To_Out = 0x40A1 > asm (move To_Out,A); > asm (rol A); > asm (move A,To_Out); > > Since the carry was 1, the contents of A1 was 0x8123 after the rol > instruction. The problem is with the "move A,To_Out". After the move > instruction, the contents of To_Out was 0x7FFF not 0x8123. I tried other > value and it's work fine for some. > > Thanks for the help. > > Bruno > |