summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--samples/Makefile.samples2
-rw-r--r--samples/boucle.s3
-rw-r--r--samples/drawline.s2
-rw-r--r--samples/instructions.txt13
-rw-r--r--samples/p4.s7
5 files changed, 24 insertions, 3 deletions
diff --git a/samples/Makefile.samples b/samples/Makefile.samples
index 4085bb9..a638986 100644
--- a/samples/Makefile.samples
+++ b/samples/Makefile.samples
@@ -10,7 +10,7 @@
chmod 755 $@
rm tmp.o
-all: helloworld hello recherche rechcara sommeentiers testtout p4
+all: helloworld hello recherche rechcara sommeentiers testtout boucle p4 drawline
helloworld: fichier1.s fichier2.s
../src/compilo fichier1.s fichier1.o
diff --git a/samples/boucle.s b/samples/boucle.s
new file mode 100644
index 0000000..d513146
--- /dev/null
+++ b/samples/boucle.s
@@ -0,0 +1,3 @@
+.text
+.start
+BOUCLE: JMP BOUCLE
diff --git a/samples/drawline.s b/samples/drawline.s
index 3ab76dc..aebb3bf 100644
--- a/samples/drawline.s
+++ b/samples/drawline.s
@@ -27,7 +27,7 @@ Locate: MOV, [0xffffff04], LocateMsg1
;DrawLinePrim1:
; Dessine une ligne entre (R6, R7) et (R8, R9) (sous la forme (ligne, colonne))
-;
+;4~
; R10 = x, R11 = y, R12 = ddx, R13 = ddy, R14 = e
diff --git a/samples/instructions.txt b/samples/instructions.txt
index 6034e0d..d3a454b 100644
--- a/samples/instructions.txt
+++ b/samples/instructions.txt
@@ -59,15 +59,23 @@ I:DIV c2=.Pr,.I=.C;op=0x3;e=0x1
I:AND c1=.Pr,c2=.Pr,c3=.Pr;op=0x4;e=0x0
I:AND c1=.Pr,c2=.Pr,.I=.C;op=0x4;e=0x1
+I:AND c2=.Pr,c3=.Pr;op=0x4;e=0x0;c1=c2
+I:AND c2=.Pr,.I=.C;op=0x4;e=0x1;c1=c2
I:OR c1=.Pr,c2=.Pr,c3=.Pr;op=0x5;e=0x0
I:OR c1=.Pr,c2=.Pr,.I=.C;op=0x5;e=0x1
+I:OR c2=.Pr,c3=.Pr;op=0x5;e=0x0;c1=c2
+I:OR c2=.Pr,.I=.C;op=0x5;e=0x1;c1=c2
I:SHL c1=.Pr,c2=.Pr,c3=.Pr;op=0x6;e=0x0
I:SHL c1=.Pr,c2=.Pr,I=.C;op=0x6;e=0x1
+I:SHL c2=.Pr,c3=.Pr;op=0x6;e=0x0;c1=c2
+I:SHL c2=.Pr,I=.C;op=0x6;e=0x1;c1=c2
I:SHR c1=.Pr,c2=.Pr,c3=.Pr;op=0x7;e=0x0
I:SHR c1=.Pr,c2=.Pr,.I=.C;op=0x7;e=0x1
+I:SHR c2=.Pr,c3=.Pr;op=0x7;e=0x0;c1=c2
+I:SHR c2=.Pr,.I=.C;op=0x7;e=0x1;c1=c2
# Transferts
@@ -109,6 +117,11 @@ I:JLE c1=.Pr,c2=.Pr,.I=.O;op=0xa;e=0x3
I:JG c2=.Pr,c1=.Pr,.I=.O;op=0xa;e=0x2
I:JGE c2=.Pr,c1=.Pr,.I=.O;op=0xa;e=0x3
+p:JNL=JGE
+p:JNLE=JG
+p:JNG=JLE
+p:JNGE=JL
+
I:JO .I=.O;op=0xa;e=0x10
I:JZ .I=.O;op=0xa;e=0x14
I:JS .I=.O;op=0xa;e=0x18
diff --git a/samples/p4.s b/samples/p4.s
index 95bb76e..28340fc 100644
--- a/samples/p4.s
+++ b/samples/p4.s
@@ -32,7 +32,7 @@ MsgDrawJ1 DS "|\e[31mO\e[0m"
MsgDrawJ2 DS "|\e[34mO\e[0m"
MsgDrawWall DS "|\n"
MsgsDraw DD MsgDraw, MsgDrawJ1, MsgDrawJ2, MsgDrawWall
-MsgDrawBegin DS "\e[2J 1 2 3 4 5 6 7\n"
+MsgDrawBegin DS "\e[2J\e[0;0H 1 2 3 4 5 6 7\n"
MsgDrawEnd DS "+-+-+-+-+-+-+-+\n"
MsgEndl DS "\n"
@@ -249,6 +249,10 @@ Has4: PUSH R10
CALL Has4V
JNE R12, R0, SortieHas4
+ SUB R11, 1
+ CALL Has4V
+ JNE R12, R0, SortieHas4
+
MOV R9, R0
SortieHas4: POP R12
POP R11
@@ -305,6 +309,7 @@ BoucleJeu: CALL AfficheP4
MOV R2, 2
SautBoucleJeu: SUB R3, 1
JNE R3, R0, BoucleJeu
+ CALL AfficheP4
MOV, [0xffffff04], MsgEgalite
RET
Gagne: CALL AfficheP4