View difference between Paste ID: 1dgvcgQf and MVi6SaUA
SHOW: | | - or go back to the newest paste.
1
// ProvaAssembly.cpp: definisce il punto di ingresso dell'applicazione console.
2
//
3
4
#include "stdafx.h"
5
#include "stdlib.h"
6
7
int main()
8
{
9-
	unsigned short int Mat = 9270; // INSERIRE QUI LE 4 CIFRE MENO SIGNIFICATIVE DELLA
9+
	unsigned short int Mat = 0161; // INSERIRE QUI LE 4 CIFRE MENO SIGNIFICATIVE DELLA
10
	unsigned char Vet[100]; // Vettore di 100 BYTE
11
	unsigned short Ris1, Ris2, Ris3, Ris4, Ris5; // WORD
12
13
	__asm {
14
		XOR ECX,ECX
15
		MOV CX,Mat
16
		MOV AX,CX
17
		AND CX, 0007h
18
		ADD CX,8
19
		SUB DX,DX
20
		DEC DX
21
		L1:	XOR AX,DX
22
		LOOP L1
23
		INC AX
24
		MOV Ris1,AX
25
		////-----------------
26
		MOV AX,Mat
27
		AND AL,AH
28
		AND AL,0100b
29
		JNZ L2
30
		INC AL
31
		JMP L3
32
		L2: SUB AL,-7
33
		L3: MOV Ris2,AX
34
		////--------
35
		MOV AX, Mat
36
		LEA ESI, Vet
37
		MOV[ESI + 10], AX
38
		SHL AX, 4
39
		MOV[ESI + 12], AX
40
		MOV ECX, 4
41
		L4: MOV AH, [ESI + ECX + 9]
42
		MOV[ESI + ECX + 20], AH
43
		LOOP L4
44
		MOV AH, [ESI + 24]
45
		XOR AL, AL
46
		MOV Ris3, AX
47
		//--------------------
48
		MOV AX, Mat
49
		AND AX, 00FFh
50
		OR AX, 0100h
51
		MOV BL, 7
52
		DIV BL
53
		MOV Ris4, AX
54
		//-------------
55
		MOV AX, Mat
56
		MOV BL, -2
57
		AND BL, 6Fh
58
		XOR BL, 0F6h
59
		SHR AX, 4
60
		OR AL, 7
61
		AND AX, 007Fh
62
		MOV BL, -3
63
		IMUL BL
64
		MOV Ris5, AX
65
		//---------	
66
	}	
67
	system("PAUSE");
68
	return 0;
69
}