"/* This file is part of GNU epsilon, a functional language implementation\n"
"\n"
"Copyright (C) 2003 Luca Saiu\n"
"\n"
"GNU epsilon is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published\n"
"by the Free Software Foundation; either version 2, or (at your\n"
"option) any later version.\n"
"\n"
"GNU epsilon is distributed in the hope that it will be useful, but\n"
"WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
"General Public License for more details.\n"
"\n"
"You should have received a copy of the GNU General Public License\n"
"along with epsilon; see the file COPYING.  If not, write to the\n"
"Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
"Boston, MA 02111-1307, USA. */\n"
"\n"
"\n"
"/* Code for the s_gts instruction */\n"
"\n"
"const integer_t size_of_undertop = ((integer_t*)UNDERTOP)[0];\n"
"const integer_t size_of_top = ((integer_t*)top)[0];\n"
"integer_t minimum_size;\n"
"integer_t i;\n"
"\n"
"/* Set minimum_size to the minimum of the lengths: */\n"
"minimum_size = size_of_undertop;\n"
"if(size_of_top < minimum_size)\n"
"  minimum_size = size_of_top;\n"
"\n"
"for(i = 1; i <= minimum_size; i++)\n"
"  if( ((integer_t*)UNDERTOP)[i] < ((integer_t*)top)[i] ){\n"
"    top = (word_t)0; /* UNDERTOP <s top */\n"
"    break;\n"
"  } else if( ((integer_t*)UNDERTOP)[i] > ((integer_t*)top)[i] ){\n"
"    top = (word_t)1; /* UNDERTOP >s top */\n"
"    break;\n"
"  }\n"
"  /* else do nothing: iterate again */\n"
"\n"
"if(i > minimum_size){ /* strings are equal up to and including minimum_size. */\n"
"  if(size_of_undertop == size_of_top)\n"
"    top = (word_t)0; /* UNDERTOP =s top */\n"
"  else if(size_of_undertop < size_of_top)\n"
"    top = (word_t)0; /* UNDERTOP <s top */\n"
"  else /* size_of_undertop > size_of_top */\n"
"    top = (word_t)1; /* UNDERTOP >s top */\n"
"}\n"
"\n"
"/* We already put the result into top: now decrease the stack pointer: */\n"
"undertop_stack_pointer--;\n"
""
