<commit_before>package com.sixtyfour.cbmnative.mos6502.generators;

import java.util.List;

/**
 * @author EgonOlsen
 * 
 */
public abstract class GeneratorBase implements Generator {

	// Zeropage address for temp. data, actually ARG/FAC1
	protected final static int TMP_ZP = 105;

	protected String createAddress(String addr, int offset) {
		try {
			int ia = Integer.parseInt(addr);
			ia += offset;
			return String.valueOf(ia);
		} catch (Exception e) {
			return addr + "+" + offset;
		}
	}

	protected boolean checkSpecialWriteVars(List<String> nCode, Operand target) {
		if (target.getAddress().equals("VAR_TI$")) {
			nCode.add("JSR WRITETID");
			return true;
		}
		return false;
	}

	protected void checkSpecialReadVars(List<String> nCode, Operand source) {
		if (source.getAddress().equals("VAR_ST")) {
			nCode.add("LDY $90");
			nCode.add("; Byte in Y to FAC");
			nCode.add("JSR $B3A2");
			nCode.add("LDX #<" + source.getAddress());
			nCode.add("LDY #>" + source.getAddress());
			nCode.add("JSR $BBD7");
		} else if (source.getAddress().equals("VAR_TI")) {
			nCode.add("LDY $A0");
			nCode.add("LDX $A1");
			nCode.add("LDA $A2");
			nCode.add("SEC");
			nCode.add("JSR $AF87");
			nCode.add("JSR $AF7E");
			nCode.add("LDX #<" + source.getAddress());
			nCode.add("LDY #>" + source.getAddress());
			nCode.add("JSR $BBD7");
		} else if (source.getAddress().equals("VAR_TI$")) {
			nCode.add("JSR READTID");<commit_msg>Interrupt flag for reading TO set properly<commit_after>package com.sixtyfour.cbmnative.mos6502.generators;

import java.util.List;

/**
 * @author EgonOlsen
 * 
 */
public abstract class GeneratorBase implements Generator {

	// Zeropage address for temp. data, actually ARG/FAC1
	protected final static int TMP_ZP = 105;

	protected String createAddress(String addr, int offset) {
		try {
			int ia = Integer.parseInt(addr);
			ia += offset;
			return String.valueOf(ia);
		} catch (Exception e) {
			return addr + "+" + offset;
		}
	}

	protected boolean checkSpecialWriteVars(List<String> nCode, Operand target) {
		if (target.getAddress().equals("VAR_TI$")) {
			nCode.add("JSR WRITETID");
			return true;
		}
		return false;
	}

	protected void checkSpecialReadVars(List<String> nCode, Operand source) {
		if (source.getAddress().equals("VAR_ST")) {
			nCode.add("LDY $90");
			nCode.add("; Byte in Y to FAC");
			nCode.add("JSR $B3A2");
			nCode.add("LDX #<" + source.getAddress());
			nCode.add("LDY #>" + source.getAddress());
			nCode.add("JSR $BBD7");
		} else if (source.getAddress().equals("VAR_TI")) {
		    	nCode.add("SEI");
			nCode.add("LDY $A0");
			nCode.add("LDX $A1");
			nCode.add("LDA $A2");
			nCode.add("CLI");
			nCode.add("SEC");
			nCode.add("JSR $AF87");
			nCode.add("JSR $AF7E");
			nCode.add("LDX #<" + source.getAddress());
			nCode.add("LDY #>" + source.getAddress());
			nCode.add("JSR $BBD7");
		} else if (source.getAddress().equals("VAR_TI$")) {
			nCode.add("JSR READTID");
{'fraction_non_alphanumeric': 0.17756692646560487, 'fraction_numerical': 0.013554727211114876, 'mean_word_length': 3.961344537815126, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7394151', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1104, 'n_words': 223}