PDA

View Full Version : working register



Brian_B
02-15-2007, 11:12 AM
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
ˇ

Mike Green
02-15-2007, 11:40 AM
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_B
02-15-2007, 08:32 PM
"probably" - and I thought we where in the information age http://forums.parallax.com/images/smilies/smile.gif

hinv
02-15-2007, 11:06 PM
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_B
02-15-2007, 11:40 PM
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 Green
02-16-2007, 12:44 AM
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_B
02-16-2007, 01:06 AM
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 Green
02-16-2007, 01:10 AM
Yes, absolutely