/* register the console at a more appropriate time send an exit message to GDB  */
void gdbstub_exit(int status)
/* register the console at a more appropriate time send an exit message to GDB  */
void gdbstub_exit(int status)
{
	unsigned char checksum;
	int count;
	unsigned char ch;
	sprintf(output_buffer,"W%02x",status&0xff);
	gdbstub_tx_char('$');
	checksum = 0;
	count = 0;
	while ((ch = output_buffer[count]) != 0) {
		gdbstub_tx_char(ch);
		checksum += ch;
		count += 1;
	}
	gdbstub_tx_char('#');
	gdbstub_tx_char(hex_asc_hi(checksum));
	gdbstub_tx_char(hex_asc_lo(checksum));
	gdbstub_tx_char('-');
	gdbstub_tx_flush();
}