DEFINE RESET_ORG and DEC modifier issue


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: DEFINE RESET_ORG and DEC modifier issue

    please explain how would you do. Of course debug strings are different and mixed

    a message database of null terminated strings

    Code:
    @ ORG 4000h
    messages:
    @ dw 0x08   ;message 0 offset  
    @ dw 0x12   ;message 1 offset
    @ dw 0x22   ;message 2 offset
    @ dw 0x2e   ;message 3 offset
    @ DB        "a message",0					
    @ DB	"another message",0
    @ DB	"and another",0				
    @ DB	"last one",0
    to find a message[x] read from messages + 2*x this is the offset from messages label
    message[x] start address = messages + offset

    you can then copy message to a buffer and hserout it the usual way or create your own routine to
    stream the message directly from flash

    edited lst file

    Code:
    004000        00839  ORG 4000h
    004000 0008           00847  dw 0x08
    004002 0012           00855  dw 0x12
    004004 0022           00863  dw 0x22
    004006 0032           00871  dw 0x2E
                       
    004008 2061 656D 7373 00879  DB    "a message",0                                            
        6761 0065 
                          
    004012 6E61 746F 6568 00887  DB     "another message",0
        2072 656D 7373 
        6761 0065 
                          
    004022 6E61 2064 6E61 00895  DB     "and another",0                         
        746F 6568 0072 
                        
    00402E 616C 7473 6F20 00903  DB     "last one",0    
        656E 0000
    Last edited by richard; - 4th February 2021 at 23:38.
    Warning I'm not a teacher

  2. #2
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: DEFINE RESET_ORG and DEC modifier issue

    Clear, thanks both. I've used something like that in the past when I needed a bunch of kbytes more to fit a program in memory.
    But as I told debug strings are mostly mixed test+variables and become very difficult to manage this stuff, for example

    Code:
    Hserout2["logging ",DEC ByteCount," chars at @",HEX4 BaseAddress,"-Type ",HEX2 DataType,"-Data ",str inbuff\ByteCount*2,"-",HEX2 DataCrc,"                        "]
    But some messages are all plain text, so I will consider to mix the two method

    cheers

Similar Threads

  1. Arrayread and DEC modifier issue
    By Marcick in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th January 2021, 07:35
  2. Indexing DEC modifier
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 13th December 2015, 22:12
  3. reset_org with 16f193X ?
    By kik1kou in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th October 2011, 08:32
  4. LCDout $FE,2, dec Days - What is dec ?
    By merc07 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th June 2009, 04:03
  5. 12F675: DEC modifier not accepted
    By jswayze in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st September 2005, 02:39

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts