flat assembler
Message board for the users of flat assembler.

Index > Heap > Helpful pics... i'll start

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
Razz


Description:
Filesize: 116.2 KB
Viewed: 5090 Time(s)

hex2dec2hex.jpg




Last edited by edemko on 05 Feb 2010, 11:29; edited 1 time in total
Post 05 Feb 2010, 07:28
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 693
Location: Adelaide
sinsi
If you can't understand hex, then you shouldn't be programming in ASM Razz
Same goes for binary...
Post 05 Feb 2010, 07:38
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
awesome pic Wink

btw, i'm using piece of paper with first combinations of Gray code - helpful to play Duke for fast searching of switch combinations Wink i can understand it, but paper makes it faster Cool
Post 05 Feb 2010, 08:07
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
I use Gray code to test my ram.
Code:
   mov eax,0 ;start at 0
.next:
   mov ecx,eax
   shr ecx,1
   xor ecx,eax
   mov [next_gray_code],ecx
   inc eax ;go to next Gray code
   jmp .next    
Post 05 Feb 2010, 08:45
View user's profile Send private message Visit poster's website Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
sinsi wrote:
If you can't understand hex, then you shouldn't be programming in ASM Razz
Same goes for binary...


There is no need to open all the wold whether you can do less or nothing at all with the hex or anoher table. Time ago i new little formulas, tricks etc. as had no need in that.
Post 05 Feb 2010, 09:16
View user's profile Send private message Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
revolution, you code could be used in an obfuscator.
Did you joke with that, or it's really useful?
Post 05 Feb 2010, 09:19
View user's profile Send private message Reply with quote
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
Please remove the irritating cursor at 86. Wink


Last edited by YONG on 05 Feb 2010, 10:01; edited 1 time in total
Post 05 Feb 2010, 09:19
View user's profile Send private message Visit poster's website Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 693
Location: Adelaide
sinsi
OK, is there a binary table too? that is very handy (0-F).
And learn to count in 16's (2's are easy)seriously
Post 05 Feb 2010, 09:24
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
serfasm wrote:
revolution, you code could be used in an obfuscator.
Did you joke with that, or it's really useful?
The code is real. It generates a Gray code sequence. Try it.

I don't know what you mean by "obfuscator". It is just a counting sequence, nothing is obfuscated.
Post 05 Feb 2010, 09:47
View user's profile Send private message Visit poster's website Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
Obfuscation is making your code difficult to be read for the others; mostly used in protection(naive resistance) against hacking; implemented(in x86-code) through a garbage flow insertion which is never activated or(if activated) does nothing:
Code:
         clc
         dec     eax
         jc      @f   ;dec doesn't alter flags.cf
         ;etc.
    

Here is a wiki-link: http://en.wikipedia.org/wiki/Obfuscated_code
Post 05 Feb 2010, 11:20
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
My code is not a piece of obfuscated junk! Really. It exercises the memory by storing values in a Gray code sequence. I just used the "next_gray_code" label as a place holder for you to replace with an output generator of your choice, perhaps a print function or similar.
Code:
   mov ebx,0 ;start at 0
.next:
   mov eax,ebx
   shr eax,1
   xor eax,ebx
   stdcall SomePrintFunction,eax
   inc ebx ;go to next Gray code
   jmp .next    
You can start the sequence at any arbitrary position by changing the initial value.

If you knew me better you would know that I don't obfuscate things. At least, not deliberately ;)
Post 05 Feb 2010, 11:25
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
I have a question. is "walking through" (incrementing) the graycode on an interleaved-format integer in 2D coordinates the same as a Hilbert Curve?
Post 05 Feb 2010, 21:25
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
Borsuc: Which Gray code sequence are you referring to? There are many different Gray code sequences.
Post 06 Feb 2010, 01:41
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
The "standard" one you used, x=x^(x>>1) Smile

interleaved means that there's (from bit 0 onwards) 1 bit for x, 1 bit for 1, second bit for x, second bit for y, third bit for x, third bit for y, and so on...

Why I asked is because the graycode, when it increments, only 1 bit changes --> hence there's no abrupt jump (one of the characteristics of a Hilbert Curve).

_________________
Previously known as The_Grey_Beast
Post 06 Feb 2010, 21:40
View user's profile Send private message Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
Wink


Description:
Filesize: 197.89 KB
Viewed: 4902 Time(s)

ff.jpg


Post 07 Feb 2010, 00:41
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
The noise could be less (see attach) and the file size also Wink


Description:
Filesize: 41.76 KB
Viewed: 4872 Time(s)

NOISE.PNG


Post 07 Feb 2010, 14:14
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2913
Location: [RSP+8*5]
bitRAKE
Borsuc wrote:
I have a question. is "walking through" (incrementing) the graycode on an interleaved-format integer in 2D coordinates the same as a Hilbert Curve?
Hamiltonian paths are Gray codes.

Yet, for an order-N Hilbert curve the corresponding Gray code would be in base 2^N,
and only two digits in length.

Order 1, Hilbert curve Gray code:
00 10 11 01

Order 2, Hilbert curve Gray code:
00 01 11 10 20 30 31 21 22 32 33 23 13 12 02 03

Note the lower order codes prefix higher orders, with digits swapped.
________________________
Seems appropriate to include this here:
Code:
; reflected binary Gray code convertion

QWORD..fromGrayCode:
     repeat 5
            mov rax,rcx
         shr rcx,64 shr %
            xor rcx,rax
 end repeat

QWORD..toGrayCode:
    mov rax,rcx
 shr rcx,1
   xor rcx,rax
 retn    

_________________
¯\(°_o)/¯ unlicense.org
Post 07 Feb 2010, 19:44
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
Hamiltonian paths... those sound good too (for walking through 'nearby' elements) Smile
Post 07 Feb 2010, 20:50
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
bitRAKE wrote:
Code:
; reflected binary Gray code convertion

QWORD..fromGrayCode:
  repeat 5
            mov rax,rcx
         shr rcx,64 shr %
            xor rcx,rax
 end repeat

QWORD..toGrayCode:
    mov rax,rcx
 shr rcx,1
   xor rcx,rax
 retn    
You need an extra pass for the fromGrayCode. Use 'repeat 6'
Post 08 Feb 2010, 00:44
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2913
Location: [RSP+8*5]
bitRAKE
revolution wrote:
You need an extra pass for the fromGrayCode. Use 'repeat 6'
It falls thru for the last pass.

_________________
¯\(°_o)/¯ unlicense.org
Post 08 Feb 2010, 03:00
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 1, 2  Next

< 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.