Example #1
0
 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());
 }
Example #2
0
 public void ineg() {
   Ecriture.ecrireString(o, "; ");
   super.ineg();
   Ecriture.ecrireStringln(o, "pop ax");
   Ecriture.ecrireStringln(o, "neg ax");
   Ecriture.ecrireStringln(o, "push ax");
 }
Example #3
0
 public void queue() {
   Ecriture.ecrireString(o, "; ");
   super.queue();
   Ecriture.ecrireStringln(o, "nop");
   Ecriture.ecrireStringln(o, "EXITCODE");
   Ecriture.ecrireStringln(o, "end debut");
 }
Example #4
0
 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);
 }
Example #5
0
 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 + "]");
 }
Example #6
0
 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");
 }
Example #7
0
 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");
 }
Example #8
0
 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");
 }
Example #9
0
 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");
 }
Example #10
0
 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");
 }
Example #11
0
 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");
 }
Example #12
0
 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");
 }
Example #13
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++;
 }
Example #14
0
 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");
 }
Example #15
0
 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");
 }
Example #16
0
 public void call(String nom) {
   Ecriture.ecrireString(o, "; ");
   super.call(nom);
   Ecriture.ecrireStringln(o, "call " + nom);
 }
Example #17
0
 public void ecrireBool() {
   Ecriture.ecrireString(o, "; ");
   super.ecrireBool();
   Ecriture.ecrireStringln(o, "call ecrbool");
 }
Example #18
0
 public void aLaLigne() {
   Ecriture.ecrireString(o, "; ");
   super.aLaLigne();
   Ecriture.ecrireStringln(o, "call ligsuiv");
 }
Example #19
0
 public void sinon() {
   Ecriture.ecrireString(o, "; ");
   super.sinon();
   Ecriture.ecrireStringln(o, "jmp " + conditions.getEtiquetteFin());
   Ecriture.ecrireStringln(o, conditions.getEtiquetteSinon() + ":");
 }
Example #20
0
 public void fait() {
   Ecriture.ecrireString(o, "; ");
   super.fait();
   Ecriture.ecrireStringln(o, "jmp " + iterations.getEtiquetteDebut() + "\n");
   Ecriture.ecrireStringln(o, iterations.getEtiquetteFinAndFinish() + ":");
 }
Example #21
0
 public void ouvrePrinc(int offset) {
   Ecriture.ecrireString(o, "; ");
   super.ouvrePrinc(offset);
   Ecriture.ecrireStringln(o, "mov bp,sp");
   Ecriture.ecrireStringln(o, "sub sp," + offset);
 }
Example #22
0
 public void debut() {
   Ecriture.ecrireStringln(o, "debut:");
   Ecriture.ecrireStringln(o, "STARTUPCODE");
 }
Example #23
0
 public void igoto(int etiquette) {
   Ecriture.ecrireString(o, "; ");
   super.igoto(etiquette);
   Ecriture.ecrireStringln(o, "jmp " + etiquette);
 }
Example #24
0
 public void reserveRetour() {
   Ecriture.ecrireString(o, "; ");
   super.reserveRetour();
   Ecriture.ecrireStringln(o, "sub sp,2");
 }
Example #25
0
 public void iconst(int valeur) {
   Ecriture.ecrireString(o, "; ");
   super.iconst(valeur);
   Ecriture.ecrireStringln(o, "push word ptr " + valeur);
 }
Example #26
0
 public void ouvreBloc(int taille) {
   Ecriture.ecrireString(o, "; ");
   super.ouvreBloc(taille);
   Ecriture.ecrireStringln(o, "enter " + taille + ",0");
 }
Example #27
0
 public void fermeBloc(int taille) {
   Ecriture.ecrireString(o, "; ");
   super.fermeBloc(taille);
   Ecriture.ecrireStringln(o, "leave ");
   Ecriture.ecrireStringln(o, "ret " + taille);
 }
Example #28
0
 public void nomFonc(String nom) {
   Ecriture.ecrireString(o, "; ");
   super.nomFonc(nom);
   Ecriture.ecrireStringln(o, nom + ":");
 }
Example #29
0
 public void ecrireEnt() {
   Ecriture.ecrireString(o, "; ");
   super.ecrireEnt();
   Ecriture.ecrireStringln(o, "call ecrent");
 }