diff options
| -rw-r--r-- | lib/simulator.c | 2 | ||||
| -rw-r--r-- | po/ProjetArchi.pot | 18 | ||||
| -rw-r--r-- | samples/cube.s | 109 | ||||
| -rw-r--r-- | samples/drawline.s | 33 | 
4 files changed, 135 insertions, 27 deletions
| diff --git a/lib/simulator.c b/lib/simulator.c index 7cb764b..ff2fc6d 100644 --- a/lib/simulator.c +++ b/lib/simulator.c @@ -148,13 +148,11 @@ void DecodeExec(Uint32 instruction)  		    break;  		case 6:  		    for (resultat = val1; val2; val2--) { -			fprintf(stderr, "Doing shl... (%i)\n", val2);  			resultat = SHL(resultat);  		    }  		    break;  		case 7:  		    for (resultat = val1; val2; val2--) { -			fprintf(stderr, "Doing shr...\n");  			resultat = SHR(resultat);  		    }  		    break; diff --git a/po/ProjetArchi.pot b/po/ProjetArchi.pot index de87c72..cf2fe84 100644 --- a/po/ProjetArchi.pot +++ b/po/ProjetArchi.pot @@ -6,7 +6,7 @@  msgid ""  msgstr ""  "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-05-13 19:44+0200\n" +"POT-Creation-Date: 2001-05-14 11:06+0200\n"  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"  "Language-Team: LANGUAGE <LL@li.org>\n" @@ -531,19 +531,19 @@ msgid "Adresse: Unmatched Addr Field"  msgstr ""  #. arg2 = imm32 -#: lib/simulator.c:267 +#: lib/simulator.c:265  msgid "MOV: Memory to Memory Forbidden On This Type Of Processor"  msgstr "" -#: lib/simulator.c:400 +#: lib/simulator.c:398  msgid "DecodeExec: Invalid Opcode"  msgstr "" -#: lib/simulator.c:462 +#: lib/simulator.c:460  msgid "Shutdown requested"  msgstr "" -#: lib/simulator.c:464 +#: lib/simulator.c:462  msgid ""  "Help:\n"  "G: go\n" @@ -553,22 +553,22 @@ msgid ""  "Q: quit\n"  msgstr "" -#: lib/simulator.c:501 +#: lib/simulator.c:499  #, c-format  msgid "Opening file %s"  msgstr ""  #. verification de la signature -#: lib/simulator.c:505 +#: lib/simulator.c:503  msgid "Invalid Signature"  msgstr "" -#: lib/simulator.c:509 +#: lib/simulator.c:507  #, c-format  msgid "Loading file %s"  msgstr "" -#: lib/simulator.c:543 +#: lib/simulator.c:541  #, c-format  msgid "Executing file %s"  msgstr "" diff --git a/samples/cube.s b/samples/cube.s index 593bf79..29f36cc 100644 --- a/samples/cube.s +++ b/samples/cube.s @@ -19,6 +19,7 @@ NL		DB, ( (-8) * 65536);  oppose de L  V		DB 8 * 2;	distance pt de vue - plan de l ecran  X0		DB 40;		centre de l ecran  Y0		DB 12;		centre de l ecran +sauge		DS "\n";  .text   ; @@ -28,8 +29,8 @@ Y0		DB 12;		centre de l ecran  ;  Mult: 	MUL	R5, R6; -	SHR	Rd, 16; -	SHL	Rg, 16; +	SHR	Rd, R30; +	SHL	Rg, R30;  	ADD	R5, Rg, Rd;  	RET;   @@ -73,6 +74,7 @@ InitCube: MOV, Points3D[0], L;  	MOV, Points3D[22], NL;  	MOV, Points3D[23], NL;  ; +	MOV	R30, 16  	RET; @@ -300,7 +302,7 @@ BouclProj: MOV	R5, Points3D[R3+0];  	ADD	R6, R6, R7;   	DIV	R5, R6;  	MOV	R5, Rg; -	SHR	R5, 16; +	SHR	R5, R30;  	MOV	R6, [X0];  	ADD	R5, R5, R6;    	MOV	Points2D[R2], R5; @@ -314,7 +316,7 @@ BouclProj: MOV	R5, Points3D[R3+0];  	ADD	R6, R6, R7;   	DIV	R5, R6;  	MOV	R5, Rg; -	SHR	R5, 16; +	SHR	R5, R30;  	MOV	R6, [Y0];  	ADD	R5, R5, R6;   	MOV	Points2D[R2+1], R5; @@ -339,61 +341,157 @@ Draw:	MOV R7,  Points2D[0];  	MOV R6,  Points2D[1];  	MOV R9,  Points2D[2];  	MOV R8,  Points2D[3]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;	  	CALL DrawLine;  	MOV R7,  Points2D[2];  	MOV R6,  Points2D[3];  	MOV R9,  Points2D[4];  	MOV R8,  Points2D[5]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine;  	MOV R7,  Points2D[4];  	MOV R6,  Points2D[5];  	MOV R9,  Points2D[6];  	MOV R8,  Points2D[7]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine;	  	MOV R7,  Points2D[6];  	MOV R6,  Points2D[7];  	MOV R9,  Points2D[0];  	MOV R8,  Points2D[1]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine;  	MOV R7,  Points2D[8];  	MOV R6,  Points2D[9];  	MOV R9,  Points2D[10];  	MOV R8,  Points2D[11]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine;  	MOV R7,  Points2D[10];  	MOV R6,  Points2D[11];  	MOV R9,  Points2D[12];  	MOV R8,  Points2D[13]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine;  	MOV R7,  Points2D[12];  	MOV R6,  Points2D[13];  	MOV R9,  Points2D[14];  	MOV R8,  Points2D[15]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine;  	MOV R7,  Points2D[14];  	MOV R6,  Points2D[15];  	MOV R9,  Points2D[8];  	MOV R8,  Points2D[9]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine;  	MOV R7,  Points2D[0];  	MOV R6,  Points2D[1];  	MOV R9,  Points2D[8];  	MOV R8,  Points2D[9]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine; 	  	MOV R7,  Points2D[2];  	MOV R6,  Points2D[3];  	MOV R9,  Points2D[10];  	MOV R8,  Points2D[11]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine;  	MOV R7,  Points2D[4];  	MOV R6,  Points2D[5];  	MOV R9,  Points2D[12];  	MOV R8,  Points2D[13]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine;  	MOV R7,  Points2D[6];  	MOV R6,  Points2D[7];  	MOV R9,  Points2D[14];  	MOV R8,  Points2D[15]; +	MOV, [0xffffff06], R7; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R6; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R9; +	MOV, [0xffffff04], sauge; +	MOV, [0xffffff06], R8; +	MOV, [0xffffff04], sauge;  	CALL DrawLine;  	RET; @@ -433,10 +531,11 @@ IncrAngl: MOV	R5, [T1];  ;  .start  	CALL	InitCube; +	CALL	ClrScr;  Main: 	CALL	IncrAngl;  	CALL	MajMatr;  	CALL	RotCube;  	CALL	Proj; -	CALL	ClrScr; +	;CALL	ClrScr;  	CALL	Draw;  	JMP	Main; diff --git a/samples/drawline.s b/samples/drawline.s index aebb3bf..18ee1a9 100644 --- a/samples/drawline.s +++ b/samples/drawline.s @@ -36,11 +36,13 @@ DrawLinePrim1:	PUSH	R10  		PUSH	R12  		PUSH	R13  		PUSH	R14 +		PUSH	R30 +		MOV	R30, 1  		SUB	R13, R9, R7 -		SHL	R13, R13, 1 +		SHL	R13, R30  		SUB	R12, R8, R6  		SUB	R14, R12, R13 -		SHL	R12, R12, 1 +		SHL	R12, R30  		MOV	R10, R6  		MOV	R11, R7  DrawLinePrim1B:	JNLE	R10, R8, DrawLinePrim1O @@ -54,7 +56,8 @@ DrawLinePrim1B:	JNLE	R10, R8, DrawLinePrim1O  DrawLinePrim1C:	SUB	R14, R12  DrawLinePrim1L:	ADD	R10, 1  		JMP	DrawLinePrim1B -DrawLinePrim1O:	POP	R14 +DrawLinePrim1O:	POP	R30 +		POP	R14  		POP	R13  		POP	R12  		POP	R11 @@ -90,11 +93,13 @@ DrawLinePrim2:	PUSH	R10  		PUSH	R12  		PUSH	R13  		PUSH	R14 +		PUSH	R30 +		MOV	R30, 1  		SUB	R12, R8, R6 -		SHL	R12, R12, 1 +		SHL	R12, R30  		SUB	R13, R9, R7  		SUB	R14, R13, R12 -		SHL	R13, R13, 1 +		SHL	R13, R30  		MOV	R10, R6  		MOV	R11, R7  DrawLinePrim2B:	JNLE	R11, R9, DrawLinePrim2O @@ -108,7 +113,8 @@ DrawLinePrim2B:	JNLE	R11, R9, DrawLinePrim2O  DrawLinePrim2C:	SUB	R14, R13  DrawLinePrim2L:	ADD	R11, 1  		JMP	DrawLinePrim2B -DrawLinePrim2O:	POP	R14 +DrawLinePrim2O:	POP	R30 +		POP	R14  		POP	R13  		POP	R12  		POP	R11 @@ -144,11 +150,13 @@ DrawLinePrim3:	PUSH	R10  		PUSH	R12  		PUSH	R13  		PUSH	R14 +		PUSH	R30 +		MOV	R30, 1  		SUB	R12, R6, R8 -		SHL	R12, R12, 1 +		SHL	R12, R30  		SUB	R13, R9, R7  		SUB	R14, R13, R12 -		SHL	R13, R13, 1 +		SHL	R13, R30  		MOV	R10, R6  		MOV	R11, R7  DrawLinePrim3B:	JNLE	R11, R9, DrawLinePrim3O @@ -162,7 +170,8 @@ DrawLinePrim3B:	JNLE	R11, R9, DrawLinePrim3O  DrawLinePrim3C:	SUB	R14, R13  DrawLinePrim3L:	ADD	R11, 1  		JMP	DrawLinePrim3B -DrawLinePrim3O:	POP	R14 +DrawLinePrim3O:	POP	R30 +		POP	R14  		POP	R13  		POP	R12  		POP	R11 @@ -198,11 +207,13 @@ DrawLinePrim4:	PUSH	R10  		PUSH	R12  		PUSH	R13  		PUSH	R14 +		PUSH	R30 +		MOV	R30, 1  		SUB	R13, R9, R7 -		SHL	R13, R13, 1 +		SHL	R13, R30  		SUB	R12, R6, R8  		SUB	R14, R12, R13 -		SHL	R12, R12, 1 +		SHL	R12, R30  		MOV	R10, R6  		MOV	R11, R7  DrawLinePrim4B:	JNGE	R10, R8, DrawLinePrim4O | 
