flat assembler
Message board for the users of flat assembler.

Index > Heap > What is this?

Author
Thread Post new topic Reply to topic
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
What are these little black things on these icons? They are only on these two files. When I copy them it goes away. Question Question They look like little clocks....

The files are out of BIGNUM.ZIP from THIS PAGE

EDIT: seems to be something about "This means that the file has been archived to tape and will take a very long time to access." But sometimes that file attribute accidently gets set by something...Theres info HERE

That website wrote:

The black clock is particularly baffling because you sometimes see it even if your system is not equipped with Hierarchical Storage Management. When this happens, it's because some program (typically a setup program) didn't check error codes properly.

CopyFileAttributes(LPCTSTR pszSrc, LPTSTR pszDst)
{
SetFileAttributes(pszDst, GetFileAttributes(pszSrc));
}
The above code fragment fails to check for an error code from GetFileAttributes. It so happens that GetFileAttributes fails by returning the value 0xFFFFFFFF. If you fail to check this error code, you end up setting every possible attribute on the destination, including FILE_ATTRIBUTE_OFFLINE. FILE_ATTRIBUTE_OFFLINE is the flag that tells Explorer that the file has been archived to tape.



Description:
Filesize: 14.04 KB
Viewed: 2640 Time(s)

weird.PNG



_________________
----> * <---- My star, won HERE
Post 18 Nov 2008, 22:33
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
cute Smile
Post 19 Nov 2008, 01:31
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
So your unZIP program allowed these to get through.
Get a new unZIPer, and/or email the author.
Post 19 Nov 2008, 02:49
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
lol, I used both windows built in zip and ultimatezip. They both gave me the same thing.

How would something like this be turned into assembly, its confusing C, I can't understand whats going on:
It add n2 to n1 and returns carry in t.

n1 and n2 are BIG_WIDTH bytes wide.

Its out of that BIGNUM.c
Code:
#define  BIG_WIDTH       8               
unsigned big_add(n1, n2)
        unsigned char *n1, *n2;
{
   unsigned i, t;

  i = BIG_WIDTH;
      t = 0;
      do {
           t = (unsigned)*n1 + (unsigned)*n2++ + t;
            t = (*n1++ = t) >> 8; }
  while(--i);
 return t;
}

    


Last edited by windwakr on 19 Nov 2008, 16:07; edited 1 time in total
Post 19 Nov 2008, 03:30
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
Please, don't try to convert that source! It is a horribly bad implementation.

http://x86asm.net/articles/working-with-big-numbers-using-x86-instructions/index.html

...will get you started on how to do multi-percision math on x86.
Post 19 Nov 2008, 03:47
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Well, look at the rest of bignum.c, it has things that article doesn't.
You can't multiply two big numbers in that article, or divide two big numbers.

These seem slightly less crazily coded, I may be able to translate them myself.

_________________
----> * <---- My star, won HERE


Last edited by windwakr on 19 Nov 2008, 04:04; edited 1 time in total
Post 19 Nov 2008, 03:50
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
Just use the school book method for multiplication:
Code:
  AB
  CD
----
  EF
 GH.
 IJ.
KL..

EF = B x D
GH = A x D
IJ = B x C
KL = A x C    
...this works for any size numbers and can be done itteratively (faster) or recursively.

There was a binary division algorithm on the board somewhere...
Post 19 Nov 2008, 03:59
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
I'm just gonna modify edfeds multiply code here to work with big numbers. Uses only shifts and adds.

Code:
mov ax,n1 
mov bx,n2 
mov cx,1 
mov dx,0 
next: 
test ax,cx 
je @f 
add dx,bx 
@@: 
shl bx,1 
shl cx,1 
jne .next 
    

_________________
----> * <---- My star, won HERE
Post 19 Nov 2008, 04:03
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
There are also some routines here:
http://board.flatassembler.net/topic.php?t=7852
Post 19 Nov 2008, 04:07
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Heres my first try at mul, it multiplies 2 64 bit numbers and displays a correct hex result.

It returns 2EA66ED470C(which is 3,205,772,429,068 in decimal), which is 1,595,866 X 2,008,798

I know its poorly coded, but I just wanted to see if I could do it.
Code:
include 'win32ax.inc'

.data
x dq 1595866
name dq 2008798
temp dq ?
temp2 dq ?
fmt db '%x',0
buf1 rb 256
buf2 rb 256

.code
start:
;;;;;MUL CODE;;;;;;;;
    mov eax,dword[x]
    mov edx,dword[x+4]
    mov dword[temp],1
    mov dword[temp2],0
    tester:
    mov eax,dword[name]
    test eax,dword[temp]
    je @f
    mov eax,dword[name+4]
    test eax,dword[temp+4]
    jne @f
    mov eax,dword[x]
    mov edx,dword[x+4] 
    add dword[temp2],eax
    adc dword[temp2+4],edx
    @@:
    shl dword[x],1
    rcl dword[x+4],1
    shl dword[temp],1
    jnz @f
    rcl dword[temp+4],1
    jz done
    @@:
    rcl dword[temp+4],1
    jz done
    @@:
    jmp tester
    done:
;;;;;;END MUL CODE;;;;;;;;;;


cinvoke wsprintf,buf2,fmt,dword[temp2]
cinvoke wsprintf,buf1,fmt,dword[temp2+4]
invoke lstrcat,buf1,buf2
invoke MessageBox,NULL,buf1,buf1,MB_OK
invoke ExitProcess,0
.end start
    

_________________
----> * <---- My star, won HERE
Post 19 Nov 2008, 17:20
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
Well, done. Understanding the binary certainly helps with stuff like IMUL EAX,01010101h; and how it adds all the byte nibbles in parallel, in the upper byte. From this idea other transformations can be devised to shuffle bits or bit fields using a multiply.
Post 19 Nov 2008, 17:48
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:  


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