Exemple #1
0
// start offset assembly
static enum eos_t PO_pseudopc(void)
{
// future algo: remember outer memaddress and outer pseudopc
	int		outer_state	= uses_pseudo_pc;
	intval_t	new_pc,
			outer_offset	= current_offset;
	int		outer_flags	= CPU_pc.flags;

	// set new
	new_pc = ALU_defined_int();	// FIXME - allow for undefined pseudopc!
	current_offset = (current_offset + new_pc - CPU_pc.intval) & 0xffff;
	CPU_pc.intval = new_pc;
	CPU_pc.flags |= MVALUE_DEFINED;	// FIXME - remove!
	uses_pseudo_pc = TRUE;
	// if there's a block, parse that and then restore old value!
	if (Parse_optional_block()) {
		// restore old
		uses_pseudo_pc = outer_state;
		CPU_pc.flags = outer_flags;
		CPU_pc.intval = (outer_offset + CPU_pc.intval - current_offset) & 0xffff;
		current_offset = outer_offset;
// future algo: new outer pseudopc = (old outer pseudopc + (current memaddress - outer memaddress)) & 0xffff
	} else {
		Throw_first_pass_warning(Warning_old_offset_assembly);
	}
	return ENSURE_EOS;
}
Exemple #2
0
// End offset assembly
static enum eos_t PO_realpc(void) {
	Throw_first_pass_warning(Warning_old_offset_assembly);
	// deactivate offset assembly
	CPU_pc.intval = (CPU_pc.intval - current_offset) & 0xffff;
	current_offset = 0;
	uses_pseudo_pc = FALSE;
	return(ENSURE_EOS);
}
// Parse implicit label definition (can be either global or local).
// GlobalDynaBuf holds the label name.
void Label_implicit_definition(zone_t zone, int stat_flags, int force_bit, int change)
{
	struct result_t	result;
	struct label_t	*label;

	label = Label_find(zone, force_bit);
	// implicit label definition (label)
	if ((stat_flags & SF_FOUND_BLANK) && warn_on_indented_labels)
		Throw_first_pass_warning("Implicit label definition not in leftmost column.");
	result.flags = CPU_pc.flags & MVALUE_DEFINED;
	result.val.intval = CPU_pc.intval;
	Label_set_value(label, &result, change);
}
Exemple #4
0
// Start offset assembly
static enum eos_t PO_pseudopc(void) {
	bool		outer_state	= uses_pseudo_pc;
	intval_t	new_pc,
			outer_offset	= current_offset;
	int		outer_flags	= CPU_pc.flags;

	// set new
	new_pc = ALU_defined_int();
	current_offset = (current_offset + new_pc - CPU_pc.intval) & 0xffff;
	CPU_pc.intval = new_pc;
	CPU_pc.flags |= MVALUE_DEFINED | MVALUE_IS_ADDRESS;
	uses_pseudo_pc = TRUE;
	// If there's a block, parse that and then restore old value!
	if(Parse_optional_block()) {
		// restore old
		uses_pseudo_pc = outer_state;
		CPU_pc.flags = outer_flags;
		CPU_pc.intval = (outer_offset + CPU_pc.intval - current_offset) & 0xffff;
		current_offset = outer_offset;
	} else
		Throw_first_pass_warning(Warning_old_offset_assembly);
	return(ENSURE_EOS);
}
Exemple #5
0
// Start subzone ("!subzone" or "!sz"). Has to be re-entrant.
static enum eos_t PO_subzone(void) {
	// output deprecation warning
	Throw_first_pass_warning("\"!subzone {}\" is deprecated; use \"!zone {}\" instead.");
	// call "!zone" instead
	return(PO_zone());
}