<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Indy.IL2CPU.Assembler.X86 {
	public abstract class JumpBase: Instruction {
		public readonly string Address;

		protected JumpBase(string aAddress) {
			Address = aAddress;
			if (Address.StartsWith(".")) {
				//string xPrefix = (from item in Assembler.CurrentInstance.Instructions
				//                  where !Label.GetLabel(item).StartsWith(".")
				//                  select Label.GetLabel(item)).Last();
				string xPrefix = Label.LastFullLabel;
				Address = xPrefix + "__DOT__" + Address.Substring(1);
			}
		}
	}
}<commit_msg>Fixed problem of nasm defaulting all conditional branches to short which often generates an error. Now all jumps are near.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Indy.IL2CPU.Assembler.X86 {
	public abstract class JumpBase: Instruction {
		public readonly string Address;

		protected JumpBase(string aAddress) {
			if (aAddress.StartsWith(".")) {
				aAddress = Label.LastFullLabel + "__DOT__" + aAddress.Substring(1);
			}
			// If it has a :, then its a far call so dont add near
			if (aAddress.Contains(':')) {
			    Address = aAddress;
			} else {
			    // Nasm by default issues conditional branches as short
			    // and we often exceed the distance
			    // For now we go for simplicity. Later when we optimize and have
			    // our own assembler, we should consider using short jumps
			    // if they are faster
			    Address = "near " + aAddress;
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.09943714821763602, 'fraction_numerical': 0.0050031269543464665, 'mean_word_length': 3.04040404040404, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2130518', 'n_tokens_mistral': 533, 'n_tokens_neox': 456, 'n_words': 150}