asm code questions

asm code questions

Postby ThirtyTwo » Fri Mar 11, 2011 2:35 pm

Ok im trying to jump back into learning how to disassemble this stuff and I have a couple questions. I have tried googling this stuff and ive looked through the hc16 software manual but I cant find any info on these questions.


1. Im having an issue understanding how bits are set,cleared,read. Ive figured out that a byte has 8 bits which can be 0 or 1. For brset to branch I have read that all 8bits must be 1, is this true?? When opcodes bclr,bset,brclr,brset are used are they reading the entire byte or just one bit in that byte? How is a bit singled out amongst the other 7 in a byte?

I found this code "bclr 9C4h, Z, #40h", I know that the #40h is an immediate value but what does it mean in this situation? The byte is apparently stored at the location of 209C4 but im not sure where the 40h comes in. I also saw "bclr 9C4h, Z, #4" how the "#4" different since it is not identified as hex by the "h"?


2. What is a "carry" and what determines if it is set? Ive seen instructions like "bcs" (branch if carry set) and as far as I can tell this will branch if the compared value (latter value) is higher. So cpd rev_limit; bcs location, this would branch to location if rev_limit is higher than "d". Just confused as to what the carry is and what sets it?


3. How are tables stored and how do I read them? Also how are values retrieved from the table by the code?


4. How do I find the main program loop? Is there a section that is first executed that just starts calling subroutines?
ThirtyTwo
 
Posts: 1
Joined: Mon Jul 09, 2007 5:36 pm

Return to Subaru (all models)

Who is online

Users browsing this forum: No registered users and 8 guests

cron