//Copyright © Hotwright Inc. 2022-2023
#include "ascii_defs_in.h"

// for debugging in software
extern void _user();

#define bool _Bool

bool pop= 0;
bool push = 0;
bool cr_data = 0;

bool din0;
bool din1;
bool din2;
bool din3;
bool din4;
bool din5;
bool din6;
bool din7;
bool cr_wrap_around;
bool valid;

void main() {
    _user(0); // set input
  // get rid of non-letters in front
  while (!(lower_case | upper_case)) {
  if (valid == 1) {
    pop = 1;
    pop = 0;
   }
  else pop = 0, push = 0, cr_data = 0;
  }
  // do the rest
  while(1) {
  if (valid == 1) {
    _user(1); // set input
    if ((lower_case | upper_case)) {
      push = 1, pop = 1, cr_data = 0;
      push = 0, pop = 0;
    }
    else if (cr_wrap_around == 0) {
      cr_data = 1, push = 1;
      push = 0;
    }
    else {
      //pop = 1, push = 0, cr_data = 0;
      pop = 1, push = 0;
      pop = 0;
    }
   }
  else pop = 0, push = 0, cr_data = 0;
  }
}

