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