Recent Posts

Pages: [1] 2 3 ... 10
1
Custom Interface Components / ModernUI_DesktopFace example TrumpBot
« Last post by fearless on Today at 12:01:50 PM »
Had this example lying round for a bit in early test versions, which I showed to my daughter who thought it was funny. So decided to tidy it up and use it with the ModernUI_DesktopFace control properly. I'd created a version for my daughter previously with her face that would popup on the desktop and her saying random things that we recorded.


I've only tried it on my Win 7 x64 pc, so dont know how it will work on other OS's. Also probably some tidying up could be done with the control, as I've noticed occasionally some odd flickering when hiding, or when clicking whilst the hiding animation starts, or double clicking sometimes the hide animation resets itself - minor things i think - anyhow hope you all enjoy it. Also watch you dont accidentally launch some icons on your desktop as your clicking on trump's face as he moves about.

https://www.dropbox.com/s/5crhvfbpwz4fysc/TrumpBot.zip?dl=0
2
Pelle's C compiler and tools / Re: Tiny Lousy (TL) programs
« Last post by Caché GB on Today at 12:01:17 PM »
Hello TimoVJL

Welcome to the forum.

I think for some people, once they go past a threshold (depth) in assembler, they just can't come up agian.

Quote from:  The Power of Ten – Rules for Developing Safety Critical Code
http://spinroot.com/gerard/pdf/P10.pdf

"At many organizations, JPL included, critical code is written in C."
3
Pelle's C compiler and tools / Re: Tiny Lousy (TL) programs
« Last post by Siekmanski on Today at 09:03:36 AM »
 :icon14:
4
Pelle's C compiler and tools / Re: Tiny Lousy (TL) programs
« Last post by jj2007 on Today at 08:59:29 AM »
Timo,

Don't despair - your work is important for Pelles C. And as long as you enjoy your own coding as much as I do enjoy my MasmBasic coding, everything is fine  :lol:

As Erol wrote above: Keep up the good work :icon14:
5
MASM64 SDK / Re: Random seed for random algorithm example
« Last post by hutch-- on Today at 08:12:54 AM »
This is the version I use in the library.

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

 get_unique_seed proc
  ; ------------------------------------
  ; create a seed for a random algo that
  ; is extremely difficult to re-produce
  ; ------------------------------------
    LOCAL var1  :QWORD
    LOCAL var2  :QWORD
    LOCAL var3  :QWORD
    LOCAL var4  :QWORD
    LOCAL var5  :QWORD

    invoke QueryPerformanceCounter,ADDR var1
    invoke QueryPerformanceCounter,ADDR var2
    invoke QueryPerformanceCounter,ADDR var3
    invoke QueryPerformanceCounter,ADDR var4
    invoke QueryPerformanceCounter,ADDR var5

    mov rax, var1
    mov rcx, var2
    rol rcx, 13
    mov rdx, var3
    rol rdx, 26
    mov r10, var4
    rol r10, 39
    mov r11, var5
    rol r11, 52
    xor rax, rcx
    xor rax, rdx
    xor rax, r10
    xor rax, r11
    bswap rax

    ret

 get_unique_seed endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
6
MASM64 SDK / Re: Random seed for random algorithm example
« Last post by hutch-- on Today at 08:01:22 AM »
Here is the replacement, it worked OK when I first wrote it but Win10 keeps changing and the register usage so I changed the registers to preserved non-volatile ones but kept the algorithm identical. From Win32 help,
Quote
Return Values
If the installed hardware supports a high-resolution performance counter, the return value is nonzero.
If the installed hardware does not support a high-resolution performance counter, the return value is zero.
This is why you were getting a zero return value from QueryPerformanceCounter().
This is the output which is different every call.

-576460752291077810
-3963167672073690802
-8646629809562295986
-2161727821125492402
-2954361355542699698
504403158277841230
3602879701908742478
1729382256922616142
-936748722480717490
-4611686018415042226
-7349030166926171826
1945555039036399950
6413407344364642638
-3313804900802207410
4757771531352564046
1585267068846760270
7566047373994778958
864691128467480910
4611967493416444238
1585267068846760270
Press any key to continue...

The example.

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

    include \masm32\include64\masm64rt.inc

    .code

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

entry_point proc

    LOCAL lcnt  :QWORD

    mov lcnt, 20

  lbl:
    call reseed
    conout str$(rax),lf
    sub lcnt, 1
    jnz lbl

    waitkey
    .exit

entry_point endp

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

 ; NOSTACKFRAME

 reseed proc
  ; --------------------------------------
  ; random algorithm random seed generator
  ; --------------------------------------
    LOCAL var1  :QWORD
    USING r13,r14,r15

    SaveRegs

    lea r14, var1                           ; load the address
    mov r13, 1000                           ; set the counter
    mov r15, 12345678                       ; put something in r15

  @@:
    rcall QueryPerformanceCounter, r14      ; call the API
    mov rax, [r14]                          ; write value in var1 to rax
    bswap rax                               ; byte swap rax
    xor r15, rax                            ; xor combine with r15
    sub r13, 1                              ; decrement counter
    jnz @B                                  ; loop again if not 0

    mov rax, r15                            ; return xorred content in rax

    RestoreRegs

    ret

 reseed endp

 ; STACKFRAME

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

    end
7
ASMC Development / Re: Large integers and floats
« Last post by nidud on Today at 06:48:47 AM »
Added support for double::register arguments in 64-bit.

syscall:

p1  proto syscall :oword, :oword, :oword

p2  proc syscall a1:oword, a2:oword, a3:oword
    p1(rsi::rdi, rcx::rdx, r9::r8)  ; no params set
    p1(rsi::rax, rcx::rdx, r9::r8)  ; rdi
    p1(rax::rax, rax::rax, rax::rax); all
    ret
p2  endp

   0:   55                      push   rbp
   1:   48 8b ec                mov    rbp,rsp
   4:   e8 21 00 00 00          call   0x2a
   9:   48 8b f8                mov    rdi,rax
   c:   e8 19 00 00 00          call   0x2a
  11:   4c 8b c0                mov    r8,rax
  14:   4c 8b c8                mov    r9,rax
  17:   48 8b d0                mov    rdx,rax
  1a:   48 8b c8                mov    rcx,rax
  1d:   48 8b f8                mov    rdi,rax
  20:   48 8b f0                mov    rsi,rax
  23:   e8 02 00 00 00          call   0x2a
  28:   c9                      leave 
  29:   c3                      ret   

fastcall:

p1  proto a1:dword
p2  proto a1:oword, a2:oword

p3  proc 1:oword, a2:oword
    p2(rdx::rcx, r9::r8)    ; no params set
    p2(p1(0), r9::r8)       ; rcx
    p2(rax::rcx, r9::r8)    ; rdx
    p2(rax::rax, r11::r10)  ; all
    ret
p3  endp

   0:   55                      push   rbp
   1:   48 8b ec                mov    rbp,rsp
   4:   48 83 ec 20             sub    rsp,0x20
   8:   e8 34 00 00 00          call   0x41
   d:   33 c9                   xor    ecx,ecx
   f:   e8 23 00 00 00          call   0x37
  14:   48 8b c8                mov    rcx,rax
  17:   e8 25 00 00 00          call   0x41
  1c:   48 8b d0                mov    rdx,rax
  1f:   e8 1d 00 00 00          call   0x41
  24:   48 8b c8                mov    rcx,rax
  27:   48 8b d0                mov    rdx,rax
  2a:   4d 8b c2                mov    r8,r10
  2d:   4d 8b cb                mov    r9,r11
  30:   e8 0c 00 00 00          call   0x41
  35:   c9                      leave 
  36:   c3                      ret   
8
RadAsm IDE Support / Re: Adding Dialog "FONT 8,"MS Sans Serif",400,0"
« Last post by blue_devil on Today at 06:09:07 AM »
After spending several hours on this issue; i have found that if i use my old templates from older versions of RadASM i got this buggy situation.
Today i made a dialog application and made a template for it. Guess what happen: no bugs no error.

From now on i wont use my old templates and will update them by creating newer versions using new RadASM 2.2.2.3.
9
Game Development / Re: my 100% Assembly game development
« Last post by HSE on Today at 05:06:39 AM »
10
Pelle's C compiler and tools / Re: Tiny Lousy (TL) programs
« Last post by Vortex on Today at 04:38:44 AM »
Hi Timo,

No, not tiny lousy. You tools are very useful and nice. My only modest advice would be that you write simple text files for the zip archives to present the usage of the tools to the audience.

C or asm is not a problem. Right tool for the right job. What's important is the comfort you feel with your own choice of development tool set.

Keep up the nice work Timo and thanks for your efforts.
Pages: [1] 2 3 ... 10