Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Recensione vivo X300 Pro: è ancora lui il re della fotografia mobile, peccato per la batteria
Recensione vivo X300 Pro: è ancora lui il re della fotografia mobile, peccato per la batteria
vivo X300 Pro rappresenta un'evoluzione misurata della serie fotografica del produttore cinese, con un sistema di fotocamere migliorato, chipset Dimensity 9500 di ultima generazione e l'arrivo dell'interfaccia OriginOS 6 anche sui modelli internazionali. La scelta di limitare la batteria a 5.440mAh nel mercato europeo, rispetto ai 6.510mAh disponibili altrove, fa storcere un po' il naso
Lenovo Legion Go 2: Ryzen Z2 Extreme e OLED 8,8'' per spingere gli handheld gaming PC al massimo
Lenovo Legion Go 2: Ryzen Z2 Extreme e OLED 8,8'' per spingere gli handheld gaming PC al massimo
Lenovo Legion Go 2 è la nuova handheld PC gaming con processore AMD Ryzen Z2 Extreme (8 core Zen 5/5c, GPU RDNA 3.5 16 CU) e schermo OLED 8,8" 1920x1200 144Hz. È dotata anche di controller rimovibili TrueStrike con joystick Hall effect e una batteria da 74Wh. Rispetto al dispositivo che l'ha preceduta, migliora ergonomia e prestazioni a basse risoluzioni, ma pesa 920g e costa 1.299€ nella configurazione con 32GB RAM/1TB SSD e Z2 Extreme
AWS re:Invent 2025: inizia l'era dell'AI-as-a-Service con al centro gli agenti
AWS re:Invent 2025: inizia l'era dell'AI-as-a-Service con al centro gli agenti
A re:Invent 2025, AWS mostra un’evoluzione profonda della propria strategia: l’IA diventa una piattaforma di servizi sempre più pronta all’uso, con agenti e modelli preconfigurati che accelerano lo sviluppo, mentre il cloud resta la base imprescindibile per governare dati, complessità e lock-in in uno scenario sempre più orientato all’hybrid cloud
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 06-09-2004, 23:55   #1
Luc@s
Senior Member
 
L'Avatar di Luc@s
 
Iscritto dal: Apr 2002
Città: Vigevano(PV)
Messaggi: 2124
[Asmx86]Flag

Codice:
; Source name : 
; Executable name : 
; Code model: : Real mode flat model
; Version : 
; Created date : 
; Last update : 
; Author : Luca Francesca
; Description : A utility to query and display information about CPU 
; Compiling on : NASM

[BITS 16]
[ORG 0100h] ; for .com

[SECTION .text]
start:
	mov dx, Title
	mov ah, 09h
	int 21h
	
	mov dx, NewLine
	mov ah, 09h
	int 21h
	
	mov dx, Name
	mov ah, 09h
	int 21h
	
	mov eax, 80000002h
	cpuid
	mov [ProcessorStr],    eax
	mov [ProcessorStr+4],  ebx
	mov [ProcessorStr+8],  ecx
	mov [ProcessorStr+12], edx
	
	mov eax, 80000003h
	cpuid
	mov [ProcessorStr+16], eax
	mov [ProcessorStr+20], ebx
	mov [ProcessorStr+24], ecx
	mov [ProcessorStr+28], edx
	
	mov byte [ProcessorStr+32], 13 ; CR
	mov byte [ProcessorStr+33], 10 ; LF
	mov byte [ProcessorStr+34], '$' ; String termining
	
	mov dx, ProcessorStr
	mov ah, 09h
	int 21h
		
	mov eax, 1h
	cpuid
	
	mov dx, Fam 
	mov ah, 09h
	int 21h
	;bits 11-8 (reg_eax & 0xf00) >> 8;
	mov dx, NewLine
	mov ah, 09h
	int 21h
	
	mov dx, Mod 
	mov ah, 09h
	int 21h
	;bits 7-4 f0 (reg_eax & 0xf0) >> 4;
	mov dx, NewLine
	mov ah, 09h
	int 21h
	
	mov dx, NewLine
	mov ah, 09h
	int 21h
	
	mov dx, Vendor
	mov ah, 09h
	int 21h
	
	mov eax, 0h
	cpuid
	
	mov [VendorStr], ebx
	mov [VendorStr+4], edx
	mov [VendorStr+8], ecx
	mov byte [VendorStr+12], 13 ; CR
	mov byte [VendorStr+13], 10 ; LF
	mov byte [VendorStr+14], '$' ; String termining
	mov dx, VendorStr
	mov ah, 09h
	int 21h
	
	mov dx, NewLine
	mov ah, 09h
	int 21h
	
	mov dx, Ext
	mov ah, 09h
	int 21h
	
	; extension info
	mov eax, 1h
	cpuid
	
	test edx, 00800000h ; MMX bit(23)
	jnz MMX
	
	xor eax, eax 
	
	test edx, 002000000h ; SSE bit(25)
	jnz SSE
				
	xor eax, eax 
	
	test edx, 004000000h ; SSE2 bit(26)
	jnz SSE_TWO
				
	xor eax, eax 
	
	test ecx, 000000001h ; SSE3 bit(0)
	jnz SSE_THREE
				
	xor eax, eax 
	
	test edx, 0040000000h ; 3DNow! bit(30)
	jnz AMD_NOW
				
	xor eax, eax 
	
	test edx, 0080000000; 3DNow! Extensions bit(31)
	jnz AMD_NOW_EXT
					
	xor eax, eax 
	
	; exit to the program
	jmp exit

MMX:
	mov dx, MMXMsg 
	mov ah, 09h
	int 21h
	
SSE:
	mov dx, SSEMsg 
	mov ah, 09h
	int 21h

SSE_TWO:
	mov dx, SSE_TWOMsg 
	mov ah, 09h
	int 21h

SSE_THREE:
	mov dx, SSE_THREEMsg 
	mov ah, 09h
	int 21h

AMD_NOW:
	mov dx, AMD_NOWMsg
	mov ah, 09h
	int 21h

AMD_NOW_EXT:
	mov dx, AMD_NOW_EXTMsg
	mov ah, 09h
	int 21h

exit:
	; set int 21h service 4Ch(exit)
	mov ah, 4Ch
	int 21h

[SECTION .data]

NewLine db 13, 10, '$'
Title db "§§§§§ Lucas CPUID program §§§§§", 13, 10, '$'
Name db "=> Cpu Name: ", '$'
Vendor db "=> Cpu Vendor: ", '$'
Ext db "=> Cpu supported extension:", 13, 10, '$'

Fam db "==> Cpu Family: ", '$'
Mod db "===> Cpu Model: ", '$'

; Intel specific instruction
MMXMsg db "*This CPU support the 'MMX' instructions", 13, 10, '$'
SSEMsg db "*This CPU support the 'SSE' instructions", 13, 10, '$'
SSE_TWOMsg db "*This CPU support the 'SSE2' instructions", 13, 10, '$'
SSE_THREEMsg db "*This CPU support the 'SSE3' instructions", 13, 10, '$'

; AMD specific instructions
AMD_NOWMsg db "*This CPU support the '3DNow!' instructions", 13, 10, '$'
AMD_NOW_EXTMsg db "*This CPU support the '3DNow!+ Extensions' instructions", 13, 10, '$'

[SECTION .bss]
VendorStr resb 14    ; Reserve 12 bytes for cpu's vendor string
ProcessorStr resb 34 ; Reserve 31 +3(\n) bytes for cpu's vendor string
Family resb 7  ; 4 + 3(\n)
Model resb 7   ; 4 + 3(\n)
Ma il risultato è:
Quote:
§§§§§ Lucas CPUID program §§§§§

=> Cpu Name: AMD Athlon(tm) XP 2600+
==> Cpu Family:
===> Cpu Model:

=> Cpu Vendor: AuthenticAMD

=> Cpu supported extension:
*This CPU support the 'MMX' instructions
*This CPU support the 'SSE' instructions
*This CPU support the 'SSE2' instructions
*This CPU support the 'SSE3' instructions
*This CPU support the '3DNow!' instructions
*This CPU support the '3DNow!+ Extensions' instructions
Sia le SSE2 che le SSE3 extensions nn sono supportate dalla mia cpu...... allora perche mi da il supporto???
__________________
Gnu/Linux User
Luc@s è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 02:32   #2
VICIUS
Senior Member
 
L'Avatar di VICIUS
 
Iscritto dal: Oct 2001
Messaggi: 11471
Re: [Asmx86]Flag

Quote:
Originariamente inviato da Luc@s
[...]
MMX:
mov dx, MMXMsg
mov ah, 09h
int 21h

[...]
Uhm non è che alla fine di questi blocchi qui dove stampi il messaggio ti sei scordato di tornare al flusso principale del programma.

ciao
VICIUS è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 08:13   #3
Luc@s
Senior Member
 
L'Avatar di Luc@s
 
Iscritto dal: Apr 2002
Città: Vigevano(PV)
Messaggi: 2124
Re: Re: [Asmx86]Flag

Quote:
Originariamente inviato da VICIUS
Uhm non è che alla fine di questi blocchi qui dove stampi il messaggio ti sei scordato di tornare al flusso principale del programma.

ciao
ho messo il ret ma cosi mi stampa solo il supporto a MMX
__________________
Gnu/Linux User
Luc@s è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 08:22   #4
Luc@s
Senior Member
 
L'Avatar di Luc@s
 
Iscritto dal: Apr 2002
Città: Vigevano(PV)
Messaggi: 2124
Codice:
 
; Source name : 
; Executable name : CPUID.COM
; Code model: : Real mode flat model
; Version : 1.0
; Created date : 7/9/2004
; Last update : 7/9/2004
; Author : Luca Francesca
; Description : A utility to display information about CPU 
; Compiling on : NASM

[BITS 16] ; 16bit output
[ORG 0100h] ; for .com

[SECTION .text]
start:
	mov dx, Title
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov dx, NewLine
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov dx, Name
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov eax, 80000002h
	cpuid
	mov [ProcessorStr],    eax
	mov [ProcessorStr+4],  ebx
	mov [ProcessorStr+8],  ecx
	mov [ProcessorStr+12], edx
	
	mov eax, 80000003h
	cpuid
	mov [ProcessorStr+16], eax
	mov [ProcessorStr+20], ebx
	mov [ProcessorStr+24], ecx
	mov [ProcessorStr+28], edx
	
	mov eax, 80000004h ; required from Intel, optional in AMD
	cpuid
	mov [ProcessorStr+32], eax
	mov [ProcessorStr+36], ebx
	mov [ProcessorStr+40], ecx
	mov [ProcessorStr+44], edx
	
	mov byte [ProcessorStr+48], 13 ; CR
	mov byte [ProcessorStr+49], 10 ; LF
	mov byte [ProcessorStr+50], '$' ; String termining
	
	mov dx, ProcessorStr
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
		
	mov eax, 1h
	cpuid
	
	mov dx, Fam 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	;bits 11-8 (reg_eax & 0xf00) >> 8;
	mov dx, NewLine
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov dx, Mod 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	;bits 7-4 f0 (reg_eax & 0xf0) >> 4;
	mov dx, NewLine
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov dx, NewLine
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov dx, Vendor
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string) 
	int 21h
	
	mov eax, 0h
	cpuid
	
	mov [VendorStr], ebx
	mov [VendorStr+4], edx
	mov [VendorStr+8], ecx
	mov byte [VendorStr+12], 13 ; CR
	mov byte [VendorStr+13], 10 ; LF
	mov byte [VendorStr+14], '$' ; String termining
	mov dx, VendorStr
	mov ah, 09h
	int 21h
	
	mov dx, NewLine
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov dx, Ext
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	; extension info
	mov eax, 1h
	cpuid
	
	test edx, 00800000h ; MMX bit(23)
	jnz MMX

	test edx, 002000000h ; SSE bit(25)
	jnz SSE
	
	test edx, 004000000h ; SSE2 bit(26)
	jnz SSE_TWO
				
	test ecx, 000000001h ; SSE3 bit(0)
	jnz SSE_THREE

	test edx, 0040000000h ; 3DNow! bit(30)
	jnz AMD_NOW

	test edx, 0080000000; 3DNow! Extensions bit(31)
	jnz AMD_NOW_EXT
	
	; exit to the program
	jmp exit

MMX:
	push edx
	mov dx, MMXMsg 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx
	ret
	
SSE:
	push edx
	mov dx, SSEMsg  
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx
	ret
	
SSE_TWO:
	push edx
	mov dx, SSE_TWOMsg 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx
	ret
	
SSE_THREE:
	push edx
	mov dx, SSE_THREEMsg 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx
	ret
	
AMD_NOW:
	push edx
	mov dx, AMD_NOWMsg
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx
	ret
	
AMD_NOW_EXT:
	push edx
	mov dx, AMD_NOW_EXTMsg
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx
	ret
	
exit:
	mov ah, 4Ch ; set int 21h service 4Ch(exit)
	int 21h

[SECTION .data]

NewLine db 13, 10, '$'
Title db "§§§§§ Lucas CPUID program §§§§§", 13, 10, '$'
Name db "=> Cpu Name: ", '$'
Vendor db "=> Cpu Vendor: ", '$'
Ext db "=> Cpu supported extension:", 13, 10, '$'

Fam db "==> Cpu Family: ", '$'
Mod db "===> Cpu Model: ", '$'

; Intel specific instruction
MMXMsg db "*This CPU support the 'MMX' instructions", 13, 10, '$'
SSEMsg db "*This CPU support the 'SSE' instructions", 13, 10, '$'
SSE_TWOMsg db "*This CPU support the 'SSE2' instructions", 13, 10, '$'
SSE_THREEMsg db "*This CPU support the 'SSE3' instructions", 13, 10, '$'

; AMD specific instructions
AMD_NOWMsg db "*This CPU support the '3DNow!' instructions", 13, 10, '$'
AMD_NOW_EXTMsg db "*This CPU support the '3DNow!+ Extensions' instructions", 13, 10, '$'

[SECTION .bss]
VendorStr resb 14    ; Reserve 12 bytes for cpu's vendor string
ProcessorStr resb 50 ; Reserve 47 +3(\n) bytes for cpu's vendor string
Family resb 7  ; 4 + 3(\n)
Model resb 7   ; 4 + 3(\n)
Ho pensato fosse xche da una jmp all'altra cancellavo il valore di edx...cosi l'ho preservato...ma mi da solo il supporto alle MMX :'(
__________________
Gnu/Linux User
Luc@s è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 09:15   #5
VICIUS
Senior Member
 
L'Avatar di VICIUS
 
Iscritto dal: Oct 2001
Messaggi: 11471
Quote:
Originariamente inviato da Luc@s
[...]
Ho pensato fosse xche da una jmp all'altra cancellavo il valore di edx...cosi l'ho preservato...ma mi da solo il supporto alle MMX :'(
Uhm ma perchè mettere una ret non fai mica una call solo una jnz. Quello che intendevo io per ritornare al flusso originale del programma era una cosa simile a questa:
Codice:
TEST_MMX:	test edx, 00800000h ; MMX bit(23)
	jnz MMX

TEST_SSE:	test edx, 002000000h ; SSE bit(25)
	jnz SSE
	
TEST_SSE2:	test edx, 004000000h ; SSE2 bit(26)
	jnz SSE_TWO
[...]
MMX:
	mov dx, MMXMsg 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	jmp TEST_SSE

SSE:
	mov dx, SSEMsg  
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
        jmp TEST_SSE2
[...]
ciao
VICIUS è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 09:20   #6
Luc@s
Senior Member
 
L'Avatar di Luc@s
 
Iscritto dal: Apr 2002
Città: Vigevano(PV)
Messaggi: 2124
ma nn entra in loop infinito come dici tu?
__________________
Gnu/Linux User
Luc@s è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 10:32   #7
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
Io non capisco il perchè di fare una JMP !?!??!
Codice:
	test edx, 00800000h ; MMX bit(23)
	mov dx, MMXMsg 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
cionci è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 11:02   #8
Luc@s
Senior Member
 
L'Avatar di Luc@s
 
Iscritto dal: Apr 2002
Città: Vigevano(PV)
Messaggi: 2124
nn va lo stesso
__________________
Gnu/Linux User
Luc@s è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 11:08   #9
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
In effetti mi dimenticavo dell'if In maniera simile a come diceva VICIUS:
Codice:
TEST_MMX:	test edx, 00800000h ; MMX bit(23)
	jz TEST_SSE
	push edx
	mov dx, MMXMsg 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop edx

TEST_SSE:	test edx, 002000000h ; SSE bit(25)
	jz TEST_SSE2
	push edx
	mov dx, SSEMsg  
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop edx
	
TEST_SSE2:	test edx, 004000000h ; SSE2 bit(26)
Come vedi, mettendo in sequenza il codice ti eviti qualche salto...
Inoltre sporcavi EDX...

Ultima modifica di cionci : 07-09-2004 alle 11:11.
cionci è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 11:21   #10
Luc@s
Senior Member
 
L'Avatar di Luc@s
 
Iscritto dal: Apr 2002
Città: Vigevano(PV)
Messaggi: 2124
Codice:
TEST_SSE2: test edx, 4000000h ; SSE2 bit(26)
	jz TEST_SSE2
	push edx
	mov dx, SSE_TWOMsg 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx

TEST_AMD_NOW:	test edx, 40000000h ; 3DNow! bit(30)
	push edx
	jz TEST_AMD_NOW
	mov dx, AMD_NOWMsg
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx

TEST_AMD_NOW_PLUS:	test edx, 80000000; 3DNow! Extensions bit(31)
	push edx
	jz TEST_AMD_NOW_PLUS
	mov dx, AMD_NOW_EXTMsg
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx
Questi nn me li visualizza.....sta il loop dopo avermi mostrato il support per MMX e SSE
__________________
Gnu/Linux User
Luc@s è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 12:19   #11
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
Il push va messo dopo il JZ...
cionci è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 13:27   #12
Luc@s
Senior Member
 
L'Avatar di Luc@s
 
Iscritto dal: Apr 2002
Città: Vigevano(PV)
Messaggi: 2124
Quote:
Originariamente inviato da cionci
Il push va messo dopo il JZ...

anche cosi mi da solo MMX e SSE e non entrambe le 3dNow!
__________________
Gnu/Linux User
Luc@s è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 14:59   #13
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
Incolla un po' tutto il codice...
cionci è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 15:03   #14
Luc@s
Senior Member
 
L'Avatar di Luc@s
 
Iscritto dal: Apr 2002
Città: Vigevano(PV)
Messaggi: 2124
Codice:
 
; Source name : 
; Executable name : CPUID.COM
; Code model: : Real mode flat model
; Version : 1.0
; Created date : 6/9/2004
; Last update : 7/9/2004
; Author : Luca Francesca
; Description : A utility to display information about CPU 
; Compiling on : NASM

[BITS 16] ; 16bit output
[ORG 0100h] ; for .com

[SECTION .text]
start:
	mov dx, Title
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov dx, NewLine
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov dx, Name
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov eax, 80000002h
	cpuid
	mov [ProcessorStr],    eax
	mov [ProcessorStr+4],  ebx
	mov [ProcessorStr+8],  ecx
	mov [ProcessorStr+12], edx
	
	mov eax, 80000003h
	cpuid
	mov [ProcessorStr+16], eax
	mov [ProcessorStr+20], ebx
	mov [ProcessorStr+24], ecx
	mov [ProcessorStr+28], edx
	
	mov eax, 80000004h ; required from Intel, optional in AMD
	cpuid
	mov [ProcessorStr+32], eax
	mov [ProcessorStr+36], ebx
	mov [ProcessorStr+40], ecx
	mov [ProcessorStr+44], edx
	
	mov byte [ProcessorStr+48], 13 ; CR
	mov byte [ProcessorStr+49], 10 ; LF
	mov byte [ProcessorStr+50], '$' ; String termining
	
	mov dx, ProcessorStr
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
		
	mov eax, 1h
	cpuid
	
	mov dx, NewLine
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov dx, Vendor
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string) 
	int 21h
	
	mov eax, 0h
	cpuid
	
	mov [VendorStr], ebx
	mov [VendorStr+4], edx
	mov [VendorStr+8], ecx
	mov byte [VendorStr+12], 13 ; CR
	mov byte [VendorStr+13], 10 ; LF
	mov byte [VendorStr+14], '$' ; String termining
	mov dx, VendorStr
	mov ah, 09h
	int 21h
	
	mov dx, NewLine
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	mov dx, Ext
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	
	; extension info
	mov eax, 1h
	cpuid
	
TEST_MMX:	test edx, 800000h ; MMX bit(23)
	jz TEST_MMX
	push edx
	mov dx, MMXMsg 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop edx

TEST_SSE:	test edx, 2000000h ; SSE bit(25)
	jz TEST_SSE
	push edx
	mov dx, SSEMsg  
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop edx
	
TEST_SSE2: test edx, 4000000h ; SSE2 bit(26)
	jz TEST_SSE2
	push edx
	mov dx, SSE_TWOMsg 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx

TEST_AMD_NOW:	test edx,  40000000h ; 3DNow! bit(30)
	jz TEST_AMD_NOW
	push edx
	mov dx, AMD_NOWMsg
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx

TEST_AMD_NOW_PLUS:	test edx, 80000000; 3DNow! Extensions bit(31)
	jz TEST_AMD_NOW_PLUS
	push edx
	mov dx, AMD_NOW_EXTMsg
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx
	
	; exit to the program
	mov ah, 4Ch ; set int 21h service 4Ch(exit)
	int 21h

[SECTION .data]

NewLine db 13, 10, '$'
Title db "<<<< Lucas CPUID program >>>>", 13, 10, '$'
Name db "=> Cpu Name: ", '$'
Vendor db "=> Cpu Vendor: ", '$'
Ext db "=> Cpu supported extension:", 13, 10, '$'

Fam db "==> Cpu Family: ", '$' ; The CPU Family string
Mod db "===> Cpu Model: ", '$' ; The CPU Model string

; Intel specific instruction
MMXMsg db "*This CPU support the 'MMX' instructions", 13, 10, '$'
SSEMsg db "*This CPU support the 'SSE' instructions", 13, 10, '$'
SSE_TWOMsg db "*This CPU support the 'SSE2' instructions", 13, 10, '$'

; AMD specific instructions
AMD_NOWMsg db "*This CPU support the '3DNow!' instructions", 13, 10, '$'
AMD_NOW_EXTMsg db "*This CPU support the '3DNow!+ Extensions' instructions", 13, 10, '$'

[SECTION .bss]
VendorStr resb 14    ; Reserve 12 bytes for cpu's vendor string
ProcessorStr resb 50 ; Reserve 47 +3(\n) bytes for cpu's vendor string
Family resb 7  ; 4 + 3(\n)
Model resb 7   ; 4 + 3(\n)
__________________
Gnu/Linux User
Luc@s è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 15:13   #15
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
Hai sbagliaot le etichette di salto... Dal test sulle MMX devi saltare (se non ci sono le MMX) al test sulle SSE e così via
Come hai scritto te va in ciclo appena trovi una feature che non c'è sul tuo processore...
TEST_MMX lo puoi anche togliere...
cionci è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 15:18   #16
Luc@s
Senior Member
 
L'Avatar di Luc@s
 
Iscritto dal: Apr 2002
Città: Vigevano(PV)
Messaggi: 2124
cioe, giusto per capire bene:

Codice:
TEST_MMX:	test edx, 800000h ; MMX bit(23)
	jz TEST_SSE
	push edx
	mov dx, MMXMsg 
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop edx
Questo prima esegue il test MMX e stampa e poi esegue il test SSE....giusto???
Spiegami il perche cosi imparo bene
__________________
Gnu/Linux User
Luc@s è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 15:28   #17
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
Esegue il test SSE dopo perchè...o ci arriva tramite il salto (in caso in cui il bit relativo a MMX sia a 0) o ci arriva perchè il test SSE è l'istruzione successiva alla pop...
cionci è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 15:59   #18
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
C'è un errore qui:
Codice:
TEST_AMD_NOW_PLUS:	test edx, 80000000; 3DNow! Extensions bit(31)
	jz FINE_TEST
	push edx
	mov dx, AMD_NOW_EXTMsg
	mov ah, 09h ; set int 21h service 09h(print '$'-terminated string)
	int 21h
	pop	edx

	; exit to the program
	mov ah, 4Ch ; set int 21h service 4Ch(exit)
	int 21h
FINE_TEST:
Altrimenti ti stampa sempre 3dNow!+...
cionci è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 16:02   #19
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
Ed un errore qui:
Codice:
TEST_SSE2: test edx, 4000000h ; SSE2 bit(26)
	jz TEST_AMD_NOW
	push edx
In questo modo se ti trova le SSE2 il test per le SSE3 non te lo fa...
cionci è offline   Rispondi citando il messaggio o parte di esso
Old 07-09-2004, 16:24   #20
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
Si dice Fixed, non Corrected
cionci è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


Recensione vivo X300 Pro: è ancora lui il re della fotografia mobile, peccato per la batteria Recensione vivo X300 Pro: è ancora lui il...
Lenovo Legion Go 2: Ryzen Z2 Extreme e OLED 8,8'' per spingere gli handheld gaming PC al massimo Lenovo Legion Go 2: Ryzen Z2 Extreme e OLED 8,8'...
AWS re:Invent 2025: inizia l'era dell'AI-as-a-Service con al centro gli agenti AWS re:Invent 2025: inizia l'era dell'AI-as-a-Se...
Cos'è la bolla dell'IA e perché se ne parla Cos'è la bolla dell'IA e perché se...
BOOX Palma 2 Pro in prova: l'e-reader diventa a colori, e davvero tascabile BOOX Palma 2 Pro in prova: l'e-reader diventa a ...
iPhone Fold: scorte limitate al lancio m...
OpenAI porterà la pubblicità in ChatGPT ...
TSMC aumenterà ancora i prezzi: nel 2026...
Marvel pubblica anche il secondo teaser ...
Nuovo accordo tra xAI e il Pentagono: l'...
La famiglia Xiaomi 17 sta per registrare...
Nuove auto elettriche che vedremo sul me...
E-bike illegali, a Verona il più ...
Quali sono i giochi più venduti su Steam...
HONOR sta per lanciare un nuovo smartpho...
Jared Isaacman sarà alla guida de...
Il Tesla Cybertruck non arriverà ...
Xiaomi Watch 5 è ufficiale: architettura...
CD Projekt vende GOG: il co-fondatore Mi...
Il meglio di Amazon in 26 prodotti, aggi...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 05:40.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Served by www3v