if (data < 0) errout ("Expected register");
void	register_write (){	/*	 * MOVE reg/data8 TO reg			register write	 * MOVE reg <op> data8 TO reg			register write	 * MOVE reg + data8 TO reg WITH CARRY		register write	 */	int	op;	int	reg;	int	data;	if (reserved ("to", tokenix+1))		op = 0;	else if (tokens[tokenix+1].type == '|')		op = 2;	else if (tokens[tokenix+1].type == '&')		op = 4;	else if (tokens[tokenix+1].type == '+')		op = 6;	else if (tokens[tokenix+1].type == '-')		op = 8;	else		errout ("Unknown register operator");	if (op && reserved ("to", tokenix+3) == 0)		errout ("Register command expected TO");	reg = CheckRegister (tokenix);	if (reg < 0) {			/* Not register, must be data */		data = evaluate (tokenix);		if (op)			errout ("Register operator not move");		reg = CheckRegister (tokenix+2);		if (reg < 0)			errout ("Expected register");		inst0 = 0x78000000 | (data << 8) | reg << 16;#if 0fprintf (listfp, "Move data to register: %02x %d\n", data, reg);#endif	}	else if (op) {			/* A register read/write operator */		data = evaluate (tokenix+2);		if (tokenix+5 < ntokens) {			if (!reserved("with", tokenix+5) ||			    !reserved("carry", tokenix+6)) {				errout("Expected 'WITH CARRY'");			} else if (op != 6) {				errout("'WITH CARRY' only valid with '+'");			}			op = 7;		}		if (op == 8) {			data = -data;			op = 6;		}		inst0 = (data & 0xff) << 8;		data = CheckRegister (tokenix+4);		if (data < 0)			errout ("Expected register");		if (reg != data && reg != 8 && data != 8)			errout ("One register MUST be SBFR");		if (reg == data) {	/* A register read/modify/write */#if 0fprintf (listfp, "Read/modify register: %02x %d %d\n", inst0 >> 8, op, reg);#endif			inst0 |= 0x78000000 | (op << 24) | (reg << 16);		}		else {			/* A move to/from SFBR */			if (reg == 8) {	/* MOVE SFBR <> TO reg */#if 0fprintf (listfp, "Move SFBR to register: %02x %d %d\n", inst0 >> 8, op, data);#endif				inst0 |= 0x68000000 | (op << 24) | (data << 16);			}			else {#if 0fprintf (listfp, "Move register to SFBR: %02x %d %d\n", inst0 >> 8, op, reg);#endif				inst0 |= 0x70000000 | (op << 24) | (reg << 16);			}		}	}	else {				/* register to register */		data = CheckRegister (tokenix+2);		if (reg == 8)		/* move SFBR to reg */			inst0 = 0x6a000000 | (data << 16);		else if (data == 8)	/* move reg to SFBR */			inst0 = 0x72000000 | (reg << 16);		else			errout ("One register must be SFBR");	}}