flat assembler
Message board for the users of flat assembler.

Index > Main > []

Author
Thread Post new topic Reply to topic
Spool



Joined: 08 Jan 2013
Posts: 151
Spool 12 Jan 2013, 16:55
[ Post removed by author. ]


Last edited by Spool on 17 Mar 2013, 04:07; edited 2 times in total
Post 12 Jan 2013, 16:55
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1178
Location: Unknown
HaHaAnonymous 12 Jan 2013, 17:11
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 22:02; edited 2 times in total
Post 12 Jan 2013, 17:11
View user's profile Send private message Reply with quote
Spool



Joined: 08 Jan 2013
Posts: 151
Spool 12 Jan 2013, 17:18
[ Post removed by author. ]


Last edited by Spool on 17 Mar 2013, 03:51; edited 1 time in total
Post 12 Jan 2013, 17:18
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1178
Location: Unknown
HaHaAnonymous 12 Jan 2013, 17:35
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 22:02; edited 1 time in total
Post 12 Jan 2013, 17:35
View user's profile Send private message Reply with quote
Bargest



Joined: 09 Feb 2012
Posts: 79
Location: Russia
Bargest 12 Jan 2013, 18:27
Memory operations are much slower than register ones.
Code:
mov eax, [a] ; 1
inc eax
mov [a], eax ; 2
    

2 memory operations.
Code:
inc dword [a] ; 1
    

1 memory operation.
But if we have more complex calculations, there will be more memory operations in the second case.
Post 12 Jan 2013, 18:27
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 12 Jan 2013, 20:18
Bargest, "inc [memory]" takes 2 memory operations as well. Because the CPU can not do arithmetic directly in the memory. The value have to be read, processed and then write. Of course the cash memory can affect this process as well. (although I also think "inc [memory] faster" because at least only one instruction have to be read from the memory, decoded and executed. Well, from the cash actually. Smile
Post 12 Jan 2013, 20:18
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Bargest



Joined: 09 Feb 2012
Posts: 79
Location: Russia
Bargest 12 Jan 2013, 20:24
Quote:
Bargest, "inc [memory]" takes 2 memory operations as well.

I know this. But:
1) It is one operation, so just one opcode is peeked out from buffer and decoded;
2) I think in this instruction address is set on address bus just for one time (it is one of the longest parts of memory operations).

So I consider it is 1.5 memory operation.Very Happy

And cache improves speed of first case as well.Smile
Post 12 Jan 2013, 20:24
View user's profile Send private message 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.