Recent Posts

Pages: [1] 2 3 ... 10
1
Thanks hutch-- 
2
Get rid of this at the start of your code.

.386
.MODEL     flat, stdcall
OPTION     casemap :none

It is already done in masm32rt.inc.
3
The Laboratory / Re: Hyperthreading - Revisited
« Last post by hutch-- on Today at 12:42:15 AM »
Quote
4) The locking and synchronization setup between these threads and the custom scheduler is implemented primarily with a user-mode spinlock and atomic operations, as I've found these to be considerably faster than using the kernel ones.
I agree with this approach, the Intel instruction is also very slow where a simple spinlock may cost locking a core for some pico seconds but its close enough to instant when it unlocks.
4
caballero ,

Half of it i already figured it out by looking at many examples . I will try to understand the remaining when i  can find a  little bit more time

Thanks  :biggrin:
5
Thais is a code i posted here some days ago. What do you want todo ask?
6
The Laboratory / Re: Hyperthreading - Revisited
« Last post by johnsa on October 19, 2018, 11:51:35 PM »

For my implementation of multi-core support I basically took the following approach:

1) Create a thread-pool of size N (N == logical core count).
2) The threads themselves run a custom user-space scheduler so that when I need a thread I don't have the overhead of creating one, I just assign a task and it wakes up and does it.
    This has had huge performance gains for me especially when you want to quickly fire off a bunch of parallel tasks at a high rate (IE: not long running threads).
3) the threads are assigned to every even processor first, then every odd, so that if you have 4 real cores + 4 HT cores, and you request 4 parallel tasks they will be allocated to real cores, only if the number of tasks   
    > physical cores do the HT ones come into play.
4) The locking and synchronization setup between these threads and the custom scheduler is implemented primarily with a user-mode spinlock and atomic operations, as I've found these to be considerably faster than using the kernel ones.

One way to use this setup dynamically for example during a rendering-loop is run some tasks with say 4 threads, then every 5 iterations up the core count until the frametime in ms is no longer dropping.
That way you know you've reached the limit for the particular machine given ram, cores, latency and whatever else may be at play. It's basically like run-time profiling to determine the optimal thread-count.

7
Examples / Re: Release version FP calculator
« Last post by hutch-- on October 19, 2018, 08:16:45 PM »
Use a later version of MASM. The old ones will not do the later stuff. It looks like you tried to build the app without the correct files and libraries available. Unless you have downloaded the most recent version of the MASM64 project here you cannot build it. This means both the latest macro file, the latest MASM64 libraries and to build them you need a reasonably recent version of ML64, LINK and RC as binaries.

I got the latest with the VS Build tools which was a bit over 1 gig.

I don't know what OS version you are running and further, did the original executable run on your machine ?
8
Examples / Re: Release version FP calculator
« Last post by Adamanteus on October 19, 2018, 07:52:12 PM »
Hutch - some questions :
1) My VS2008 ML64, truly not understand what is it :
Code: [Select]
msgloop proc

    USING r14,r15
- looks, like mought bo so :
Code: [Select]
msgloop proc USES r14 r152) also it not understand xmm registers, as .XMM - not works in it, so I changed all computations on FPU - but example of SSE anyway is excellent
3) default font charset - better avoid, as it looks not well on me, so better to local procedure :
font_handle - CreateFont,fHgt,0,0,0,fWgt,0,0,0,ANSI_CHARSET
4) and focus on edit, I used to put by mouse :
Code: [Select]
        invoke SendMessage,hEdit,EM_SETMARGINS,EC_LEFTMARGIN or EC_RIGHTMARGIN,eax
        invoke SetFocus, hEdit
9
The Campus / Re: Can someone please help me understand this code line by line ?
« Last post by xvarvalue on October 19, 2018, 06:33:45 PM »
Thanks for the reply jj2007 , hutch--

I suddeny have an awesome idea , i have decided to make notes in a notebook .



 :biggrin:
10
The Campus / Re: Can someone please help me understand this code line by line ?
« Last post by hutch-- on October 19, 2018, 02:34:50 PM »
Here is how you would normally write a test piece in MASM32.

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    include \masm32\include\masm32rt.inc
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

comment * -----------------------------------------------------
                        Build this  template with
                       "CONSOLE ASSEMBLE AND LINK"
        ----------------------------------------------------- *

    .code

start:
   
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    call main
    inkey
    exit

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

main proc

    LOCAL pbuf  :DWORD
    LOCAL buff[64]:BYTE
    LOCAL var1  :DWORD
    LOCAL var2  :DWORD

    lea eax, buff
    mov pbuf, eax                           ; get the buffer address

    print "Enter only numbers",13,10,13,10

    print "Enter your first number",13,10
    invoke StdIn,pbuf,64
    mov var1, uval(pbuf)                    ; unsigned conversion

    print "Enter your second number",13,10
    invoke StdIn,pbuf,64
    mov var2, uval(pbuf)                    ; unsigned conversion

    mov eax, var2                           ; copy var2 to eax
    add var1, eax                           ; add eax to var1

    print "The sum of the two numbers = "
    print str$(var1),13,10,13,10            ; display result in var1

    ret

main endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

end start
Pages: [1] 2 3 ... 10