![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Game engine designer
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4
![]() |
[x86]Need explanation
Have been reading an asm tutorial source file, where there is two lines I don't really understand. Would be great if you could help me by explaining them.
Palette db 768 dup(0) mov es:[di],al Thanks alot for your time! /Klarre
__________________
http://www.klarre.se |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
dup means that the value of 0 will be duplicated in each element of the Palette array (collection of adjacent values) that is being defined here. This is an assembly-time action, not a run-time action.
The second results in the value of al being stored in the address represented by the contents of es, offset by the value of di. For example, if you leave es alone, but increment the value of di after each move, your values will be stored in successive locations. ES is like a pointer to an array (or the address of the beginning of the array). DI is then the index. ES [DI].
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Game engine designer
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4
![]() |
Thanks alot! Now the code make sense.
/Klarre
__________________
http://www.klarre.se |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| List and explanation of all dev-c++ error messages | Josef_Stalin | C++ | 4 | Jul 18th, 2005 2:30 PM |
| DragMove a better explanation of what I need | cybatech | Delphi | 1 | Jul 6th, 2005 9:29 AM |