Shop OBEX P1 Docs P2 Docs Learn Events
How Z flag of (MINS, MAXS, MIN, MAX) and C Flag of (ADDABS, SUBABS) work? — Parallax Forums

How Z flag of (MINS, MAXS, MIN, MAX) and C Flag of (ADDABS, SUBABS) work?

paulchainkangpaulchainkang Posts: 10
edited 2006-12-03 12:48 in Propeller 1
Hello all,

I found something interesting when test the Propeller Assembly Instructions.

1. Z Flag of MINS, MAXS, MIN and MAX

The Instruction set of Core Docs.pdf says Z out is "D=S". But my test shows

mins $55, $55 => Z= 0
maxs $55, $55 => Z= 0
min· $55, $55 => Z= 0
max· $55, $55 => Z= 0

I though all the Z flags should be 1.

2. C Flag of ADDABS and SUBABS

The Instruction set of Core Docs.pdf says·C out is "Unsigned Carry" for ADDABS·and is "Unsigned Borrow" for SUBABS. But my test shows

addabs $00000055,-$AA => C= 1 (a)
addabs $FFFFFFFF,-$01 => C= 0 (b)
subabs $000000AA,-$55 => C= 1 (c)

I though in case (a) and (c) the C Flags should be 0. The -$AA and -$55 after ABS are $AA and $55. They should not cause Unsigned Carry·in the addition and substration.

In case·(b), I thought the addition of $FFFFFFFF and $1 (after ABS) should cause Carry. But the C flag is 0.

Attached is my test program. It would send the results to RS232 with 19200 8N1.

Any help is appreciated.

Paul







Sign In or Register to comment.