Recent Posts

Pages: [1] 2 3 ... 10
Pelle's C compiler and tools / Re: Tiny Lousy (TL) programs
« Last post by Siekmanski on Today at 09:03:36 AM »
Pelle's C compiler and tools / Re: Tiny Lousy (TL) programs
« Last post by jj2007 on Today at 08:59:29 AM »

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:
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


 get_unique_seed endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
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,
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.

Press any key to continue...

The example.

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

    include \masm32\include64\


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

entry_point proc

    LOCAL lcnt  :QWORD

    mov lcnt, 20

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


entry_point endp

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


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


    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



 reseed endp


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

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.


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
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   


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
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   
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
Game Development / Re: my 100% Assembly game development
« Last post by HSE on Today at 05:06:39 AM »
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.
The Orphanage / Re: my new toy
« Last post by daydreamer on Today at 04:34:15 AM »
Got two apps on it, geographic and periodic
Backed it up, took screenshot, entered some variables with pc
What is left is to re-enter programs from my older calculator with no cable and no apps and less functions
Re-enter fibonnaci, animated analog clock on faster cpu than before, also timetest program for get right delay for clock will be interesting to compare how much faster the new calculator is
Pelle's C compiler and tools / Tiny Lousy (TL) programs
« Last post by TimoVJL on Today at 04:24:06 AM »
I am just here for getting some feedback of series of my Tiny Lousy (TL) programs in PellesC forum.

I don't do any code in assembler, as i think that C suits lot of better to me ;)
All users in this site who already knows me shall share that opinion.
Be warned, i am not a easy person.
So if you have questions or comments about of these programs:
  • TLPEView
  • TLWHView
  • TLWHViewRE
don't hesitate give feedback ;)
PM if issue shall not be public.

I just occasionally visit here to see how users like/dislike of my creations.

Pages: [1] 2 3 ... 10