Shop OBEX P1 Docs P2 Docs Learn Events
Understanding the Debug Registers Window — Parallax Forums

Understanding the Debug Registers Window

John KauffmanJohn Kauffman Posts: 653
edited 2006-04-17 11:52 in General Discussion
I’m having problems understanding some of the Debug Registers Window, even after reading Daubach, Williams and the Dev System manual. For reference, a sample is shown below.

I understand the left section of the RegWin, showing the current settings for the registers that record RTCC, pin settings, etc. The middle window I can see holds the lines of code in assembly language. I can also see that the lines of code are numbered in sets:
0 00 - FF, 1 00 – FF, up to 7 00-FF.
·
Am I correct that the first digit of the line numbering refers to the eight banks of programming space, each with 2K bytes?
·
I do not understand the right section.
What is the purpose of this memory and which commands access it?
Is this the same physical space as what is taken by the program code in the middle window? In other words, is there any relationship between the middle box and the right box?
Is this the place where variables and data tables are kept that are available only within the same programming bank?
·
I’ve read the sections of the books regarding memory and the hotel floor analogies. As I get it, the first 16 bytes of each bank is essentially the same memory and thus available to all eight programming blocks. Of those 16 bytes, 8 bytes are reserved for SX use (RTCC, RA, etc.) and the upper 8 bytes are available for variables. To relate that to the registers window:
On the block to the left the top eight rows have labels (RTCC&#8230[noparse];)[/noparse] because they are reserved. The bottom 8 bytes do nto have labels because they are for user variables that will be available to all programming banks. Correct?
·
In the block on the right, is that why each column start with the top row at $10, because from $00 to $0F are part of the universal registers?
·
But why do the column labels increment by $20 instead of $10? I understand there are eight banks, but why not name them $00 to 08?
·
And one last question. I understand that the physical location of W gets moved around so that one byte on the chip does not wear out. That makes me wonder if there is memory management that creates an abstraction layer between chip’s physical matrix and the register naming system. What is the relationship between the registers as we discuss and the physical arrangements on the chip?
·
I would be grateful if anyone can point me to a reference that explains this. Thanks.
·

Comments

  • BeanBean Posts: 8,129
    edited 2006-04-17 11:52
    John Kauffman said...
    The middle window I can see holds the lines of code in assembly language. I can also see that the lines of code are numbered in sets: 0 00 - FF, 1 00 – FF, up to 7 00-FF.
    ·
    Am I correct that the first digit of the line numbering refers to the eight banks of programming space, each with 2K bytes?
    ·
    Yes that is the program memory. Each "bank" has 256 ($00-$FF) program words (12 bits each). For a TOTAL of 2K programming words.

    I do not understand the right section.
    What is the purpose of this memory and which commands access it?
    Is this the same physical space as what is taken by the program code in the middle window? In other words, is there any relationship between the middle box and the right box?
    Is this the place where variables and data tables are kept that are available only within the same programming bank?

    The right box is the RAM for variable storage. This memory is totally seperate from the "program" memory.

    I’ve read the sections of the books regarding memory and the hotel floor analogies. As I get it, the first 16 bytes of each bank is essentially the same memory and thus available to all eight programming blocks. Of those 16 bytes, 8 bytes are reserved for SX use (RTCC, RA, etc.) and the upper 8 bytes are available for variables. To relate that to the registers window:
    On the block to the left the top eight rows have labels (RTCC&#8230[noparse];)[/noparse] because they are reserved. The bottom 8 bytes do nto have labels because they are for user variables that will be available to all programming banks. Correct?
    ·
    In the block on the right, is that why each column start with the top row at $10, because from $00 to $0F are part of the universal registers?

    Yes and $00-$0F are shown at the far left.
    ·
    But why do the column labels increment by $20 instead of $10? I understand there are eight banks, but why not name them $00 to 08?
    ·
    That is just the way the chip works. Because of how the assembler translates instructions it's not too bad. If you want a variable at $30 just declare it there then do "BANK varName" and "MOV W,varName". BTW the SX48 is easier because it does not skip locations.

    And one last question. I understand that the physical location of W gets moved around so that one byte on the chip does not wear out. That makes me wonder if there is memory management that creates an abstraction layer between chip’s physical matrix and the register naming system. What is the relationship between the registers as we discuss and the physical arrangements on the chip?
    ·
    No idea. I don't think the location for W get moved around. And surely not because the chip will wear out ??? The only thing that could "wear-out" is the flash programming memory.
    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module"·available from Parallax for only·$49.95 http://www.parallax.com/detail.asp?product_id=30015
    Product web site: www.sxvm.com

    Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
Sign In or Register to comment.