flat assembler
Message board for the users of flat assembler.

Index > Heap > Number counting

Author
Thread Post new topic Reply to topic
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
Just becoming an asm user i found out a lot of logic difficulties.
They are number shifting, bit\byte\... order, math operations and many the like my head had to cope.
Later i began summing car-number figures to automate the process somehow.
Performing the count over numbers i have to imagine them on a wall etc., writing intermediate results somewhere else.
Working with 0xNUMS often do not count any of them just fetching out the memory - is this laziness?
Not so far but can see a RESULT much later before its obvious proof.

Do the folk have some master-secrets, advice, problems, smth. else..?
Whether pouring images\sounds\ideas stream your head on a time?
Post 03 Jan 2010, 13:05
View user's profile Send private message Reply with quote
DustWolf



Joined: 26 Jan 2006
Posts: 373
Location: Ljubljana, Slovenia
DustWolf
gcalctool

Smile
Post 03 Jan 2010, 17:21
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
what's hard about bit/byte ordering? it's just an order... Wink

shifting shifts the number, which is 1s and 0s obviously (think in binary when working with computers). This operation is equal to multiplying or dividing by 2^shift (where '^' denotes power). In other words, a right shift by 1 bit divides by 2. A left shift by 1 bit multiplies by 2. A right shift by 3 bits divides by 8, etc... (2^3 = Cool

What do you have to "memorize" specifically? How it fetches data from memory?

Memory is a collection of values which have specific addresses. Since I assume you mean x86 assembly which is little endian, all you have to "memorize" is that when you "load" a dword (32 bits value) from a memory address what it does is this:

Code:
/------------- eax -------------\
v                               v
byte 3 | byte 2 | byte 1 | byte 0

(byte 0 means 'al', least significant byte; byte 1 is 'ah', more significant byte; byte 3 is *most* significant byte)

mov eax, [address]

does this:

byte 0 = VALUE BYTE found at address+0
byte 1 = VALUE BYTE found at address+1
byte 2 = VALUE BYTE found at address+2
byte 3 = VALUE BYTE found at address+3    
if that's not what you were asking, sorry I just don't understand Smile
Post 03 Jan 2010, 23:47
View user's profile Send private message Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko
i meant the memory of a human still thanks
the explanation's good
brain work mentioned only
it is a trying to know how do people think while being in a brainstorm
like 0x45 to decimal converting: whether you, multiplying 16*4 perform
10*4 and 6*4 simultaneously, and when 5 left would be added
thanks
Post 04 Jan 2010, 12:17
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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.