diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
| commit | 268a53de823a6750d6256ee1fb1e7707b4b45740 (patch) | |
| tree | 42c1799a9a82b2f7d9790ee9fe181d72a7274751 /src/regression/xor.c | |
| download | sdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz | |
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'src/regression/xor.c')
| -rw-r--r-- | src/regression/xor.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/regression/xor.c b/src/regression/xor.c new file mode 100644 index 0000000..cf5308c --- /dev/null +++ b/src/regression/xor.c @@ -0,0 +1,56 @@ +#include "gpsim_assert.h" +unsigned char failures=0; + +unsigned char achar0 = 0; +unsigned char achar1 = 0; +unsigned char achar2 = 0; + +void +done() +{ + ASSERT(MANGLE(failures) == 0); + PASSED(); +} + +void xor_chars_0_1(void) +{ + + achar2 = achar0 ^ achar1; + + achar0 = achar0 ^ 0x1; + + achar1 = achar0 ^ achar1 ^ 4; +} + +void xor_if(void) +{ + + if(achar0 ^ achar1) + failures++; + + achar0 ^= 0xff; + + if( !(achar0 ^ achar1) ) + failures++; + +} + +void main(void) +{ + + xor_chars_0_1(); + + if(achar2) + failures++; + + if(achar0 != 1) + failures++; + + if(achar1 != 5) + failures++; + + achar0 = achar1; + xor_if(); + + done(); +} |
