After scratching my head looking for the reasons the Intel emulator does not properly identify TSX instructions I found that the answer lies in a mysterious switch that we only know about in the extended help.
So, if I do: "sde -help" in the command line, nothing surfaces about TSX. But if I do "sde -long-help" it is all there.
Now, if I have a file called tsx.exe with TSX instructions, I can make the emulator run as if it had an Haswell CPU (before TSX being disabled in the Haswell CPU :lol: ). Well, it appears that in real life, TSX instructions are currently disabled in all recent CPUs, except some server models, but someday all will be back to normal and we all will be more happy with those TSX instructions.
This is my reviewed TSX identification snippet, tested on the emulator.
includelib \masm32\lib64\msvcrt.lib
printf PROTO :PTR, :VARARG
includelib \masm32\lib64\kernel32.lib
ExitProcess PROTO :DWORD
.data
nortm db "RTM not supported",10,0
rtm db "RTM supported",10,0
nohle db "HLE not supported",10,0
hle db "HLE supported",10,0
.code
main proc
sub rsp, 28h
; Are RTM & HLE supported?
mov eax, 7
mov ecx, 0
cpuid
bt ebx, 11
jc rtmsup
mov rcx, offset nortm
call printf
jmp short skiprtmsup
rtmsup:
mov rcx, offset rtm
call printf
skiprtmsup:
bt ebx, 4
jc hlesup
mov rcx, offset nohle
call printf
jmp short exit
hlesup:
mov rcx, offset hle
call printf
exit:
mov rcx, 0
call ExitProcess
main endp
end
I was also badmouthing MASM for not recognizing any of the instructions XACQUIRE,LOCK,XRELEASE,XBEGIN,XEND,XABORT. Actually, it does recognize, I was not using the correct syntax.