<commit_before>package de.czempin.nicnac16;

public enum Instruction {
	ADD() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			int address = word & 0x00000FFF; // extract address
			int value = p.readMemory(address);

			int oldAC = p.AC;
			p.AC += value; // TODO: condition bits
			int newAC = p.AC;
			String formatted = String.format("ADD %h: AC (%h)<- AC(%h) + mem[%h] (%h)", address, newAC, oldAC, address, value);
			System.out.println(formatted);
		}
	},
	NOP() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("NOP");
		}
	},
	JMP() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("JMP");
		}
	},
	BL() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("BL");
		}
	},
	RET() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("RET");
		}
	},
	LDA() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("LDA");
		}
	},
	STA() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("STA");
		}
	},<commit_msg>modulo 16 bits<commit_after>package de.czempin.nicnac16;

public enum Instruction {
	ADD() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			int address = word & 0x00000FFF; // extract address
			int value = p.readMemory(address);

			int oldAC = p.AC;
			p.AC = (p.AC + value) % 0xffff; // TODO: condition bits
			int newAC = p.AC;
			String formatted = String.format("ADD %h: AC (%h)<- AC(%h) + mem[%h] (%h)", address, newAC, oldAC, address, value);
			System.out.println(formatted);
		}
	},
	NOP() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("NOP");
		}
	},
	JMP() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("JMP");
		}
	},
	BL() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("BL");
		}
	},
	RET() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("RET");
		}
	},
	LDA() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			int address = word & 0x00000FFF; // extract address
			int value = p.readMemory(address);

			p.AC = value; // TODO: condition bits?
			int newAC = p.AC;
			String formatted = String.format("LDA %h: AC (%h)<- mem[%h] (%h)", address, newAC, address, value);
			System.out.println(formatted);
			System.out.println("LDA");
		}
	},
	STA() {
		public void execute(int word, Processor p) {
			super.execute(word, p);
			System.out.println("STA");
		}
	},
{'fraction_non_alphanumeric': 0.17160404624277456, 'fraction_numerical': 0.009031791907514452, 'mean_word_length': 3.299689440993789, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, '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': '963485', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1012, 'n_words': 252}