/* intof.c */
#include <intof.h>
#include <stdio.h>

bool overflowed() {
    int8 bit;

    bit = *overflow & 1;
    *overflow >>=1;

    return (bit) ?
            true :
        false;
}

int main() {
    int32 x, y;

    x = 15;
    y = sub(x, 6);

    if (overflowed())
        printf("y  = 0x%.02hhx (overflow)\n", (unsigned char)y);
    else
        printf("y  = 0x%.02hhx\n", (unsigned char)y);

    return 0;
}
