working register
Brian_B
Posts: 842
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
·
·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
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.
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
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
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