From 83d005c9c6937236523ae15eaef792c8ef3dae06 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 28 Nov 2011 19:17:30 +0000 Subject: Fix shifting and document is better Left shift was interpreted as right and left shift did not work properly for negative values --- README | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'README') diff --git a/README b/README index fe2a379..db9c929 100644 --- a/README +++ b/README @@ -54,7 +54,10 @@ function calls - supported, result is stored in register R0 (for int functions) A7.4 Unary Operators - supported: ++ -- + - ~ ! Unsupported: sizeof & * A7.5 Casts - unsupported A7.6-A7.7, A7.9-7.13 - supported: * / % + - < > <= >= == != & ^ | Left to right -A7.8 Shift - << >> is supported, if negative, no shift will be performed +A7.8 Shift - << >> is supported, if the second operand is negative, no shift +will be performed. The shift treats the first operand as an unsigned integer. +Example in bits assuming 4-bit words: 1000 (-8) >> 2 becomes 0010 (2), 0110 (6) +<< 1 becomes 1100 (-4) A7.14-A7.15 Logical AND && and OR || are supported. Result is indeed 0 or 1 A7.16 Conditional operator ? : - supported A7.17 Assignment - supported: = Unsupported: *= /= %= += -= <<= >>= &= ^= |= -- cgit v1.2.1