Searching \ for 'MPASM memory allocation..' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'MPASM memory allocation..'.

Truncated match.
PICList Thread
'MPASM memory allocation..'
1997\05\05@061756 by Janusz J. Mlodzianowski

I remember a while ago somone asked similar question, but I could not find
where I have the answer..

I need to allocate some 16C84 data memory. My old copy of MPASM (I do not
remember the version #) has DB and DW directives. I understand that those
could allocate programme memory. The Parallax assembler(I do not have it)
has a DS directive which I belive could do the job.
Being z80/i86 oriented I would like to maintain even using PICs similar
programming fashion. I would not like to use EQUs like I have seen in many
MPASM listings.
The second problem I have is how to efficiently initiate the allocated memory?
I would like to write a code equivalent to:

;somewhere in the data memory
location:       DB      'storage','$'

BTW is there a public domain assembler that works in the above fashion,
uses object files and has a linker and librarian
Thanks for suggestions,

1997\05\05@071024 by Andy Kunz

>;somewhere in the data memory
>location:       DB      'storage','$'
>BTW is there a public domain assembler that works in the above fashion,
>uses object files and has a linker and librarian

Parallax assembler uses DS to reserve space.  For the above example, one
would use

location:       RETW      'storage','$'

You must remember that you cannot initialize RAM in this manner, only ROM

If you want to see the message, do the following in Parallax assembler

               org     (somewhere in RAM)

MsgPntr ds      1

               org     (somewhere such that all characters are below address 25
6 in current

Msg             jmp     PC+W
               RETW      'storage','$'

Then later in your code

               clrf    temp1
:Loop           movf    temp1,W
               call    Msg
               xorlw   '$'             ; TEst for end
               btfss   Z
               goto    :Done           ; Found, then exit
               xorlw   '$'             ; Fix bits back again
               call    Display
               incf    temp1,F
       goto    :Loop
       continue with rest of program

FWIW, I use 0x00 as end-of-string.  Not only is it understood by more
stuff, but then you can actually send "$" character easily.


Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
         Hardware & Software for Industry & R/C Hobbies
       "Go fast, turn right, and keep the wet side down!"

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...