PiDP-8/I Software

View Ticket
Log In
Ticket Hash: 412a2243b683128cba8826664d73d0edf2343e3c
Title: CC8 doesn't support 2-character comparison operators
Status: Closed Type: Code Defect
Severity: Important Priority: Low
Subsystem: CC8 Resolution: Rejected
Last Modified: 2019-03-29 22:53:24
Version Found In:
User Comments:
tangent added on 2017-11-16 21:15:39:

According to the CC8 README.md file, none of the 2-character operators supported by CC8 are comparison (relative) operators. The compiler will accept them, but the resulting compiled program will not do the right thing as demonstrated by the following program:

int main()
{
    int i;
    int buf[10];

printf("i = ? "); gets(buf); sscanf(buf, "%d", &i);
if (i >= 5) { puts("i >= 5"); } else { puts("i < 5"); } }

It always takes the "if" branch.


tangent added on 2019-03-29 22:53:24:
This limitation affects only the native compiler. It is [/doc/trunk/doc/cc8-manual.md#nlim|documented], and it's unlikely to be fixed due to code space limitations.