* This method identifies the kind of instruction and generates the respective data.
* @return
*/
private StringBuilder recognizeWord() {
StringBuilder builder = new StringBuilder();
Instruction instruction = null;
try {
instruction = getInstructionAt(linePosition);
} catch (java.lang.IndexOutOfBoundsException ex) {
//System.out.println("Falha ao recuperar instrução número " + linePosition);
// Aqui poderia tentar chamar um "Silent Compile". Esse erro ocorre quando não consigo recuperar a instrução da linha, após da enter...
}
if (instruction != null) {
if (isNumber()) {
Value value = instruction.getValue();
builder.append("<HTML>");
builder.append("<center><b>Valor Numérico</b></center> ");
builder.append("<br>");
builder.append("<b>Binário:</b> ").append(value.toBinary());
builder.append("<br>");
builder.append("<b>Decimal:</b> ").append(value.toDecimal());
builder.append("<br>");
builder.append("<b>Hexadecimal:</b> ").append(value.toHex());
builder.append("</HTML>");
}
if (isMemoryDealer()) {
Instruction dest = getInstructionAt(instruction.getValue());
// Ocorre quando o endereço após o @ não existe.
if (dest == null) {
builder.append("<HTML>");
builder.append("<center><b>Endereço de Memória</b></center>");
builder.append("<br>");
builder.append("<b>Valor: Desconhecido</b>");
builder.append("</HTML>");
return builder;
} else {
Value value = dest.getValue();
builder.append("<HTML>");
builder.append("<center><b>Endereço de Memória</b></center>");
builder.append("<br>");
builder.append("<b>Binário:</b> ").append(value.toBinary());
builder.append("<br>");