2

Write assembler directives to build a table to hold the ASCII codes of the capital letters A-Z. The table should be store in the memory locations $00 to $19? (68HC11)

I think the response would be like, can you tell if my response is correct? and if it's wrong why?

TABLE ORG $00

      LDAA #26
LOOP  LDD  #$41
      STD  TABLE
      DECA 
      BNE  LOOP
      END

Thanks in advance,

user43680
  • 33
  • 6

1 Answers1

0

You need to do LDD #$41 before the start of the loop, and then increment that register before the BNE instruction.

Andrew Cooper
  • 32,176
  • 5
  • 81
  • 116
  • So if I replace register D by register x, put 'LDD #$41' before the loop, and add 'INX' before the 'END' instruction; it would be correct? Thanks – user43680 Oct 11 '12 at 22:29
  • My Assembler is very rusty, and I don't know the 68hc11, but you need to increment the value you're storing each time through the loop, otherwise you'll just fill the table with 41. – Andrew Cooper Oct 11 '12 at 22:38
  • Do you know someone that could help me with some more assembly exercises? I'm studying alone and I have an exam soon. Thanks! – user43680 Oct 11 '12 at 22:51
  • Folks here are more than willing help with specific questions. You won't get people answering questions for you, but the kind of question you asked here is fine and will, more often than not, receive a number of helpful answers. Have a go at the exercises and posts questions here when you hit a wall. – Andrew Cooper Oct 11 '12 at 23:22