flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > Subtraction technique [DONE]

Author
Thread Post new topic Reply to topic
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 27 May 2007, 22:35
This program takes input in rows and columns as decimals 0..9 and organises the data so that most typical values gather at the top-left and most untypical values bottom-right. The numbers in the headers of the resulting rows/columns are their original position in the data and the numbers in the footer are the conformism values at the time of being "thrown out" of the calculations.

Detailed usage:
You can write your input text in the textbox or into a file Alt+I or "Intput" checkbox toggles that. Filenames can be relative or absolute
You can see the output in the other textbox or put it into a file with Alt+O toggling the choice.
Alt+S will start the program (performance is poor about O(n²). Alt+E will exit. Processing time shows the time it took in milliseconds.
Examples from performance on Core 2 T7200 @ 2GHz:
Code:
200x200 => 31ms
250x250 => 63ms
300x300 => 94ms
350x350 =>187ms
    

This isn't exactly nxn, but a bit less. When increasing data size 1.5 times, it will take 2 times longer or something O(n^1,5) maybe Smile

Don't know if it has a better name in English, but that's what it was called in school: "Miinustehnika"

Implementation in ASM
64-bit source+executable
32-bit source+executable
Test data generator in FASM macrolanguage
(64 one is about 10% faster than 32)


Description: The source and executable in English
Download
Filename: MiinusENG.7z
Filesize: 9.23 KB
Downloaded: 793 Time(s)

Description: Source+executable+testdata
Download
Filename: Miinustehnika.7z
Filesize: 13.76 KB
Downloaded: 765 Time(s)


_________________
My updated idol Very Happy http://www.agner.org/optimize/


Last edited by Madis731 on 28 May 2007, 13:43; edited 1 time in total
Post 27 May 2007, 22:35
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 27 May 2007, 23:25
just wondering: what's it good for?
Post 27 May 2007, 23:25
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 27 May 2007, 23:38
Preparing for Huffman encoding? Razz
Post 27 May 2007, 23:38
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 28 May 2007, 08:36
vid wrote:
just wondering: what's it good for?

Very Happy exercise for the reader, perhaps?
LocoDelAssembly wrote:
Preparing for Huffman encoding?

Smile heh, I don't know if NP-hard algorithm should be used, but maybe...

Well, I don't know what is it used for exactly, but the lecturer had some examples like perhaps statistics. You have persons that have a car and others that don't. Then you have people with good healt and others with bad Smile
Now you can put them in a table as 0-bad, 1-good, 0-no car, 1-w/ car like this:
Code:
          w/ car health
Person 1:   0       1
Person 2:   0       0
  ...       .       .
Person N:   1       0
    

After arranging you can come to some conclusions like "people with cars have commonly healthproblems" Very Happy or something like that...
Post 28 May 2007, 08:36
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 29 May 2007, 08:24
just running exe i supposed there buttons should be somewhere below my screen Smile
(i use 800x600 resolution - i hope it is valid Wink )
Post 29 May 2007, 08:24
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 29 May 2007, 12:38
Damn, I'm really sorry - I was just thinking that my 1280x800 res laptop is the lowest you can get and thought that it would run no prob. on 1024x768 too. There is a really simple fix for this:
Around lines 760-766 (depending on source 32/64) change the upper-left to some other point on screen:
dialog main_dlg,"Subtraction technique",7,7,390,375,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME
I put 7,7 there because I don't like it at the very corner Razz
Post 29 May 2007, 12:38
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 29 May 2007, 13:01
thnx Smile there is nothing esspecial here in real: more and more of new application can not reduce their windows to fit into less then 1024x768, forcing users sell their aquariums and buy TFT, but i prefer low resolution even on TFT as more soft for eyes (usage of high resolution with large fonts brings other kind of problems with some software Sad )
----
in real you change left upper corner position, but i need smaller size Wink
i had try to modify dialog, but failed to compile: fasm says "Out of memory" (even fasmw on original M..Eng32.asm) (maybe because of national labels ??? )

here my variant of dialog (modify labels and "01010" text to get it proper if you wish to try)


Description:
Download
Filename: Miinus32ENG.xdlg.zip
Filesize: 8.8 KB
Downloaded: 758 Time(s)

Post 29 May 2007, 13:01
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 30 May 2007, 07:21
Well its not about labels, but should be called "BAD PROGRAMMING" Razz I've allocated rb 1 shl buffersize so when buffersize is 27 then about 131MB will be allocated and FASM needs all that space at the compile-time. In case there is other stuff at the end...
My compiler setup says 524288 in the memory inputbox Smile

I've done some very resolution-independent apps in MenuetOS, but in Windows they're making it so hard to do :S I'll have to catch the resize event and then calculate everything based on DPI ^o) or sth. Razz The project is in "good enough" status.
Post 30 May 2007, 07:21
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 30 May 2007, 17:06
now clear, thanx
Post 30 May 2007, 17:06
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 30 May 2007, 17:22
Quote:
My compiler setup says 524288 in the memory inputbox
over half of gigabyte?!? wow, man, there surely is a better way Wink
Post 30 May 2007, 17:22
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


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