public void iffaux() { Ecriture.ecrireString(o, "; "); super.iffaux(); Ecriture.ecrireStringln(o, "pop ax"); Ecriture.ecrireStringln(o, "cmp ax,0"); Ecriture.ecrireStringln(o, "je " + structureConditionnelleActuelle.getEtiquetteSuivante()); }
public void ineg() { Ecriture.ecrireString(o, "; "); super.ineg(); Ecriture.ecrireStringln(o, "pop ax"); Ecriture.ecrireStringln(o, "neg ax"); Ecriture.ecrireStringln(o, "push ax"); }
public void queue() { Ecriture.ecrireString(o, "; "); super.queue(); Ecriture.ecrireStringln(o, "nop"); Ecriture.ecrireStringln(o, "EXITCODE"); Ecriture.ecrireStringln(o, "end debut"); }
public void ifeq(String etiquette) { Ecriture.ecrireString(o, "; "); super.ifeq(etiquette); Ecriture.ecrireStringln(o, "pop ax"); Ecriture.ecrireStringln(o, "cmp ax,0"); Ecriture.ecrireStringln(o, "je " + etiquette); }
public void iload(int offset) { Ecriture.ecrireString(o, "; "); super.iload(offset); String signe = ""; if (offset >= 0) signe = "+"; Ecriture.ecrireStringln(o, "push word ptr [bp" + signe + offset + "]"); }
public void isub() { Ecriture.ecrireString(o, "; "); super.isub(); Ecriture.ecrireStringln(o, "pop bx"); Ecriture.ecrireStringln(o, "pop ax"); Ecriture.ecrireStringln(o, "sub ax,bx"); Ecriture.ecrireStringln(o, "push ax"); }
public void imul() { Ecriture.ecrireString(o, "; "); super.imul(); Ecriture.ecrireStringln(o, "pop bx"); Ecriture.ecrireStringln(o, "pop ax"); Ecriture.ecrireStringln(o, "imul bx"); Ecriture.ecrireStringln(o, "push ax"); }
public void ireturn(int offset) { Ecriture.ecrireString(o, "; "); super.ireturn(offset); Ecriture.ecrireStringln(o, "pop ax"); String signe = ""; if (offset >= 0) signe = "+"; Ecriture.ecrireStringln(o, "mov [bp" + signe + offset + "],ax"); }
public void ior() { Ecriture.ecrireString(o, "; "); super.ior(); Ecriture.ecrireStringln(o, "pop bx"); Ecriture.ecrireStringln(o, "pop ax"); Ecriture.ecrireStringln(o, "or ax,bx"); Ecriture.ecrireStringln(o, "push ax"); }
public void iand() { Ecriture.ecrireString(o, "; "); super.iand(); Ecriture.ecrireStringln(o, "pop bx"); Ecriture.ecrireStringln(o, "pop ax"); Ecriture.ecrireStringln(o, "and ax,bx"); Ecriture.ecrireStringln(o, "push ax"); }
public void lireEnt(int offset) { Ecriture.ecrireString(o, "; "); super.lireEnt(offset); String signe = ""; if (offset >= 0) signe = "+"; Ecriture.ecrireStringln(o, "lea dx,[bp" + signe + offset + "]"); Ecriture.ecrireStringln(o, "push dx"); Ecriture.ecrireStringln(o, "call lirent"); }
public void iinf() { Ecriture.ecrireString(o, "; "); super.iinf(); Ecriture.ecrireStringln(o, "pop bx"); Ecriture.ecrireStringln(o, "pop ax"); Ecriture.ecrireStringln(o, "cmp ax,bx"); Ecriture.ecrireStringln(o, "jge $+6"); Ecriture.ecrireStringln(o, "push -1"); Ecriture.ecrireStringln(o, "jmp $+4"); Ecriture.ecrireStringln(o, "push 0"); }
public void ecrireChaine(String s) { Ecriture.ecrireString(o, "; "); super.ecrireChaine(s); Ecriture.ecrireStringln(o, ".DATA"); String tmp = s.substring(0, s.length() - 1); Ecriture.ecrireStringln(o, "mess" + cmptChaine + " DB " + tmp + "$\""); Ecriture.ecrireStringln(o, ".CODE"); Ecriture.ecrireStringln(o, "lea dx,mess" + cmptChaine); Ecriture.ecrireStringln(o, "push dx"); Ecriture.ecrireStringln(o, "call ecrch"); cmptChaine++; }
public void idiv() { Ecriture.ecrireString(o, "; "); super.idiv(); Ecriture.ecrireStringln(o, "pop bx"); Ecriture.ecrireStringln(o, "pop ax"); Ecriture.ecrireStringln(o, "cwd"); Ecriture.ecrireStringln(o, "idiv bx"); Ecriture.ecrireStringln(o, "push ax"); }
public void entete() { Ecriture.ecrireString(o, "; "); super.entete(); Ecriture.ecrireStringln( o, "extrn lirent:proc, ecrent:proc, ecrbool:proc, ecrch:proc, ligsuiv:proc"); Ecriture.ecrireStringln(o, ".model SMALL"); Ecriture.ecrireStringln(o, ".586"); Ecriture.ecrireStringln(o, ""); Ecriture.ecrireStringln(o, ".CODE"); }
public void call(String nom) { Ecriture.ecrireString(o, "; "); super.call(nom); Ecriture.ecrireStringln(o, "call " + nom); }
public void ecrireBool() { Ecriture.ecrireString(o, "; "); super.ecrireBool(); Ecriture.ecrireStringln(o, "call ecrbool"); }
public void aLaLigne() { Ecriture.ecrireString(o, "; "); super.aLaLigne(); Ecriture.ecrireStringln(o, "call ligsuiv"); }
public void sinon() { Ecriture.ecrireString(o, "; "); super.sinon(); Ecriture.ecrireStringln(o, "jmp " + conditions.getEtiquetteFin()); Ecriture.ecrireStringln(o, conditions.getEtiquetteSinon() + ":"); }
public void fait() { Ecriture.ecrireString(o, "; "); super.fait(); Ecriture.ecrireStringln(o, "jmp " + iterations.getEtiquetteDebut() + "\n"); Ecriture.ecrireStringln(o, iterations.getEtiquetteFinAndFinish() + ":"); }
public void ouvrePrinc(int offset) { Ecriture.ecrireString(o, "; "); super.ouvrePrinc(offset); Ecriture.ecrireStringln(o, "mov bp,sp"); Ecriture.ecrireStringln(o, "sub sp," + offset); }
public void debut() { Ecriture.ecrireStringln(o, "debut:"); Ecriture.ecrireStringln(o, "STARTUPCODE"); }
public void igoto(int etiquette) { Ecriture.ecrireString(o, "; "); super.igoto(etiquette); Ecriture.ecrireStringln(o, "jmp " + etiquette); }
public void reserveRetour() { Ecriture.ecrireString(o, "; "); super.reserveRetour(); Ecriture.ecrireStringln(o, "sub sp,2"); }
public void iconst(int valeur) { Ecriture.ecrireString(o, "; "); super.iconst(valeur); Ecriture.ecrireStringln(o, "push word ptr " + valeur); }
public void ouvreBloc(int taille) { Ecriture.ecrireString(o, "; "); super.ouvreBloc(taille); Ecriture.ecrireStringln(o, "enter " + taille + ",0"); }
public void fermeBloc(int taille) { Ecriture.ecrireString(o, "; "); super.fermeBloc(taille); Ecriture.ecrireStringln(o, "leave "); Ecriture.ecrireStringln(o, "ret " + taille); }
public void nomFonc(String nom) { Ecriture.ecrireString(o, "; "); super.nomFonc(nom); Ecriture.ecrireStringln(o, nom + ":"); }
public void ecrireEnt() { Ecriture.ecrireString(o, "; "); super.ecrireEnt(); Ecriture.ecrireStringln(o, "call ecrent"); }