Answer the question
In order to leave comments, you need to log in
How to work with strings in AVR Assembler?
Help me choose an instruction for reading from a flash using a pointer
Here is a piece of code that defines a string and its length
Message: .db "Hello World!" ;String which need to write
ldi len,12 ;String length
loop:
ld byte, ;HELP
ldi temp,0x01 ;RS-bit (0 - sending command, 1 - send data)
rcall send_byte ;Call procedure for send a symbol as 4-bit mode
delayClocks 100,1,1 ;some delay
dec len ;len is length of string
brne loop
mov bx,byte[i+1]
Message: .db "Hello World!"
Answer the question
In order to leave comments, you need to log in
What instruction can be used to read data from a flash?
Are the constructions
mov bx,byte[i+1] possible?
ldi r30, lo8(Message)
ldi r31, hi8(Message)
loop:
lpm
adiw r30, 1
mov byte, r0
ldi temp,0x01 ;RS-bit (0 - sending command, 1 - send data)
rcall send_byte ;Call procedure for send a symbol as 4-bit mode
delayClocks 100,1,1 ;some delay
dec len ;len is length of string
brne loop
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question