// Generates a 16-bit signed sinus
import "sinus.kc"
import "sinusb.kc"
import "print.kc"

void main() {
    word wavelength = 120;
    signed word[120] sintab1;
    signed word[120] sintab2;
    sin16s_gen(sintab1, wavelength);
    sin16s_genb(sintab2, wavelength);
    print_cls();
    signed word* st1 = sintab1;
    signed word* st2 = sintab2;
    for( byte i: 0..119) {
        signed word sw = *st1 - *st2;
        if(sw>=0) {
          print_str(" ");
        }
        print_sword(sw);
        print_str("   ");
        st1++;
        st2++;
    }
}
