flat assembler
Message board for the users of flat assembler.

Index > Main > Hilbert Curve :-D

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
bitRAKE



Joined: 21 Jul 2003
Posts: 4046
Location: vpcmpistri
bitRAKE 14 Apr 2008, 00:19
Another interesting piece of related software:
http://www.contextfreeart.org/

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 14 Apr 2008, 00:19
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 14 Apr 2008, 00:25
awesome! just it will install VB so i don't want it.. but awesome.

if i cannot code in asm a good application, i'll try to make art. Very Happy
Post 14 Apr 2008, 00:25
View user's profile Send private message Visit poster's website Reply with quote
Rahsennor



Joined: 07 Jul 2007
Posts: 61
Rahsennor 18 Apr 2008, 05:08
Shocked Procedural generation! Very Happy
Very cool. Cool
Post 18 Apr 2008, 05:08
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4046
Location: vpcmpistri
bitRAKE 04 Jul 2008, 16:45
ContextFree has been converted to JavaScript to work on browsers with Canvas support!

http://azarask.in/projects/algorithm-ink/

This is one of my favorites:
http://azarask.in/projects/algorithm-ink/#6f2d1634

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 04 Jul 2008, 16:45
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4046
Location: vpcmpistri
bitRAKE 16 Aug 2008, 08:14
I've converted the windows code to work in long mode - no change to hilbert routine needed, lol.


Description: x86-64 version, tested on Vista - file names fixed to not conflict with other versions. Fixed all errors known 2008Aug18.
Download
Filename: hilbertW64.zip
Filesize: 3.23 KB
Downloaded: 546 Time(s)


_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup


Last edited by bitRAKE on 18 Aug 2008, 15:09; edited 2 times in total
Post 16 Aug 2008, 08:14
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 16 Aug 2008, 20:20
A few problems Smile

The azarask.in's algorithm-ink works only in FF3 (which was the only browser I didn't have until today) and even my Seamonkey (that's based on pretty much same code) doesn't have canvas incorporated (will be in SM2 and is now with some custom builds).

Opera... hmm, nope, the same message appears Smile

IE doesn't even show the page - no problem there 'cuz I don't even use that Razz but still...


Another thing is that I can't find the 64-bit code of your program anywhere.

_________________
My updated idol Very Happy http://www.agner.org/optimize/
Post 16 Aug 2008, 20:20
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4046
Location: vpcmpistri
bitRAKE 17 Aug 2008, 00:16
Madis731 wrote:
Another thing is that I can't find the 64-bit code of your program anywhere.
...should be in ZIP file in my last post: file "HilbertW.fasm". I should have called it something different - brain fart.

I've been on the FF3 beta's for a long time - they keep me current with the latest test builds.

(If a moderator could move this thread to "Projects" - might be more fitting?)

Edit: changed file name to "HilbertW64.fasm" to not conflict with 32-bit code.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 17 Aug 2008, 00:16
View user's profile Send private message Visit poster's website Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 17 Aug 2008, 06:41
Cute table to remember!
Code:
;-------------------------------------------------------
; Register(s) |   Status    | Use
;-------------|-------------|---------------------------
;  RAX        |  Volatile   | Return value register
;  RCX        |  Volatile   | 1st argument if integer
;  RDX        |  Volatile   | 2nd argument if integer
;  R8         |  Volatile   | 3rd argument if integer
;  R9         |  Volatile   | 4th argument if integer
;  R10:R11    |  Volatile   | preserved by caller
;             |             | used in syscall/sysret instructions
;  XMM0       |  Volatile   | 1st argument if FP
;  XMM1       |  Volatile   | 2nd argument if FP
;  XMM2       |  Volatile   | 3rd argument if FP
;  XMM3       |  Volatile   | 4th argument if FP
;  XMM4:XMM5  |  Volatile   | preserved by caller
;             |             |
;  RDI        | Nonvolatile | preserved by callee
;  RSI        | Nonvolatile | preserved by callee
;  RBX        | Nonvolatile | preserved by callee
;  RBP        | Nonvolatile | preserved by callee
;  RSP        | Nonvolatile | stack pointer
;  R12:R15    | Nonvolatile | preserved by callee
;             |             |
;  XMM6:XMM15 | Nonvolatile | preserved by callee
;-------------------------------------------------------
    

bitRAKE you made it? Nice idea to put such in every x64 asm file for simplicity.

_________________
Any offers?
Post 17 Aug 2008, 06:41
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 17 Aug 2008, 11:53
@asmfan: I think that this is a standard... I can't recall was it ABI or something?

@bitRAKE, sorry I forgot to refresh the page Razz I cached the site in the morning and answered in the evening Smile
EDIT: Doesn't exit gracefully...better to say, it doesn't exit, but leaves the process running, though the image is drawn okay.
Post 17 Aug 2008, 11:53
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4046
Location: vpcmpistri
bitRAKE 17 Aug 2008, 15:15
asmfan wrote:
Cute table to remember!
bitRAKE you made it? Nice idea to put such in every x64 asm file for simplicity.
It's the Win64 ABI in condensed form. I need a quick reminder until I find another way. The only complete documentation I could find is from MS and it's fairly long (mode) winded, lol.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 17 Aug 2008, 15:15
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4046
Location: vpcmpistri
bitRAKE 17 Aug 2008, 15:34
Madis731 wrote:
EDIT: Doesn't exit gracefully...better to say, it doesn't exit, but leaves the process running, though the image is drawn okay.
What version of windows? Mine exits okay - traced through it just now to be certain. I didn't set a proper exit code.
Code:
        xor eax,eax
        leave
        pop rdi rsi
        retn    
...is needed. Also, I think the MSG structure is incorrect in USER64.inc of FASM package, but that is unrelated.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 17 Aug 2008, 15:34
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 17 Aug 2008, 16:03
Mhmh, this...
Code:
.xit:   enter 32,0 ; shadow space required
        xor ecx,ecx
        call [PostQuitMessage]
;        leave
;        retn
        xor eax,eax
        leave
        pop rdi rsi
        retn 
    

...helped.

M$W Server 2003 Standard x64 Edition SP2. I think that XP64 might behave the same way, though I don't have it, but Vista64 will be quite different.
I guess I can try that on my laptop too (which is Enterprise Ed.), but I think I won't be surprised. I seem to always need proper exits in my Server code Sad or Smile
Post 17 Aug 2008, 16:03
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 17 Aug 2008, 19:29
I supposed that it was ABI Smile But interested, was it taken from somewhere in such neat & tidy compact view. Of course reading bunch of MS docs and blogs such raymond chen's is useful but time consuming too. And this is example of simplicity as is.
Post 17 Aug 2008, 19:29
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4046
Location: vpcmpistri
bitRAKE 18 Aug 2008, 00:52
Ah, yes. Thanks Madis731. MSDN docs do say to return zero. But "pop rdi rsi" is very odd - they haven't been stored on the stack at that execution level. If you remove "ps PAINTSTRUCT" -- which isn't used -- you'll experience the problem with MSG structure being too small -- hDCBitmap gets overwritten. I've made the following change:
Code:
struct MSG
  hwnd    dq ?
  message dq ?
  wParam  dq ?
  lParam  dq ?
  time    dq ?
  pt      POINT
ends    
...right or wrong it works.

This is my plotter/bitmap template which I use to test algorithms and get visual feedback -- like the Perlin Noise routine.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 18 Aug 2008, 00:52
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4046
Location: vpcmpistri
bitRAKE 18 Aug 2008, 04:16
asmfan wrote:
I supposed that it was ABI Smile But interested, was it taken from somewhere in such neat & tidy compact view. Of course reading bunch of MS docs and blogs such raymond chen's is useful but time consuming too. And this is example of simplicity as is.
First I googled for "x64 calling convention". Then on to MS at http://msdn.microsoft.com/en-us/library/ms235286.aspx and then found a list at http://msdn.microsoft.com/en-us/library/9z1stfyw.aspx

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 18 Aug 2008, 04:16
View user's profile Send private message Visit poster's website Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 18 Aug 2008, 15:27
Oh thanks, indeed MS sometimes do useful things in few words. /I don't mean Vista thou)/

_________________
Any offers?
Post 18 Aug 2008, 15:27
View user's profile Send private message Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 24 Aug 2008, 23:42
bitRAKE wrote:
Another interesting piece of related software:
http://www.contextfreeart.org/

I find this funny
http://www.contextfreeart.org/gallery/view.php?id=243

This reminds me when I was doing L-system stuff with fractint on DOS.
Post 24 Aug 2008, 23:42
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4046
Location: vpcmpistri
bitRAKE 04 Sep 2008, 00:08
Finally able to test on Win2k3 x64, and CreateWindow is creating another thread and loading a bunch of DLLs - might have something to do with IME. Therefore, simply returning to TerminateThread routine will not work - must call ExitProcess. All windows on this installation seem to have 2+ threads. It does seem odd windows isn't closing this other thread - obviously I'm doing something wrong in my WNDPROC as well. Confused

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 04 Sep 2008, 00:08
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.