2011-11-16 12:46 PM
Hello everybody!
I've just got acquainted with STM8-L family and I'm already really fascinated. I have some questions though. Could anybody please help me?I'm currently reading the document called '' CPU Programming Manual'', the chapter containing information about the pipelining of the controller.Let's look at one of the first pages. It shows an example of the pipelining. I've marked the assembler commands with different colours for a better view.2011-11-18 05:57 AM
I see something strange...
ADDW X, #20 ADDW X, #$1000 where is $ ended??? Do you know what it mean? I'm using C not assembly. I don't know... As I could see ADDW is 1 byte for instruction and 2 for loading address data (or immediate) to be added. It COULD be that the first clock of ''ADDW X, #20'' read command type. Second clock is to load from memory the first data byte (X is 16 bits), third clock load the second byte and begin sum calculation. Forth clock move in X the sum from ALU... It's only ipotetical. Finally: use C and let Compiler do it's job ahahah :)2011-11-20 01:10 PM
Hey there Michele!
Thanks for your answer.$ - it's just a symbol showing a number in hexadecimal system, and # tells the assembler we are loading an exact number into the reg. So ADDW X, #$1000 just adds 1000 in hex to the X index register. Rather simple. And if there is no $ after the # symbol - then the number is in decimal format. ADDW X, #20 = add 20 in decimal to X.Your suggestion is rather curious, I'll look closer into it. It seems I have to understand all these Fetch stages with their 64-bit and 32-bit buffers, etc... oh, so complicated :)I'm just starting to work with these controllers and I think using ASM at first is going to help me o understand them better. I'll use C in the future ;) and, by the way, I simply like asm more than C :))