Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 1st, 2004, 10:26 PM   #11
qub333
Newbie
 
Join Date: Aug 2004
Posts: 13
Rep Power: 0 qub333 is on a distinguished road
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.
qub333 is offline   Reply With Quote
Old Sep 3rd, 2004, 10:56 AM   #12
scientica
Newbie
 
scientica's Avatar
 
Join Date: Apr 2004
Location: Sweden
Posts: 10
Rep Power: 0 scientica is on a distinguished road
Send a message via ICQ to scientica
Quote:
Originally posted by Mjordan2nd@Aug 29 2004, 08:09 PM
Well, Ok.

Pros:
Learning assembly language will increase your knowledge of the computer tenfold.
You are in complete control of your machine.
Assembly code is as fast as it gets.
You can get access to unusual programming modes of your processor.
You can use it with some high-level languages

Cons:
Very tedious to write.
It is quite often buggy.
These bugs are hard to find.
not portable
I feel I must comment on this.
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?
scientica is offline   Reply With Quote
Old Sep 19th, 2004, 3:43 PM   #13
Ravilj
Programmer
 
Ravilj's Avatar
 
Join Date: Sep 2004
Location: JHB , South Africa
Posts: 79
Rep Power: 5 Ravilj is on a distinguished road
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!
Ravilj is offline   Reply With Quote
Old Sep 30th, 2004, 6:10 AM   #14
Thaidog
Newbie
 
Join Date: Sep 2004
Posts: 8
Rep Power: 0 Thaidog is on a distinguished road
Anybody here suggest any good books on assembly?
Thaidog is offline   Reply With Quote
Old Sep 30th, 2004, 9:04 AM   #15
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,649
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
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.
big_k105 is offline   Reply With Quote
Old Sep 30th, 2004, 3:16 PM   #16
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Old Oct 13th, 2004, 3:12 PM   #17
mici
Programmer
 
Join Date: Oct 2004
Posts: 67
Rep Power: 5 mici is on a distinguished road
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.
mici is offline   Reply With Quote
Old Oct 18th, 2004, 1:02 AM   #18
Daggerhex_Flynn
Programmer
 
Join Date: Oct 2004
Location: Canada
Posts: 82
Rep Power: 5 Daggerhex_Flynn is on a distinguished road
Assembly is too high level, why not program in the binary instruction set architecture.
Daggerhex_Flynn is offline   Reply With Quote
Old Oct 18th, 2004, 9:45 AM   #19
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Oct 18th, 2004, 10:14 AM   #20
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
I think he was joking.....or atleast i hope he was.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:02 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC