Recent Posts

Pages: [1] 2 3 ... 10
1
Examples / Re: Plenty of registers with no stack frame.
« Last post by HSE on Today at 02:11:18 AM »
2
The Workshop / Re: Fast transposing matrix procedure for any size
« Last post by zedd151 on Today at 01:43:01 AM »
Hi Rui!


Just the kind of building block a beginner needs. Nevermind the naysayers.


Also, I'm glad it's 32 bit code, as I have given up with 64 bit coding for time being.
3
Examples / Plenty of registers with no stack frame.
« Last post by hutch-- on Today at 01:41:21 AM »
I have toyed with this idea for a while, the MMX functionality has been superseded by SSE/AVX and there are 8 64 bit registers that are usually not used for anything and as Win64 integer registers are also 64 bit, the logic was to make use of them for storage, in this case, the preservation of non-volatile registers in procedures that have no stack frame.

It comes at the price that if you wish to use the same set of aliased registers for floating point operations, you will need to use the "emms" mnemonic to clear the multi-media state before you perform floating point operations. Now be warned that using a technique like this is politically incorrect, illegal, immoral and fattening but it seems to work OK.  :P

The output for this test piece is as follows.

Before 0 0 0 0 0 0 0 1376080
During 1 2 3 4 5 6 7 8
After  0 0 0 0 0 0 0 1376080
Press any key to continue...

The example.

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

    include \masm32\include64\masm64rt.inc

    .code

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

entry_point proc

    conout "Before ",str$(rbx)," ",str$(r12)," ",str$(r13)," ",str$(r14)," ", \
           str$(r15)," ",str$(rsi)," ",str$(rdi)," ",str$(rbp),lf

    call testme

    conout "After  ",str$(rbx)," ",str$(r12)," ",str$(r13)," ",str$(r14)," ", \
           str$(r15)," ",str$(rsi)," ",str$(rdi)," ",str$(rbp),lf

    waitkey

    invoke ExitProcess,0

    ret

entry_point endp

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

 NOSTACKFRAME

 testme proc

    movq mm0, rbx
    movq mm1, r12
    movq mm2, r13
    movq mm3, r14
    movq mm4, r15
    movq mm5, rsi
    movq mm6, rdi
    movq mm7, rbp

    mov rbx, 1
    mov r12, 2
    mov r13, 3
    mov r14, 4
    mov r15, 5
    mov rsi, 6
    mov rdi, 7
    mov rbp, 8

    conout "During ",str$(rbx)," ",str$(r12)," ",str$(r13)," ",str$(r14)," ", \
           str$(r15)," ",str$(rsi)," ",str$(rdi)," ",str$(rbp),lf

    movq rbx, mm0
    movq r12, mm1
    movq r13, mm2
    movq r14, mm3
    movq r15, mm4
    movq rsi, mm5
    movq rdi, mm6
    movq rbp, mm7

    ret

 testme endp

 STACKFRAME

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

    end
4
Custom Interface Components / RAEdit static with example
« Last post by fearless on Today at 01:39:29 AM »
I managed to compile the RAEdit to a static control. Example shows very basic usage, and requires the RAEdit class is registered before any dialogs use it - I called the install function before winmain: Invoke InstallRAEdit, hInstance, FALSE

I added a few additional functions to help load bitmaps and cursors from memory/data. Then used the masm32 bin2dbex tool to get the byte data for the few bitmaps and cursors required to store the data in the static library.

I used vortex's CreateBmpFromMem (http://www.masmforum.com/board/index.php?topic=16267.msg134453#msg134453) for the bitmap part.
5
The Workshop / Re: Fast transposing matrix procedure for any size
« Last post by Siekmanski on July 20, 2018, 09:32:00 PM »
 :t
6
The Workshop / Re: Fast transposing matrix procedure for any size
« Last post by RuiLoureiro on July 20, 2018, 09:22:27 PM »
Hi all,
         Here are the basic procedures (.asm) used to write and test
         some basic code needed to transpose any matrix

Good luck

Particular note: my thanks to Siekmanski  :t

Example
Quote
--------------------------------------------
HOW TO WRITE THE CODE TO TRANSPOSE 4x4
--------------------------------------------
u  is unpack   -> ul is unpack low and uh is unpack high
l  is low
h  is high

lh is move  low to high
hl is move high to low

Start with «what is the input» and «what we want to get»

                the input                                             we want to get this
          ----------------------                                    -----------------------
line 0  -> 0  1  2  3 = x0 = x4                                            0  4  8  C
              4  5  6  7 = x1   <- after unpack we may use x1    1  5  9  D
           
line 2 ->  8  9  A  B = x2 = x5                                            2  6  A  E
              C  D  E  F = x3   <- after unpack we may use x3    3  7  B  F


note: As we need to get [0  4  8  C] we need to unpack x0 with x1 and x2 with x3.
      Because we destroy x0 and x2 we need to get a copy x4, x5           
----------------------------------------------------------------------------------
      x4=x0         <--- copy x0 to x4
      x5=x2

ul    x0,x1  = 0  4  1  5  = x6 ( x1 )
ul    x2,x3  = 8  C  9  D

lh    x0,x2  = 0  4  8  C
hl    x2,x6  = 1  5  9  D
-------------------------------------
uh    x4,x1  = 2  6  3  7  = x7 ( x3 )
uh    x5,x3  = A  E  B  F

lh    x4,x5  = 2  6  A  E
hl    x5,x7  = 3  7  B  F
+++++++++++++++++++++++++++++++++++++++++++++++
      x4=x0
      x5=x2

ul    x0,x1  = 0  4  1  5  = x6 ( x1 )
ul    x2,x3  = 8  C  9  D
uh    x4,x1  = 2  6  3  7  = x7 ( x3 )
uh    x5,x3  = A  E  B  F

      x6=x0  or x1=x0
      x7=x4  or x3=x4
     
lh    x0,x2  = 0  4  8  C
hl    x2,x6  = 1  5  9  D   <<- replace x6 by x1
lh    x4,x5  = 2  6  A  E
hl    x5,x7  = 3  7  B  F   <<- replace x7 by x3
     
+++++++++++++++++++++++++++++++++++++++++++++++
      x4=x0
      x5=x2

ul    x0,x1  = 0  4  1  5  = x1
ul    x2,x3  = 8  C  9  D
uh    x4,x1  = 2  6  3  7  = x3
uh    x5,x3  = A  E  B  F

      x1=x0
      x3=x4
     
lh    x0,x2  = 0  4  8  C   <-- first output
hl    x2,x1  = 1  5  9  D
lh    x4,x5  = 2  6  A  E
hl    x5,x3  = 3  7  B  F   <-- fourth output

+++++++++++++++++++++++++++++++++++++++++++++++
                                   instructions
+++++++++++++++++++++++++++++++++++++++++++++++
                ; write the input xmm0,xmm1,xmm2,xmm3
                ;
                movaps      xmm4,xmm0           ; [0  4  1  5]
                movaps      xmm5,xmm2           ; [8  9  A  B]

                unpcklps    xmm0, xmm1          ; [0  4  1  5]
                unpcklps    xmm2, xmm3          ; [8  C  9  D]
                unpckhps    xmm4, xmm1          ; [2  6  3  7]
                unpckhps    xmm5, xmm3          ; [A  E  B  F]

                movaps      xmm1,xmm0           ; [0  4  1  5]
                movaps      xmm3,xmm4           ; [2  6  3  7]

                movlhps     xmm0,xmm2           ; [0  4  8  C] first  line
                movhlps     xmm2,xmm1           ; [1  5  9  D] second line
                movlhps     xmm4,xmm5           ; [2  6  A  E] third  line
                movhlps     xmm5,xmm3           ; [3  7  B  F] fourth line
                ;
                ; write the output xmm0,xmm2,xmm4,xmm5
7
Romper Room / Re: This is a test
« Last post by mineiro on July 20, 2018, 08:50:44 PM »
hello sir zedd151;
I was running Firefox on that; but not sure if is mandatory. I'm thinking this because if I'm not wrong Firefox use gtk+ as user interface and webkit as a web motor; so I suppose that can be done in chrome, vivaldi, ... (same web motor).
Firefox have open source code but I don't check. Inside gtk+ reference I have see a function to capture screen (gdk_get_default_root_window, gdk_drawable_get_size, gdk_window_get_origin, gdk_pixbuf_get_from_drawable (I think this function is based on bitblt on windows side, or pixelcopy, forgot now), gdk_pixbuf_save).
8
The Campus / Re: Tool buttons with icons?
« Last post by 2B||!2B on July 20, 2018, 08:46:58 PM »
I have the RAHexEd one as a static library here: http://masm32.com/board/index.php?topic=7287.0
Any particular control you require as a static library? Not sure if the sources/projects for all the controls are available, would have to look to see and to see if anything needs tweaking or potentially changed/stripped out, depending on the control and how its tied in with everything else.

Very nice work  :eusa_clap:
This one is very useful.
For a particular control, i was looking to fix the RichEdit control. It has the same problem as filebrowser control: once added, the dialog box won't be created.
9
RadAsm IDE Support / Re: RadASM v2.2.2.3
« Last post by 2B||!2B on July 20, 2018, 08:29:32 PM »
Its still the same in any version that I have. Have to hit refresh button or all project files then back to selected project files. The version i updated still causing some problems when custom controls are 16 or greater - I found RadASM still crashes at times, and so ive not found a proper solution to this, other than to take out all the RAD controls Im not using (to limit the custom controls to <16)

That option would really come in handy in big projects. Yes, you are right, the refresh works as well.
Is there no other way like maybe send a command to click the refresh automatically after each navigation?
BTW, I think less than 16 custom controls are more than enough for most of coders  :icon_mrgreen:
10
The Campus / Re: Tool buttons with icons?
« Last post by fearless on July 20, 2018, 07:04:13 PM »
I have the RAHexEd one as a static library here: http://masm32.com/board/index.php?topic=7287.0
Any particular control you require as a static library? Not sure if the sources/projects for all the controls are available, would have to look to see and to see if anything needs tweaking or potentially changed/stripped out, depending on the control and how its tied in with everything else.
Pages: [1] 2 3 ... 10