Shop OBEX P1 Docs P2 Docs Learn Events
Memory addressing using RDLONG/WRLONG or MOVD and/or MOVS on MOV in ASSEMBLY. — Parallax Forums

Memory addressing using RDLONG/WRLONG or MOVD and/or MOVS on MOV in ASSEMBLY.

G.BraverG.Braver Posts: 3
edited 2006-12-11 17:52 in Propeller 1
Could·someone please confirm that these types of·instructions require a byte-based address that is divisible by four (two LSBs clear).

Is this true in every case?

Thanks.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-11 16:14
    All of the HUB memory instructions (RDxxxx/WRxxxx) require byte addresses. RDLONG/WRLONG ignore the low order 2 bits of the HUB memory address. RDWORD/WRWORD ignore the low order bit of the HUB memory address. All other addresses in assembly are long word addresses in COG memory (or immediate values).
  • G.BraverG.Braver Posts: 3
    edited 2006-12-11 17:27
    Thanks!·

    I have nearly finished a simple ASSEMBLY string object.· It is used in my embedded application to parse serial commands.· It copies strings from main RAM to COG ram, then performs·the required·operation and returns the result to main RAM.· So far these functions are supported.· I want to test·it·out more extensively before·posting it.

    Len (Similar to STRSIZE), Append (ADD), Copy, Left, Right, Mid, and Instr.· The·latter four basically perform the same·function·as·VB.· I will probably also add Ucase, LCase, and Replace.· If you have any other suggestions, please let me know.

    And·now knowing that·COG ram is referred to by·long word address -·the·scratchpad is 4 times as·large.· The code works, but I suppose I never tested string combinations·256 bytes in length.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-11 17:52
    Doing packed character manipulation in assembly takes a little work and is not much faster than keeping the data in HUB memory. It is necessary at times though.
Sign In or Register to comment.