Shop OBEX P1 Docs P2 Docs Learn Events
sx28 memory question — Parallax Forums

sx28 memory question

Vertex78Vertex78 Posts: 51
edited 2007-06-13 18:27 in General Discussion
Is this how the memory is laid out in the sx28

for each bank:

$0 - $f = global registers, indf,rtcc....
$10 - $20 = sram

Comments

  • Vertex78Vertex78 Posts: 51
    edited 2007-06-13 18:04
    let me clarify what I think I understand

    for each bank

    $0 = indf
    $1 = rtcc
    $2 = pc
    $3 = status
    $4 = fsr
    $5 = ra
    $6 = rb
    $7 = rc
    $8 = ?
    $9 = ?
    $a = ?
    $b = ?
    $c = ?
    $d = ?
    $e = ?
    $f = ?
    $10 = sram
    $11= sram
    $12= sram
    $13= sram
    $14= sram
    $15= sram
    $16= sram
    $17= sram
    $18= sram
    $19= sram
    $1a= sram
    $1b= sram
    $1c= sram
    $1d= sram
    $1e= sram
    $1f= sram
  • BeanBean Posts: 8,129
    edited 2007-06-13 18:07
    The memory from $00 to $0F is global. From $08 to $0F is SRAM just like all the other memory. It's just unique in that it can always be accessed no matter what "bank" is selected.

    All other memory is "bank switched" using FSR.
    $10 to $1F is a bank - This is the bank used by SX/B for normal variables, all other banks are for arrays
    $30 to $3F is a bank
    $50 to $5F is a bank

    So if you want to use memory from $30 to $3F you would set FSR to #$20.

    It's really confusing, and one of the major reasons why SX/B was created.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    “The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • Vertex78Vertex78 Posts: 51
    edited 2007-06-13 18:27
    ok i get it so you have

    $0 - $f = globals
    $10 - $1f = bank 0
    $20 - $2f = globals
    $30 - $3f = bank 1
    $40 - $4f = globals
    $50 - $5f = bank 2
    $60 - $6f = globals
    $70 - $7f = bank 3
    $80 - $8f = globals
    $90 - $9f = bank 4
    $a0 - $af = globals
    $b0 - $bf = bank 5
    $c0 - $cf = globals
    $d0 - $df = bank 6
    $e0 - $ef = globals
    $f0 - $ff = bank7

    right?
Sign In or Register to comment.