Z flag question
ratronic
Posts: 1,451
In the asm code examples for the beginner about 8 post down talks about using a mask. All 3 examples use
mov t1, #1·· ·wz·········· Is the z flag always set to 0 because of a 1 was just put in the destination register?
·······························Thanks, Dave.····································
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
mov t1, #1·· ·wz·········· Is the z flag always set to 0 because of a 1 was just put in the destination register?
·······························Thanks, Dave.····································
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
D RatFix it if ain't broke·
Comments
It's really killing 2 birds with one stone in the code. It sets the Z flag for later use with the mux instructions and readies a '1' bit in the variable for shifting to the desired pin.
Regards
"If the WZ effect is specified, the Z flag is set (1) if Value equals zero." From manual.
So yes if destination is one Z flag will be zero.
Graham
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ D Rat
you can verify such questions very easy if you are using POD. Put your statement as second in AsmDebugDemo.spin in DAT section and load PropDebugger.spin to your Propeller. It shows you the flag registers after executing the instruction while pressing F6.
Thomas
And as Mike noted... you don't have to use wz when you first drop in to the assembly because it is cleared for you.
I had that in my first go at a blinker... which is blinking at the rate... I haven't measured it but I estimate about once every 17 seconds....and there doesn't seem to be anything I can do about it.
So... it is not absolutely true everything is faster in assembly... only those things that you properly code!!!!
Rich
one of them has to be right[noparse]:)[/noparse]
RJO_ I really enjoyed your piece on passm for non pragrammers, I would certianly like to see some more subjects covered! The other stuff is entertianing and funny too.
Kaio I need a little more info about getting the register values to show up as your testing your program,
maybe Rjo_ could write it to put some entertainment to it!.· Thanks everybody, Dave.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ D Rat