This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Assembler Loop

Hey mates!

This time I got a very strange problem. I want to show a question on a LCD. For that i created a loop which takes every letter and draw it on the lcd. Here's my problem: You see the variable Q1_1 writtin down in the middle of the loop. How can I increment this variable? Sot that I get the next letter. I'm using Keil A166.

MOV R13, #00H
drawQuest: MOV R15, #00H MOVBZ R15, Q1_1 ;CALL LCD_DW CMPI1 R13, #Q1_1_LEN JMP cc_NZ, drawQuest

Quest1: Q1_1 DB 'Which Color?' Q1_1_LEN EQU $-Q1_1 A1_1 DB 'CYAN' A1_2 DB 'PINK' A1_3 DB 'LILA' A1_4 DB 'GRÜN'

Big thanks at all.

Have a nice time...

CyA

Parents Reply Children
  • MOV R13, #00H
    drawQuest:
    MOV R15, #00H
    MOVBZ R15, Q1_1
    CMPI1 R13, #Q1_1_LEN
    JMP cc_NZ, drawQuest

    Quest1:
    Q1_1 DB 'Which Color?'
    Q1_1_LEN EQU $-Q1_1

  • I would agree with Hans-Bernhard comments. If you are trying to write the string Q1_1 to a serial port (tx buffer register) or another fixed variable then the code could look like...

    Assuming "out" is the variable or it could be the serial transmit buffer register you want to copy Q1_1 data too.

      MOV    R5,#0
    Drawloop:
      MOVB   RL4,[R5+#Q1_1]
      MOVB   out,RL4
      CMPI1  R5,#Q1_1_LEN
      JMP   cc_SLT,Drawloop