Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Replying to Where To Find Resources Of Asm For First Timers?


Post Options

    • Can't make it out? Click here to generate a new image

  or Cancel


Topic Summary

Vyoma

Posted 01 December 2005 - 02:12 AM

Yes prorip, you are right.

What you were saying about the 'quick responses' and 'small amount of space' made me go through Michael Abrash's books mentally. (I am like total fan of his works. I worship him - maybe because only his books where available back in those days on assembly, optimization and graphics put together).

I would like to tell you all one of the trick that he had up his sleeve, one that explained where to go for optimization. Consider the following pseudo code (with the relative time taken in the square brackets):

START
TASK A [10]
...
...
TASK B [10]
...
...
TASK C [120]
...
...
TASK D [10]
...
...
LOOP 500 TIMES
...
TASK E [10]
...
TASK F [40]
...
END LOOP
...

(the logic moves on)

Say, the values in the square bracket are time take for the task to be done when written in a 3GL (3rd Generation Language).

Now, if you notice the above code, on the first glance, we would jump at optimizing task C, since it takes way too much time. But according to Michael Abrash, and what I have found myself, optimization should be done for those that are repetitive. In the above example, Task F should be optimized.

Let us look at both the cases.

1. Case 'Task C' reduced to 50%:
Time saved = 120 - (120 x 50%) = 60

2. Case 'Task F' reduced to 50%:
Time saved = 500 x (40 - (40 x 50%)) = 500 x (40 - 20)
= 500 x 20 = 10000

3. Case 'Task F' reduced to 75%:
Time saved = 500 x (40 - (40 x 75%)) = 500 x (40 - 30)
= 500 x 10 = 5000

As can be seen, when both the optimization lead to reduction to 50%, optimizing Task F is better. (Case 1 Vs Case 2)
Even when Task F is reduced to only 75% as opposed to the whooping 50% of Task C, the time saved for Case 3 is way higher than that of Case 1. (Case 1 Vs Case 3).

Now these case are theoretical, but trust me, real-case senarious are a lot closer to this than we think.

Oops! I got carried away. :) Hope this not way off track, but what I was making a point is that Assembly when used with right strategy can lead to powerful applications.

prorip

Posted 30 November 2005 - 11:29 AM

well Vyoma I think you sumed it up in a nutshell, in saying ASM sucks on x86 well how can that be? ASM is a hardware language whether it be on a computer or a chipset it your DVD player they rely on machine language (which asm is next best way of ready a bunch of 000's and 111's for a human) so all hardware rely's on ASM whether is a PHONE or a COMPUTER

ASM is used when direct programming and repeative functions that NEED QUICK RESPONSE in small space is needed. This can then be a common funtion\libary or file within your program. The most common programs you will see being written in ASM that are used on all machines are drivers. All driver files rely on ASM language to talk to individual hardware. The main use is asm besides graphics, drivers and os programming is RCE. It is a vital key to know asm programming for Reverse Engineering this can hold great knowlegdge for those who want to understand how other programmers think and archieve certain programming functions.


So in a conclusion ASM is not a preferred method for humans to use for BIG applications that are often update, manipulate and work on via alot of programmers that is why they invented 3GL programming. It is a lot easier to maintain and update programs writtin in languages such as C++ and JAVA. BUT ASM is great for maniputing HARDWARE were libaries or funtions aren't available to these programmers, or where the programmer is wanting a QUICK RESPONE ROUTINE in SMALL AMOUNT OF SPACE.

anywayz thats my 2cents, please feel free to correct me if I'm wrong

thanks

Vyoma

Posted 29 November 2005 - 02:29 AM

well asm sucks on an x86, as i looked around it, it is best to program assembly for the dead m68k and PPC processors, but asm is such a language, that it is quite hard to make it run smoothly in a short time, especially if the code is more serious, it is hard to port the applications written in assembly too. :/

View Post



ASM sucks on an x86? Well, cannot exactly agree with that. I remember, I made a brick like game during my Engineering study all on a x86 Real mode platform. You move on to Protected mode, then it really gets tougher. But again, I do not know much about m68k, so I may be wrong.

Assembly, by nature should be very hard to port. Assembly used on its own cannot, in my opinion make amazing programs. But, what you can do is, build the most repetitive and basic funtionality of your program in Assembly, wrap it up in a function, and then you can use it in any high level language. This is where the actual power lies. It is one of the techniques used by Michael Abrash as can be quite evident when one reads through his books, Zen of Game Programming, or the Black Book. Note here though, that my opinions are limited by the scope of graphics and game programming, and I may not be accurate in other domains of applicaitons.

Quatrux

Posted 27 November 2005 - 09:24 PM

well asm sucks on an x86, as i looked around it, it is best to program assembly for the dead m68k and PPC processors, but asm is such a language, that it is quite hard to make it run smoothly in a short time, especially if the code is more serious, it is hard to port the applications written in assembly too. :/

prorip

Posted 27 November 2005 - 11:35 AM

ASM takes a matter of practice and re-agusting to think like memory and switches, just as a computer does. But saying that you still will need to know your operating system very well and also the functions that come with that operating system such as the DLL's in Windows. I think the below link is one of the best books ever written on ASM it is very old but contains all the information you need to read ASM.

http://maven.smith.e...ly/artofasm.htm

anywayz good luck with your programming....

pyser

Posted 27 September 2005 - 12:17 PM

Hey, if you want to see assembly language in action try SIMUPROC. Just google it and you will find out about it. It shows assembly language in use and you can also make your own assembly language and run it through the simulator. It is however in spanish, but I'm sure that there will be a translated version available. If this helps in any way please let me know.

Ryan

ShadowPool

Posted 05 September 2005 - 05:46 AM

Hello everyone!

I recently googled Assembly, trying to learn a little more about it. However, the results I skimmed through were very cryptic. I have programming experience, and am not a complete n00b to certain concepts.

I am just curious about where to go if you don't really know anything about Assembly. How to get started, what you need, etc., etc.

I'd appreciate anyone's help, thanks,
+CurTis- ;)

<{POST_SNAPBACK}>


Hi there! I learned MASM32 about 2 years ago and I can't stop writing programs with it yet! It's best to learn by trying things yourself, so you might want to start by installing and setting up the tools you will need. First, download the MASM32 compiler MASM32 and install it to C:\masm32. Then download RadASM and unzip it to C:\RadASM.

RadASM is an integrated development enviroment or IDE. An IDE makes it easier to pass parameters to the compiler and organizes your programming projects so you can develop applications faster and with less headache. After you have masm32 and RadASM installed, you might want to download a copy of the Windows API Documentation. Unzip the help file and put it into C:\RadASM\help. You can then open up radasm and go to help>win32 api, and the help file will open.

To get started with learning how to write a windows application in Masm32, you will want to read Iczelion's Win32 Assembly Tutorials and this RadASM tutorial. The RadASM tutorial is meant for people switiching from VisualBasic. If you get stuck on something, the best place to go is the Masm32 Forum. I find the people at that forum very mature and helpful!

;) Good Luck!!!!

rapco

Posted 08 May 2005 - 09:00 PM

I am currently on a Win32 platform, and am not in the position to have an extra linux machine right now. I also know about hex, binary, decima, ascii relations, as I started to get more acquainted with those when I joined mod-x.


Well, those numeric systems are really easy to understand..

Binary has two characters: 0 and 1
so it's: 000,001,010,011,100,101,110,111

Hexa is: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

Decimal is the one we use the most:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14...

and the ascii is a 256 character code, each code represents a character..

And the linuz platform.. well, with partition magic u can make a 2 gb partition and install linux on it, it's free!!! u can use your Win32 platform and you linux one in the same HD without any problems...

And, ASM, i think you wan't to learn how to use it in your pc, why do u want to learn, any specific porpouse?

^zer0dyer$

Posted 05 May 2005 - 11:01 PM

Thanks a lot for those replies!!

Yes, as you can see, I have literally no experience with ASM. I know a little bit about it.

I am currently on a Win32 platform, and am not in the position to have an extra linux machine right now. I also know about hex, binary, decima, ascii relations, as I started to get more acquainted with those when I joined mod-x.

Thanks again for your help,
+CurTis-

rapco

Posted 02 May 2005 - 09:35 PM

Well, asm it's different for every micro your programming...

I mean, you can wirte asm programs for microchip's pic, or motorola microcontroller, and the language it's a bit different.. it has some code that's like the other...

You can program a TI calculator using asm language, and it's also different...

When you program in asm for pc, what tou are really programming is the proccesor....

Anyway... for any ams language your trying to program...

The best guide... THE OFFiCIAL MANUAL OF THE THING YOU PROGRAMMING!

For instance... u can use the compiler taht micro$oft uses for asm, it's freeware, and it has it's own "Help" file...

And, if you know c programming, you'll find asm very simple and easy

Review the complete topic (launches new window)