diff --git a/CPUCore.pas b/CPUCore.pas index 3780581..567e4a0 100644 --- a/CPUCore.pas +++ b/CPUCore.pas @@ -427,6 +427,7 @@ begin end; procedure TCPUCore.addTopLabel(lbl: string); begin + if iRam>=CPUMAXRAM then exit; ram[iRam].topLabel := lbl; end; procedure TCPUCore.addTopComm(comm: string; replace: boolean); diff --git a/Cambios.txt b/Cambios.txt index fae5ced..6a9c2bc 100644 --- a/Cambios.txt +++ b/Cambios.txt @@ -2,6 +2,8 @@ === 04/09/2020: Se mueve el método FindOpcode() fuera del objeto TP6502Instruct. 22/10/2020: Se agrega protección de dirección excesiva, a TCPUCore.addTopLabel(). +23/10/2020: Se crea la bandera pic.disableCodegen. + 0.4 === diff --git a/P6502utils.pas b/P6502utils.pas index 7d7a3cb..c5e570f 100644 --- a/P6502utils.pas +++ b/P6502utils.pas @@ -196,6 +196,7 @@ type procedure ExploreUsed(rutExplorRAM: TCPURutExplorRAM); //devuelve un reporte del uso de la RAM function ValidRAMaddr(addr: word): boolean; //indica si una posición de memoria es válida public //Methods to code instructions according to syntax + disableCodegen: boolean; //Flag to disable the Code generation. procedure useRAMCode; procedure codByte(const value: byte; isData: boolean); procedure codAsm(const inst: TP6502Inst; addMode: TP6502AddMode; param: word); @@ -293,6 +294,7 @@ procedure TP6502.codAsm(const inst: TP6502Inst; addMode: TP6502AddMode; param: w var rInst: TP6502Instruct; begin + if disableCodegen then exit; //Test flag rInst := PIC16InstName[inst]; //Overflow protection if iRam >= CPUMAXRAM then begin