Author Topic: Re: The MASM Forum Introduction Video  (Read 2798 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8354
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: The MASM Forum Introduction Video
« Reply #45 on: May 11, 2021, 10:35:49 PM »
See if this works for you.

Algo below.  :biggrin:
« Last Edit: May 12, 2021, 09:53:01 AM by hutch-- »
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

daydreamer

  • Member
  • *****
  • Posts: 1635
  • building nextdoor
Re: The MASM Forum Introduction Video
« Reply #46 on: May 11, 2021, 10:45:34 PM »
See if this works for you.

LATER : The converted 64 bit will not work.
If I wrap the old alloc macro up,in new macro with added
And hmem, 0fffffff0h
SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8354
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: The MASM Forum Introduction Video
« Reply #47 on: May 11, 2021, 11:32:04 PM »
magnus,

I think this works OK.

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

    include \masm32\include\masm32rt.inc
    .686p
    .xmm

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

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

  ; --------------------------------------------------------
  ; alignment must be an immediate operand and a power of 2
  ; when no longer required the original address must be
  ; freed with either GlobalFree() or the macro "free".
  ; --------------------------------------------------------

    aalloc MACRO pMem:REQ,bcnt:REQ,alignment:REQ
      mov edx, bcnt
      add edx, alignment
      invoke GlobalAlloc,GMEM_FIXED or GMEM_ZEROINIT,edx
      mov pMem, eax
      add eax, alignment - 1
      and eax, -alignment
      EXITM <eax>
    ENDM

    .code

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

    call main
    inkey
    exit

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

main proc

    LOCAL pMem  :DWORD
    LOCAL aMem  :DWORD

    mov aMem, aalloc(pMem,1024*1024*64,16)

    movntdqa xmm0, XMMWORD PTR [eax]
  ; -----------------
  ; do something here
  ; -----------------
    movdqa XMMWORD PTR [eax], xmm1

    print str$(pMem),13,10
    print str$(aMem),13,10

    ret

main endp

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

end start
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

daydreamer

  • Member
  • *****
  • Posts: 1635
  • building nextdoor
Re: The MASM Forum Introduction Video
« Reply #48 on: May 12, 2021, 03:32:53 AM »
Thanks hutch  :thumbsup:
SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P

daydreamer

  • Member
  • *****
  • Posts: 1635
  • building nextdoor
Re: The MASM Forum Introduction Video
« Reply #49 on: May 22, 2021, 09:35:24 PM »
Great optimize video hutch  :thumbsup:
SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8354
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: The MASM Forum Introduction Video
« Reply #50 on: May 23, 2021, 10:46:36 AM »
Thqanks magnus, just hope that folks find the tutes useful.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

daydreamer

  • Member
  • *****
  • Posts: 1635
  • building nextdoor
Re: The MASM Forum Introduction Video
« Reply #51 on: May 27, 2021, 06:26:29 AM »
Thqanks magnus, just hope that folks find the tutes useful.
Minimize stackframes is new to use standard proc only
The Milliseconds timing seem more useful,in the long running programs
And animation at certain fps, @ 60 fps you have 1/60 seconds time to drawing code

Seem good for loading speed test to




SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P

valera

  • Regular Member
  • *
  • Posts: 1
Re: The MASM Forum Introduction Video
« Reply #52 on: June 04, 2021, 01:52:31 AM »
Hello!
Thank you for your hard work!