Shop OBEX P1 Docs P2 Docs Learn Events
A simple assembler newbie question — Parallax Forums

A simple assembler newbie question

awassonawasson Posts: 57
edited 2005-05-19 10:52 in General Discussion
I've been re-reading Gunther's book, Programming the SX Microcontroller for the second time and for me, it's well worth the effort but I've run into a little problem.

In the section about Correctly Addressing SX Data Memory there are 2 listings TUT006.SRC and TUT007.SRC that explain how important it is to call the bank before doing anything with the area of memory that you want to use. The concept makes absolute sense to me however the code is not running as expected.

In the example, I have 4 memory locations that will increment one after another and then loop to do it all over again however that is not what happens when I step through the program. Only the first two registers increment and start to loop while ignoring the 3rd and 4th. Can anyone see where I've made a mistake in the code?

ifdef __SASM
  DEVICE SX28L, OSCHS3, STACKX, OPTIONX
  IRC_CAL IRC_FAST
  FREQ 50_000_000
else
  DEVICE SX28AC, OSCHS, OPTIONX
endif
DEVICE TURBO

RESET Start

Start
  bank    $10
  inc    $10
  bank    $30
  inc    $30
  bank    $50
  inc    $50
  bank    $70
  inc    $70

  jmp Start




Thanks,
Andrew

Comments

  • awassonawasson Posts: 57
    edited 2005-05-17 05:04
    Sorry,
    My mistake.

    The code is fine, I was just hitting debug again instead of the debug icon and the code wan't being updated in the chip. rolleyes.gif

    Thanks for looking
    Andrew
  • ayoenkayoenk Posts: 1
    edited 2005-05-19 07:26
    dear...
    please;
    assembler sht11 for at89c52 to lcd
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-19 10:52
    That's an Atmel processor and this is a forum for the Ubicom SX family.· Check the web for Atmel resources -- there are·lots of them.
    ayoenk said...
    dear...
    please;
    assembler sht11 for at89c52 to lcd
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.