Recent Posts

Pages: [1] 2 3 ... 10
1
The Laboratory / Re: CPUID code, need to test on 64 bit AMD hardware.
« Last post by hutch-- on Today at 03:22:52 PM »
I think I have got what can be got, while the Intel documentation is appalling, the AMD documentation is all over the place like a mad woman's sh*t. In 64 bit there is a lot of old stuff that does not matter and as far as I can tell, any processor able to run 64 bit Windows supports CPUID so the results are something like useful to test if an instruction set is available on any given processor that can run Win 64.
2
The Laboratory / Alternative calling convention for MASM Objects.
« Last post by Caché GB on Today at 08:11:55 AM »
Ok I was getting my feet wet and reading up on x64 and wonderful , the first four perms are passed in regs rcx, rdx, r8, r9. Nice.
Then reading a bit further see that Linux uses six regs - rdi, rsi, rdx, rcx, r8 and r9, for User-level applications. No this is not on.
How could you let this happen M$.

Henry Miller once said, “Whatever there be of progress in life comes not through adaptation but through daring.”

OK Henry Miller, challenge accepted.

Code: [Select]

vcall MACRO Who:REQ, Arg0, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7

  LOCAL  VtblName, MethodName, pInterface, IPos1, IPos2
   
;=== From Bitrider's ObjAsm32 : http://objasm32.tripod.com/ ===
    IPos2 = @InStr(1, <Who>, <::>)
    IF IPos2 NE 0
       pInterface SUBSTR <Who>, 1, (IPos2 - 1)
       IPos1 = @InStr(IPos2 + 1, <Who>, <.>)
       IF IPos1 NE 0
          VtblName SUBSTR <Who>, IPos2 + 2, IPos1 - IPos2 - 2   
          MethodName SUBSTR <Who>, IPos1 + 1
       ELSE
         .err <vcall format error. Dot-Method missing.>
       ENDIF
    ELSE
      .err <vcall format error. Double Colon missing.>
    ENDIF
;==============================================================
    IFNB <Arg7>
      IPos1 = @InStr(1, Arg7, <&>)
      IPos2 = @InStr(1, Arg7, <*>)
      IF IPos1
           lea  eax, @SubStr(<Arg7>, %IPos1+1)
          movd  mm7,  eax
      ELSEIF IPos2
           mov  eax, @SubStr(<Arg7>, %IPos2+1)
           mov  eax, [eax]
          movd  mm7,  eax
       ELSE
         IF OPATTR(Arg7) EQ 100100b
            mov  eax, Arg7
           movd  mm7, eax
         ELSE
           movd  mm7, Arg7
         ENDIF
       ENDIF
    ENDIF

    ...

    IFNB <Arg0>
      IPos1 = @InStr(1, Arg0, <&>)
      IPos2 = @InStr(1, Arg0, <*>)
      IF IPos1
           lea  eax, @SubStr(<Arg0>, %IPos1+1)
          movd  mm0,  eax
      ELSEIF IPos2
           mov  eax, @SubStr(<Arg0>, %IPos2+1)
           mov  eax, [eax]
          movd  mm0,  eax
       ELSE
         IF OPATTR(Arg0) EQ 100100b
            mov  eax, Arg0
           movd  mm0, eax
         ELSE
           movd  mm0, Arg0
         ENDIF
       ENDIF
    ENDIF

          mov  eax, pInterface
         call  (VtblName ptr[eax]).MethodName  ; ;  or call  [eax][VtblName.MethodName]

ENDM


So it looks like this.

Code: [Select]

.data
     szTexture02               dw L(Asserts\\minimap.jpg\0)                            ;; L macro by Ernest Murphy
     ?szTexture02              dd offset szTexture02

.code

          new  CBitmap
          mov [edi].m_Bitmap, eax
        vcall [edi].m_Camera::CCamera.GetViewMatrixPtr                           ;;  for the BaseViewMatrix : Position = 0.0, -1.0, 0.0, 0.0
         movd  mm3, eax
        vcall [edi].m_Bitmap::CBitmap.Initialize, pDevice, pDeviceContext, ?szTexture02, , ScreenWidth, ScreenHeight, 154, 154

; =============================================================================

CCamera_GetViewMatrixPtr proc ;; ViewMatrix:ptr XMMATRIX

       assume  eax:ptr CCamera

          lea  eax, [eax].m_ViewMatrix

       ;; mov  edx,  ViewMatrix
       ;; lea  eax, [eax].m_ViewMatrix
       ;; mov [edx], eax

          ret

CCamera_GetViewMatrixPtr endp

; =============================================================================

CBitmap_Initialize proc

       assume  eax:ptr CBitmap
          mov [eax].m_Caller, edi
          mov  edi, eax
       assume  edi:ptr CBitmap

         movd [edi].m_Device, mm0
         movd [edi].m_DeviceContext, mm1
         movd [edi].m_ScreenWidth, mm4
         movd [edi].m_ScreenHeight, mm5
         movd [edi].m_BitmapWidth, mm6
         movd [edi].m_BitmapHeight, mm7

          mov [edi].m_PreviousPosX, -1
          mov [edi].m_PreviousPosY, -1

         movd  ecx, mm3                                                        ;; ptr BaseViewMatrix
          lea  eax, [edi].m_BaseViewMatrix
       invoke  MatrixCopyData

         movq  mm0, mm2                                                        ;; szTexture
       vpcall  CBitmap.LoadTexture                                             ;; private call of class

       vpcall  CBitmap.InitializeBuffers

          mov  edi, [edi].m_Caller
          ret

CBitmap_Initialize endp


------------------------------------------------------------------------------------------------------------------------------
Quote from:  subconscious on my mind.
======================================================================
So what are you ganna do if you got more than eight perms???
======================================================================

Well sub, then you will have to use the wakeupcall.

Code: [Select]

wakeupcall MACRO Who:REQ, Arg0, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Args:VARARG

  LOCAL Arg, ArgList, VtblName, MethodName, pInterface, IPos1, IPos2

 ;=== From Bitrider's ObjAsm32 : http://objasm32.tripod.com/ ===

    IPos2 = @InStr(1, <Who>, <::>)
    IF IPos2 NE 0
       pInterface SUBSTR <Who>, 1, (IPos2 - 1)
       IPos1 = @InStr(IPos2 + 1, <Who>, <.>)
       IF IPos1 NE 0
          VtblName SUBSTR <Who>, IPos2 + 2, IPos1 - IPos2 - 2   
          MethodName SUBSTR <Who>, IPos1 + 1
       ELSE
         .err < wakeupcall format error. Dot-Method missing.>
       ENDIF
    ELSE
      .err < wakeupcall format error. Double Colon missing.>
    ENDIF
;==============================================================

;=================== From somewhere I can't remember. =================
    ArgList TEXTEQU <>
    IFNB <Args>
       FOR Arg, <Args>
        IF @InStr(1, <Arg>, <edx>) NE 0
           .err <wakeupcal uses eax: call will be corrupted>
         ENDIF
         ArgList CATSTR <Arg>,<,>,ArgList
       ENDM
       ArgList SUBSTR ArgList,1,@SizeStr(%ArgList)-1
       ArgList CATSTR <!<>,ArgList,<!>>
 ;=============================================================

     % FOR Arg, ArgList
         IPos1 = @InStr(1, Arg, <&>)
         IPos2 = @InStr(1, Arg, <*>)
         IF IPos1
              lea  eax, @SubStr(<Arg>, %IPos1+1)
             push  eax
         ELSEIF IPos2
              mov  eax, @SubStr(<Arg>, %IPos2+1)
              mov  eax, [eax]
             push  eax
          ELSE
             push  Arg
          ENDIF

       ENDM
    ENDIF

    IFNB <Arg7>
      IPos1 = @InStr(1, Arg7, <&>)
      IPos2 = @InStr(1, Arg7, <*>)
      IF IPos1
           lea  eax, @SubStr(<Arg7>, %IPos1+1)
          movd  mm7,  eax
      ELSEIF IPos2
           mov  eax, @SubStr(<Arg7>, %IPos2+1)
           mov  eax, [eax]
          movd  mm7,  eax
       ELSE
         IF OPATTR(Arg7) EQ 100100b
            mov  eax, Arg7
           movd  mm7, eax
         ELSE
           movd  mm7, Arg7
         ENDIF
       ENDIF
    ENDIF

   ; ...

    IFNB <Arg0>
      IPos1 = @InStr(1, Arg0, <&>)
      IPos2 = @InStr(1, Arg0, <*>)
      IF IPos1
           lea  eax, @SubStr(<Arg0>, %IPos1+1)
          movd  mm0,  eax
      ELSEIF IPos2
           mov  eax, @SubStr(<Arg0>, %IPos2+1)
           mov  eax, [eax]
          movd  mm0,  eax
       ELSE
         IF OPATTR(Arg0) EQ 100100b
            mov  eax, Arg0
           movd  mm0, eax
         ELSE
           movd  mm0, Arg0
         ENDIF
       ENDIF
    ENDIF

          mov  eax, pInterface
         call  (VtblName ptr[edi]).MethodName

ENDM


To all those how would like to put me in a straight jacket and throw me in a padded cell, please calm down to a panic.
This is just an ex-parra-"mental" exercise and yes, I shoud have stuck it in the Romper Room, I know.

Any regs mm0 to mm7 with values that are needed after an API call, will need to be saved first.
This is also the case before use of the coprocesser and an emms instuction is also needed before hand.

BTW 3 things happened today
1. A sriped kiddy said assembly sucks and that it had no place in modern day programming.
2. He got lost at sea.
3. I lost my skippers licence. Dam I'll miss shark marlin fishing.

3
The Campus / Re: Detect if your Windows version is 32- or 64-bit
« Last post by felipe on Today at 08:07:13 AM »
Here it is the same program that i uploaded above, but this is the 64 bit version (files .asm and .exe attached).  :icon14:
4
Game Development / Re: my 100% Assembly game development
« Last post by LordAdef on Today at 07:56:10 AM »
Hey guys, thanks every one who posted above!
Well, my previous work was too intense and reaching its final stages. It was a medieval plot for tv.By the way, if anyone is interested to have a listen, you can find the sountrack cd online (and listen to the snipets):  .
(disclamer: I am not trying to sell cds :eusa_naughty:   just sharing my stuff)
https://open.spotify.com/album/24D3Flf4QlnLr1QJyx3Q2I
or here:
https://itunes.apple.com/us/album/deus-salve-o-rei-m%C3%BAsica-original-da-s%C3%A9rie-de-tv/1378846216

Gunther must be in CERN trying to prove wrong the speed of light limit....
Afterwards, I spent some time in Croatia and Greece with the family, but no Gunther there I'm afraid.

Back to ASM finally, god I was missing this!!
5
RadAsm IDE Support / Re: Adding Dialog "FONT 8,"MS Sans Serif",400,0"
« Last post by fearless on Today at 04:09:28 AM »
I had a look and realised it was because I was using a template that it had those values (copied text from dlg file from dialogasmain template to new project's dlg). Cant say why the values in the radasm fork has those values as they where probably there from the original source on sourceforge.

Maybe try add new dialog to see if it sets anything specifically for that font resource in a new dialog.
6
RadAsm IDE Support / Re: Adding Dialog "FONT 8,"MS Sans Serif",400,0"
« Last post by BugCatcher on Today at 02:30:58 AM »
I got this.. No Zero's

#define IDD_DIALOG 1000
IDD_DIALOG DIALOGEX 6,6,194,106
CAPTION "Dialog As Main"
FONT 8,"MS Sans Serif"
CLASS "DLGCLASS"
STYLE 0x10CF0800
EXSTYLE 0x00000000
BEGIN
END
7
RadAsm IDE Support / Re: Adding Dialog "FONT 8,"MS Sans Serif",400,0"
« Last post by blue_devil on Today at 01:42:24 AM »
@fearless thank you for your answer.

i have checked your code; for example this:
Quote
https://github.com/mrfearless/RadASM2/blob/master/Res/DlgOptionDlg.Rc

you left the font properties ",0,0"

The thing that i want to ask is, " did your RadASM also put "400,0" to your code and you manually fixed to ",0,0" OR by default it is ",0,0" ?"

Thanks :)
8
RadAsm IDE Support / Re: Adding Dialog "FONT 8,"MS Sans Serif",400,0"
« Last post by fearless on Today at 01:21:03 AM »
Think its a default output, for weight:

https://docs.microsoft.com/en-us/windows/desktop/menurc/font-statement
I would guess if its showing a bigger font, then maybe some scaling is happening going from logical point size to dialog units with scaled size, depending on your monitor resolution and windows version - just a guess though.
9
The Orphanage / Re: Google
« Last post by LiaoMi on Today at 01:05:48 AM »
The new Firefox - https://www.mozilla.org/en-US/firefox/
Meet Firefox Quantum.
Fast for good.
Download Firefox — English (US)

Quote
IS IT WORTH SWITCHING TO FIREFOX QUANTUM?
As much as Quantum is a new and improved version of Firefox, it is still, at its heart, the classic Firefox. That means you’re never going to have quite the same level of Google integration you get from Chrome, though you can import your Chrome settings and bookmarks flawlessly. For some people, that alone is what matters.

If that doesn’t bother you or you’re more interested in a private browsing experience, Firefox Quantum offers the most secure online browsing experience of the big options right now. It feels fast and performs well in simple benchmarks and with its own robust set of add-ons, there’s nothing we’ve come across that other browsers can do that Firefox Quantum can’t.

With that in mind, we think Firefox Quantum is definitely worth a look if you’re a little tired of Chrome, Edge, or Safari. It’s certainly a comparable experience to any of them, and is noticeably better in some areas. If you still aren’t convinced, here’s one last benefit of choosing Quantum: There is always an inherent advantage of less popular browsers since malware authors tend to write viruses for the most common software. That’s an added level of security that Firefox probably won’t be advertising anytime soon.
10
The Orphanage / Re: Google Chrome
« Last post by LiaoMi on Today at 01:00:32 AM »
Google Chrome is killing Sandboxie.
Here is the message that pops up from sandboxie:

      sbie2303 could not hook LdrLoadDll (33,487)
      sbie2304 initialization failed for process Chrome.exe

I have no idea what to do about this.
Going online IMHO is suicide without being Sandboxed.

https://www.shadowdefender.com better than sandboxie ..
+
Symantec Endpoint Protection, it seems to be a free Anti-Virus if you do not use the server manager ..
Code: [Select]
Symantec Endpoint Protection 14.2.760.0000 All (14.2)
Client
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_EN.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_BR.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_CH.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_CS.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_CZ.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_FR.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_GE.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_IT.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_JP.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_KN.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_PL.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_RU.zip
http://esdownload.symantec.com/akdlm/CD/MTV/Symantec_Endpoint_Protection_14.2.0.All_Clients_SL.zip
Pages: [1] 2 3 ... 10