Shop OBEX P1 Docs P2 Docs Learn Events
words and bytes in assembly — Parallax Forums

words and bytes in assembly

btomkobtomko Posts: 10
edited 2008-06-05 06:13 in Propeller 1
I have a·list of 16 bit words that I want to access consecutively in assembly.· For space sake, can I declare these a list of words rather than longs?· I'm worried about the little-endian formatting of longs and the fact that all MOV operations are 32 bit.· Would it be best to not use the "word" directive and just use the "long" directive and stringing 2 words into one long and then use shifting?· Any suggestions?· Thanks.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-04 22:14
    In assembly language all operands are 32 bits (except for hub memory access where you can access bytes and words). You will have to combine 2 words into a long for table storage and separate them with shifting and masking.
  • btomkobtomko Posts: 10
    edited 2008-06-05 02:24
    Thanks for your advice.
  • AleAle Posts: 2,363
    edited 2008-06-05 06:13
    You can declare word or byte storage with the byte and word directives as you will do with long. Be aware of the endianness of the propeller (LE). As Mike pointed out you will have to read and write longs and access your data using shifts and masks. I do not remember if bytes/words were padded to longs or not when they were in odd boundaries though.
Sign In or Register to comment.