From 8f9918fae23c775c2b23d22072a770239352f139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giovanni=20Alfredo=20Garciliano=20D=C3=ADaz?= Date: Wed, 27 Nov 2024 12:23:43 -0600 Subject: [PATCH] Corr. set, res --- public/programa_asm.js | 50 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/public/programa_asm.js b/public/programa_asm.js index 9d8ed0a..fc88a9d 100644 --- a/public/programa_asm.js +++ b/public/programa_asm.js @@ -1107,8 +1107,27 @@ class ProgramaAsm { } catch {} throw new TipoParametrosIncorrectoError(ins); case "res": - bytes = this.#obtCodigoOp("set", lop); - bytes[3] = bytes[3]+64; + bytes = this.#obtCodigoOp("bit", lop); + try { + this.esTipo(TipoParam.HL, lop[1]); + bytes[1] = bytes[1]+64; + break; + } catch {} + try { + this.esTipo(TipoParam.R, lop[1]); + bytes[1] = bytes[1]+64; + break; + } catch {} + try { + this.esTipo(TipoParam.IX, lop[1]); + bytes[3] = bytes[3]+64; + break; + } catch {} + try { + this.esTipo(TipoParam.IY, lop[1]); + bytes[3] = bytes[3]+64; + break; + } catch {} break; case "ret": if (lop.length == 0) bytes.push(0xc9); @@ -1262,8 +1281,27 @@ class ProgramaAsm { bytes.push(0x37); break; case "set": - bytes = this.#obtCodigoOp("set", lop); - bytes[3] = bytes[3]+128; + bytes = this.#obtCodigoOp("bit", lop); + try { + this.esTipo(TipoParam.HL, lop[1]); + bytes[1] = bytes[1]+128; + break; + } catch {} + try { + this.esTipo(TipoParam.R, lop[1]); + bytes[1] = bytes[1]+128; + break; + } catch {} + try { + this.esTipo(TipoParam.IX, lop[1]); + bytes[3] = bytes[3]+128; + break; + } catch {} + try { + this.esTipo(TipoParam.IY, lop[1]); + bytes[3] = bytes[3]+128; + break; + } catch {} break; case "sla": bytes = this.#obtCodigoOp("rlc", lop); @@ -1736,7 +1774,7 @@ class ProgramaAsm { return 1; } catch { return 2; } // RIX, RIY case "res": - return this.#obtCodigoTam("set", lop); + return this.#obtCodigoTam("bit", lop); case "ret": if (!lop) return 1; else if (lop.length == 1) return 2; // CC @@ -1771,7 +1809,7 @@ class ProgramaAsm { else throw new NumeroParametrosIncorrectoError(ins, [1, 2], lop.length); case "scf": return 1; case "set": - return this.#obtCodigoTam("set", lop); + return this.#obtCodigoTam("bit", lop); case "sla": return this.#obtCodigoTam("rlc", lop); case "sra": return this.#obtCodigoTam("rlc", lop); case "srl": return this.#obtCodigoTam("rlc", lop);