![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Newbie
Join Date: Aug 2004
Posts: 13
Rep Power: 0
![]() |
I guess im a good example, i have fiddled in assemply and even played with simple programs, the level of understanding that it forces upon you is incredable, and for me that is the real seller, will i ever write an app, not in this lifetime, but i have also heard of those that (like the hackles cartoon) program lower level functions in assembly to speed up execution, whlile the actual pro's and con's of this are certainly up for debate. What i took from it was a greater understanding of the processer stack and in general the methods that a processor uses to accompish what code tells it.
|
|
|
|
|
|
#12 | |
|
Newbie
|
Quote:
Bugs, bugs, bugs... it's like any other language, only more powerfull, eg, you can scatter the plate pile (the stack, a powerful place, there lies the path you follow uppon return )but with well written (and occasionally documented, eg xor eax,eax needs no explanation) code, uit's quite easy to track down, and if you write your own debug code you get an (IMO) better/easier way to track down bugs --- eg you can write functions that tells you "I'm alive" and using that pin down to the instruction where the error is (well, it's a truth with modification, but it's up to the programmers use of black magic (like doing magic with the stack, chaning return address, writing smc, etc)) As for protable, yes, it's quite right, but as I've been told, with inline asm you can always fix that issue with #ifdef et al, ie one optimized assembly path and one unoptimized C/C++ path -- though it'll enlagre source it'll keep it portable (well, actually this is too truth with modification, as the asm it self still isn't portable )And tedious, well, I'd say it's highly dependant on the programmer, a sadomasochistical programmer like me get's a kick out of having (more or less) total controll Seriously, I find asm better than C/C++ in the aspect that there's no type casts to worry about (only the occasionall clarification of the operand size) -- but as I said I think it's a preference thing ![]() And the unusual modes, well, yes, but also no, in a secure OS there are limits (eg some instructions are privileged and can't be exeucted (w/o CPU exceptions, eg, wbinvd and invd ("cacheflushers" - one writesback the other doesn't - could cause system to crash if used impropperly)) in ring3 (think userland), but in ring0 they can (think: usualy kernel and driverspace). But it's quite fun where one can go, iirc in DOS (and many others) you could get to a mode known as UnReal mode, which is a special mode (think real mode(16-bit) + GDT from pmode(protected mode, 32-bit) - giving you more addressable memory). And the speed, it's true, well writen code is inded the fastest (eg, fit a loop in a L1 cache line (iirc 64 byte for most x86) and prefetch it and you might be lucky enougth to have it executes as fast as the processor can do .One great way to learn about what makes an computer tick is to write a lillte toy OS, it's something extra ordinary (one learns many fun things, like the why behind A20 beeing disabled, that some hardware is accessed via the keyboard controller ) :blink:
__________________
Regards Scienitca (registered user #335819 - http://counter.li.org ) -- Together in diversity, we each according to ability, to each according to needs, will help this world (to) become better - who did you help today? |
|
|
|
|
|
|
#13 |
|
Programmer
Join Date: Sep 2004
Location: JHB , South Africa
Posts: 79
Rep Power: 4
![]() |
The last time I programmed in assembler was building a fire routine using mode 13h. :/ damn i miss mode 13h...
__________________
Ravilj's OpenGL Terrain aka WinTerrain Last Updated: 17/01/2005! |
|
|
|
|
|
#14 |
|
Newbie
Join Date: Sep 2004
Posts: 8
Rep Power: 0
![]() |
Anybody here suggest any good books on assembly?
|
|
|
|
|
|
#15 |
|
PFO Founder
![]() ![]() |
i dont know about any books but if you look in one of the threads on this forum there is a few links to some good online tuts
and one pdf http://www.programmingforums.org/forum/ind...hp?showtopic=77
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#16 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
The PDF is really good. I'm also in the process of reading a book called Assembly Language Step-by-Step by Jeff Dunteman. I'm about 3/4 done with the book, and I've learned a lot. It's a great book. Teaches x86 programming under NASM for both Windows and Linux.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#17 |
|
Programmer
Join Date: Oct 2004
Posts: 67
Rep Power: 4
![]() |
Well as far as assembly goes it's great for speeding up the code for a crucial part of app. (let's say you want to do low level surface to surface bliting of video frames). In such cases it can make all the diference...
However i've seen simple moves on the program do wonderfull things. Once upon a time a nice man wrote a program called xxx (aka windows starfield screen saver) and this program was good. It could display 100 stars at 20 fps on a 386 machine and all this was writen in basic using real numbers. Then another guy came and found that if he replaced all real num declaration with integers. Furthermore he replaced all real num 3D calculations with int equivalents wich were first multiplied by a 1000 and then later on divided with 1000 to display positions correctly and with same precision. And when he compiled it he realized that the same program on the same machine ran at 1000fps ... simple move ... great optimization.... B)
__________________
coffee is my heroin. |
|
|
|
|
|
#18 |
|
Programmer
Join Date: Oct 2004
Location: Canada
Posts: 82
Rep Power: 4
![]() |
Assembly is too high level, why not program in the binary instruction set architecture.
|
|
|
|
|
|
#19 |
|
Programming Guru
![]() ![]() ![]() |
Since when was Assembly high level? What level of abstraction would a language like C++ have?
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|