flat assembler
Message board for the users of flat assembler.

 Index > Heap > Number counting
Author
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..?
03 Jan 2010, 13:05
DustWolf

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

03 Jan 2010, 17:21
Borsuc

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

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 =

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)

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
03 Jan 2010, 23:47
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
04 Jan 2010, 12:17
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsCompiler InternalsIDE DevelopmentOS ConstructionNon-x86 architecturesHigh Level LanguagesProgramming Language DesignProjects and IdeasExamples and Tutorials Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou can attach files in this forumYou can download files in this forum