flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3, 4 Next |
Author |
|
Mat-Quasar 11 Apr 2025, 13:30
This is a new optional update for CPU-Y, in XP style, with modification to the tab character in listbox not available in download in page 1.
Previous style is ugly Win 3.11 , all white, I didn't know before yesterday. I add "4.0" after "format PE GUI" and add XP manifest resource.
|
||||||||||||||||||||
![]() |
|
Picnic 18 Apr 2025, 09:10
Nice project! Sharing some feedback in return – this is from my PC.
![]() |
|||
![]() |
|
Mat-Quasar 18 Apr 2025, 09:51
Picnic wrote: Nice project! Sharing some feedback in return – this is from my PC. Thank you very much for trying the program and giving feedback. So many "yes" to the processor features! ![]() |
|||
![]() |
|
macomics 18 Apr 2025, 10:28
But with other fonts, you still lose alignment in the List. It's still worth looking towards OwnerDraw and drawing text columns manually.
ADD: I ran your program on Linux under Wine.
|
||||||||||
![]() |
|
Core i7 18 Apr 2025, 12:21
the code does not correctly detect the capabilities and number of cores - spend the weekend fixing the errors
Last edited by Core i7 on 29 May 2025, 18:31; edited 1 time in total |
|||
![]() |
|
Mat-Quasar 18 Apr 2025, 12:41
macomics wrote: But with other fonts, you still lose alignment in the List. It's still worth looking towards OwnerDraw and drawing text columns manually. Thanks for testing! I don't know how to draw manually, maybe just use multi-column listbox like ListView is better. |
|||
![]() |
|
Mat-Quasar 18 Apr 2025, 12:48
Core i7 wrote: the code does not correctly detect the capabilities and number of cores - spend the weekend fixing the errors Thank you for helping to test. Suddenly got 3 fellow coders help to test, I am happy! About the processor features detection, I mentioned in Page 1 that it will show correct values in Windows 10 only, since you running in earlier version of Windows, the capabilities from SSSE3 to AVX512F are not supported in detection by IsProcessorFeaturePresent API. About the number of cores, actually I use your code. In Page 1, I mentioned that in Intel CPU, the number actually means maximum number of logical processor supported, only in AMD CPU it is number of cores. Maybe I should show a tooltip for the listbox (supported in Windows 10 or later) and number of cores edit control. |
|||
![]() |
|
revolution 18 Apr 2025, 12:55
There are many CPU capabilities that the OS must enable before they are available for use. This is also reflected in the CPUID bits that a user program sees. So even if a CPU supports feature X, the OS must also enable it before a user program will see the CPUID bits set that claim feature X is supported.
Is summary, both the OS and CPU need to work together to show all the capabilities of the silicon. If an OS is "old" it might not know about feature X and thus won't enable it, then all user programs can't detect or use feature X. |
|||
![]() |
|
Core i7 18 Apr 2025, 14:03
Mat-Quasar, the correct number of cores can be read from the PEB structure, or taken from the system environment variables using the GetEnvironmentVariable() function. Try this:
Code: format pe64 console entry start include 'win64ax.inc' ;//------------------- .data buff db 0 ;//------------------ section '.text' code readable executable start: sub rsp,8 invoke GetEnvironmentVariable,<'USERNAME',0>,buff,256 cinvoke printf,<10,' User.....: %s',0>,buff invoke GetEnvironmentVariable,<'PROCESSOR_IDENTIFIER',0>,buff,256 cinvoke printf,<10,' Cpu arch.: %s',0>,buff invoke GetEnvironmentVariable,<'PROCESSOR_REVISION',0>,buff,256 cinvoke printf,<10,' Cpu rev..: %s',0>,buff invoke GetEnvironmentVariable,<'NUMBER_OF_PROCESSORS',0>,buff,256 cinvoke printf,<10,' Cpu cores: %s',10,0>,buff mov rsi,[gs:0x60] mov eax,[rsi + 0xb8] cinvoke printf,<10,' Cpu cores: %d <--- in PEB struct',0>,rax cinvoke _getch cinvoke exit,0 ;//---------- section '.idata' import data readable library msvcrt, 'msvcrt.dll', kernel32,'kernel32.dll' import msvcrt, printf,'printf',_getch,'_getch',exit,'exit' include 'api\kernel32.inc' |
|||
![]() |
|
Mat-Quasar 18 Apr 2025, 15:02
Core i7 wrote: Try this: Cool! It worked. If I recall correctly, for 32-bit, it is fs:0x30? I might consider to incorporate this in future release of CPU-Y (if any). Thanks. |
|||
![]() |
|
Core i7 18 Apr 2025, 15:13
Code: ; for x32: ;----------- mov esi,[fs:0x30] ; PEB mov eax,[esi + 0x64] ; PEB --> NumberOfProcessors |
|||
![]() |
|
macomics 18 Apr 2025, 21:25
Mat-Quasar wrote: Thanks for testing! I don't know how to draw manually, maybe just use multi-column listbox like ListView is better. https://learn.microsoft.com/en-us/windows/win32/controls/list-box-styles Everything was described a long time ago with usage examples. You just need to specify LBS_MULTICOLUMN flag or LBS_OWNERDRAWFIXED flag. MSND-List box styles-LBS_MULTICOLUMN wrote: LBS_MULTICOLUMN MSND-List box styles-LBS_OWNERDRAWFIXED wrote: LBS_OWNERDRAWFIXED https://learn.microsoft.com/en-us/windows/win32/controls/lb-setcolumnwidth MSDN-Window messages-LB_SETCOLUMNWIDTH wrote: Sets the width, in pixels, of all columns in a multiple-column list box. https://learn.microsoft.com/en-us/windows/win32/controls/wm-measureitem MSDN-Window messages-WM_MEASUREITEM wrote: Sent to the owner window of a combo box, list box, list-view control, or menu item when the control or menu is created. https://learn.microsoft.com/en-us/windows/win32/controls/wm-drawitem MSDN-Window messages-WM_DRAWITEM wrote: Sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed. |
|||
![]() |
|
flier mate 29 May 2025, 18:06
My latest update as of June 1, 2025.
(Sorry for my deleted comments in the below)
Last edited by flier mate on 01 Jun 2025, 14:18; edited 6 times in total |
||||||||||||||||||||
![]() |
|
Core i7 29 May 2025, 18:52
if by script, then consider program WMIGen: https://www.robvanderwoude.com/wmigen.php
|
|||
![]() |
|
flier mate 29 May 2025, 19:02
....
Last edited by flier mate on 30 May 2025, 16:58; edited 1 time in total |
|||
![]() |
|
revolution 30 May 2025, 02:27
The "speed" is wrong.
It uses RDTSC and Sleep to compute the CPU speed, but it really only shows the TSC timer rate , which is independent of the CPU speed, and assumes the Sleep will be precisely 1000ms, which isn't guaranteed. So when the OS ramps up and down the CPU clocks, the speed display doesn't change. |
|||
![]() |
|
revolution 30 May 2025, 03:12
Maybe changing the label to say "TSC speed" is an easy way to fix the display.
Also, consider using the affinity setting to pin the code to a single core, otherwise when coming out of sleep the code might run on a different core and the TSC value can be different between cores. In short, the TSC is a lousy thing to work with, other methods would likely work better and more reliably. |
|||
![]() |
|
flier mate 30 May 2025, 04:01
....
Last edited by flier mate on 30 May 2025, 16:59; edited 2 times in total |
|||
![]() |
|
revolution 30 May 2025, 04:15
If the code is going to show the TSC rate, then consider using the QPF/QPC calls to measure the sleep time more accurately. A bare "Sleep 1000" will only be an approximate time giving poor precision.
|
|||
![]() |
|
Goto page Previous 1, 2, 3, 4 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.