Shop OBEX P1 Docs P2 Docs Learn Events
working register — Parallax Forums

working register

Brian_BBrian_B Posts: 842
edited 2007-02-15 17:10 in Propeller 1
Hi,
·does the propeller have a working register or a accumulator.When I write:


mov· dira,#$ff

·is this is what is really happening:

mov· W,#$ff
mov· dira,W

· also , if the propeller is a 32 bit micro . How come you can "mov" 1 byte at a time?

thanks,Brian
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-15 03:40
    There is no working register or accumulator. What you write is what you get. There's probably one or more latches internal to the arithmetic logic depending on how Chip implemented it, but it's strictly internal (with no access to it) and the arithmetic logic could be implemented without it.

    The instruction you wrote is a 32 bit move. The "#" says to use the address part of the instruction as the actual data, supplying zero bits for the rest of the 32 bit value.
  • Brian_BBrian_B Posts: 842
    edited 2007-02-15 12:32
    "probably" - and I thought we where in the information age smile.gif
  • hinvhinv Posts: 1,255
    edited 2007-02-15 15:06
    Hi Brian,

    You are using immidate mode by using the #sign, thus loading $ff into the dira register. Actually, you have 9 bits to work with so you could actually load $000 to $1ff into dira in immediate mode.
    If on the other hand you say "mov dira, $ff" it move 32 bits(1 word) from location $ff(whithin COG memory) to dira. You should really take a look at Propeller Manual pages 350 and 351. The "I" bit (from ZCRI columns) is for immidiate mode(page 349).
    So if you are using immidiate mode(by using # before the second argument) the sssssssss bits are the 9bits you provide as the second argument.
    I am not new to assembly, just rusty( I used to do 6502 assembly in 1987 and 1988, and HC11 in 1990), but it took me a LONG time to figure this(what # means) out from the manual. I probably could have figured it out quicker by looking at assembled code, but it REALLY should be noted on page 349 what the "#" actually means.
    I guess this would be easily missed by someone who has been doing assembly for years.

    Doug
  • Brian_BBrian_B Posts: 842
    edited 2007-02-15 15:40
    Heres a example from the tv driver.

    DAT

    '*******************************
    '* Assembly language TV driver *
    '*******************************

    org
    '
    '
    ' Entry
    '
    entry mov taskptr,#tasks 'reset tasks

    mov x,#10 'perform task sections initially
    :init jmpret taskret,taskptr
    djnz x,#:init
    '
    in the mov x, #10 -it sure looks like your loading x with 10 ,not that your loading the value from memory location 10
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-15 16:44
    Brian,
    The "mov x,#10" does what you think it does. It takes the 9-bit value "10", extends it with zero bits to a 32-bit value, then puts that in location "x".

    The "probably" is that I'm not privy to the actual internal design of the Propeller, but, based on what I know about processor design, I can imagine several different implementations, several of which would use a latch to hold the source value until it's needed. (From my standpoint, I suffer from a "lack of information" age).
  • Brian_BBrian_B Posts: 842
    edited 2007-02-15 17:06
    So, forgive my old terminolgy . But you can only immediately MOV 9 bits but you can Absolutely MOV 32 bits ,Is that correct?

    Brian
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-15 17:10
    Yes, absolutely
Sign In or Register to comment.