Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/12/03 17:26
Read: times


 
#41360 - RE: defining a msg at direct address space
Responding to: ???'s previous message
You are right, you have to copy the message from ROM to RAM. Either in the way that you describe, or by using a "copy loop" like this (for null terminated strings):
mov r0,#030h
mov dptr,#message
copy: clr a
mov a,@a+dptr
jz endcopy
mov @r0,a
inc dptr
inc r0
sjmp copy
endcopy: ;the rest of your code

message: db 'text message',0

If you want to copy messages which may contain '0' as a data byte, you will have to choose another method to indicate the end of the message, for instance by starting the message with the amount of bytes to be copied.

List of 4 messages in thread
TopicAuthorDate
defining a msg at direct address space            01/01/70 00:00      
   RE: defining a msg at direct address space            01/01/70 00:00      
   RE: defining a msg at direct address space            01/01/70 00:00      
      thanks ijaz and hans!            01/01/70 00:00      

Back to Subject List