mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-24 15:31:17 +00:00
58 lines
2.6 KiB
Plaintext
58 lines
2.6 KiB
Plaintext
/****************************************
|
|
* CONDS - Test Conditional Expressions *
|
|
****************************************/
|
|
|
|
#include <py65.h02>
|
|
#include <stdio.h02>
|
|
#include <stdlib.h02>
|
|
|
|
char passed = " Passed. ";
|
|
char failed = " Failed. ";
|
|
|
|
main:
|
|
puts("1==1 "); if (1==1) puts(&passed); else puts(&failed);
|
|
puts("1==2 "); if (1==2) puts(&failed); else puts(&passed);
|
|
puts("1+1=2"); if (1+1 == 2) puts(&passed); else puts(&failed);
|
|
puts("1<>2 "); if (1<>2) puts(&passed); else puts(&failed);
|
|
puts("1<>1 "); if (1<>1) putln(&failed); else putln(&passed);
|
|
|
|
puts("1<2 "); if (1<2) puts(&passed); else puts(&failed);
|
|
puts("2<1 "); if (2<1) puts(&failed); else puts(&passed);
|
|
puts("1<1 "); if (1<1) putln(&failed); else putln(&passed);
|
|
|
|
puts("1<=2 "); if (1<=2) puts(&passed); else puts(&failed);
|
|
puts("2<=1 "); if (2<=1) puts(&failed); else puts(&passed);
|
|
puts("1<=1 "); if (1<=1) putln(&passed); else putln(&failed);
|
|
|
|
puts("2>1 "); if (2>1) puts(&passed); else puts(&failed);
|
|
puts("1>2 "); if (1>2) puts(&failed); else puts(&passed);
|
|
puts("1>1 "); if (1>1) putln(&failed); else putln(&passed);
|
|
|
|
puts("2>=1 "); if (2>=1) puts(&passed); else puts(&failed);
|
|
puts("1>=2 "); if (1>=2) puts(&failed); else puts(&passed);
|
|
puts("1>=1 "); if (1>=1) putln(&passed); else putln(&failed);
|
|
|
|
puts("$FF "); if ($FF) puts(&passed); else puts(&failed);
|
|
puts("$00 "); if ($00) puts(&failed); else puts(&passed);
|
|
puts("1|0 "); if (1|0) puts(&passed); else puts(&failed);
|
|
puts("1&0 "); if (1&0) puts(&failed); else puts(&passed);
|
|
puts("1^1 "); if (1^1) putln(&failed); else putln(&passed);
|
|
|
|
puts("!$FF "); if (!$FF) puts(&failed); else puts(&passed);
|
|
puts("!$00 "); if (!$00) puts(&passed); else puts(&failed);
|
|
puts("!1|0 "); if (!1|0) puts(&failed); else puts(&passed);
|
|
puts("!1&0 "); if (!1&0) puts(&passed); else puts(&failed);
|
|
puts("!1^1 "); if (!1^1) putln(&passed); else putln(&failed);
|
|
|
|
puts("$FF:+"); if ($FF:+) puts(&failed); else puts(&passed);
|
|
puts("$FF:-"); if ($FF:-) puts(&passed); else puts(&failed);
|
|
puts("$00:+"); if ($00:+) puts(&passed); else puts(&failed);
|
|
puts("$00:-"); if ($00:-) puts(&failed); else puts(&passed);
|
|
puts("!0:+ "); if (!0:+) putln(&failed); else putln(&passed);
|
|
|
|
puts("atoc(\"0\")"); if (atoc("0")) puts(&failed); else puts(&passed);
|
|
puts("atoc(\"1\")"); if (atoc("1")) puts(&passed); else puts(&failed);
|
|
puts("atoc(\"128\"):-"); if (atoc("128"):-) putln(&passed); else putln(&failed);
|
|
|
|
goto exit;
|