Shop OBEX P1 Docs P2 Docs Learn Events
Question (ASM Programing). — Parallax Forums

Question (ASM Programing).

SapiehaSapieha Posts: 2,964
edited 2007-09-24 22:05 in Propeller 1
I will not to discover circles again.
·
Consequently I ask or there is some method to the start of COG ASM of the program
·and on the start of consumption of memory in HUB for other aims.

sorry bad english
·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.

Sapieha

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-21 16:24
    Are you asking how to start an assembly program in a cog? If so, the manual describes this under COGNEW and COGINIT. Look at any program in the Propeller Tool's library that uses assembly and you will see examples of this (try mouse.spin).

    If your program is small and it only uses a little stack space, you can easily use the end of RAM (backwards from $7FFF) for other purposes. The PropellerOS (in the Object Exchange) uses this technique for allocating space for all of its I/O driver information and buffers.

    You can also declare a block of variables in your program and pass the starting address to the cog (as shown in mouse.spin).

    Post Edited (Mike Green) : 9/21/2007 4:32:39 PM GMT
  • ericballericball Posts: 774
    edited 2007-09-21 16:39
    I think what you are asking is:

    "How long after I start a PASM program can I overwrite the HUB RAM which contained the PASM code?"

    The answer is on the order of 8200 cycles (512 * 16), although I'd recommend a healthy fudge factor.

    Of course, the PASM code which was just loaded can overwrite it's HUB RAM version as soon as it starts executing.
  • SapiehaSapieha Posts: 2,964
    edited 2007-09-21 17:13
    Thanks Mike and ericball

    But my question is.

    1.I start one COG with ASM prog (COG start and run)
    2.HUB hold ASM Prog
    3.Diskard HUB/Mem ASM-start to ASM-end in HUB
    4.LOAD this MEM area with new one prog else use it with my data buffer

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.

    Sapieha

    Post Edited (Sapieha) : 9/21/2007 5:20:36 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-21 17:21
    Yes, once the cog is started, the HUB copy of the assembly program is not needed. There is no easy way to load this memory area with a different program, but it is easy to use the area as a buffer. It's like any other data in a DAT section, if the first long word has the label "entry", you get the address by using the "@" operator and you can refer to the data by using something like "LONG[noparse][[/noparse]@entry]". You can refer to the xth byte by using "BYTE[noparse][[/noparse]@entry][noparse][[/noparse] x ]".
  • SapiehaSapieha Posts: 2,964
    edited 2007-09-21 17:40
    Thanks Mike.

    I have 3 ASM routiner with no HUB acces after start and this metod give my 4K extra RAM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.

    Sapieha
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-22 16:50
    I imagine this would work best if you can define your ASM routines consecutively in HUB RAM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-22 18:24
    There was a thread some weeks ago, where suitable handling was discussed. I remember having recommended to add
    padding  RS 0[noparse][[/noparse] 1000-padding]
    


    after the COG code to guarantee a 1000 LONG buffer reusing this part of memory (starting from the label of the first instruction after ORG 0 )
  • SapiehaSapieha Posts: 2,964
    edited 2007-09-22 18:46
    Hi deSilva

    Thanks for it.

    You can't remember thread?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.

    Sapieha
  • _Mark_Mark Posts: 36
    edited 2007-09-24 19:32
    Mike Green said...
    ... The PropellerOS (in the Object Exchange) ...

    Sorry to step in, but where can I find this PropellerOS? I did searches in the object exchange, and also manually browsed the full list, and could not find it. Searches on the forum have also yielded nothing (other than this thread, when searching for propelleros).
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-24 20:02
    It's mentioned in Graham Stabler's Good Thread Index: http://forums.parallax.com/showthread.php?p=609066. Sorry, it's not actually in the Object Exchange, probably because it still needs some clean up and polishing. FemtoBasic is somewhat further along.
  • _Mark_Mark Posts: 36
    edited 2007-09-24 20:33
    Ah that's right, thanks. Funny though, I searched the forums for "propelleros", "os", and "operating system", each time on "all forums" and from "any time", and for "all of the keywords". And none of these attempts yielded any results whatsoever. I'm not surprised about "os" not working, because two-character words tend not to be indexed. But at least "operating system" should have given me something, I'd say.
  • _Mark_Mark Posts: 36
    edited 2007-09-24 21:55
    True, I wasn't. Thanks for the tip. I should have known, I saw that link given in another thread recently too.

    edit: ... lol... I replied to a post that included a link to the google search facility on the parallax site. Now that post is gone. Thanks anyway tongue.gif

    Post Edited (_Mark) : 9/24/2007 10:00:00 PM GMT
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-09-24 22:01
    _Mark, when I clicked on it, IE said it couldn't find the page. So after the second time it did that I del'ed the message. Beats me, must be a MrSofty thing.
  • _Mark_Mark Posts: 36
    edited 2007-09-24 22:05
    Yeah I noticed, the final character in the link "=" was not part of the "clickable" link. So when I clicked on it, I got an error too. But when I copy/pasted the entire link into the address bar manually, it worked.

    Let's see... search.parallax.com/search?site=parallax&client=parallax&output=xml_no_dtd&proxystylesheet=parallax&proxycustom=%3CHOME/%3E&ie=&oe=&lr=

    edit: Seems to work now. To illustrate, the link in your post looked like this (notice the last character is not clickable):

    search.parallax.com/search?site=parallax&client=parallax&output=xml_no_dtd&proxystylesheet=parallax&proxycustom=%3CHOME/%3E&ie=&oe=&lr=

    Anyway thanks, and sorry for going off-topic.

    Post Edited (_Mark) : 9/24/2007 10:15:06 PM GMT
Sign In or Register to comment.