Click here to Skip to main content
15,891,707 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All,
I'm quite worry about this subject as it's in my semester. So please tell me basic stuff for getting start in this. Kindly tell me what software to use for this, and any simple basic notes for this.




Thanks and Regards,
Ravindra Bisht
Posted
Comments
Sergey Alexandrovich Kryukov 8-Nov-12 0:03am    
Not a question. Do you expect a book? There are no "simple basic notes".
--SA

1 solution

There are no "simple basic notes". You need to learn the CPU, whatever it is. And a lot more. Let's see.

You need to learn its architecture, its modes, its registers, its typical use, some basic instructions, and you also need to make sure you can find instructions relevant to your purpose in a reference book and clearly understand their description. You need clearly understand how a CPU works with memory and ports of the system it is embedded. You even need to get a clear idea of timing of different kinds of operations, at least approximately.

On architecture part, in addition to pure formal architecture of the CPU, you need to learn some basic data structures and operations on them. In most system, this is the stack, most fundamental structure in nearly all architectures, but it can be something else. If this is x86/IE32/IE64 architectures, they are extremely complex and hard to understand in all aspect. I would imagine learning all of it at the detail level sufficient for practical work in all modes can take 2-4 semesters, if not more. If your school delivers only 1 semester on this topic, you are learning just bare basics or something relatively simple.

[EDIT]

I just saw your next question and removed it — you should not re-post questions. The only detail in addition to this question was this one: the CPU is 8086. Well, this is a relatively complex processor, but the order or magnitude simpler than x86. Actually, x86 has a "real mode" which simulates 8086. It has only one memory mode with fixed memory. The memory is addressed as 16-bit segment:offset pair. The registers are classified into segment and offset ones, so the address can be indicated by a pair of related registers. That gives you only 1M of address space; in MS-DOS, only 640K of physical memory is addressed (setting aside special structures called "expanded memory" and "extended memory" used mostly on 80286-based machines — this stuff never worked properly.

In such segment:offset addressing, it's natural that the same physical address can be addressed by different address values. The effective address is only 20-bit, so there are 4096 ways to address the same point of the physical address.

Nearly everything is explained in the Wikipedia article "Intel 8086".

[END EDIT]

On top of it, you should develop some skills working with the code of Assembly language in part not related to the CPU. There are many different flavors of Assembly languages, different language for each class of CPUs, but even for the same CPU, you can choose different Assemblers (the compilers are called "Assemblers" (they assemble things), and the term "Assembly language" actually mean "the language of the Assembler"), with different syntax and a lot of peculiarities. Assembly languages are not standardized. The instruction and syntactic elements not related to the instructions and registers are devised for your convenience, but they can be good or cryptic and annoying. Even the syntax for CPU commands (even for the same CPU) could be different, as well as the syntax for different ways of addressing objects (there are always quite a few).

I used my "secret weapon" in assembling of the CPU instruction into a working Assembly-only (or not only) code: using in-line assembly of C++ or Borland Pascal. This was an excellent way to use more clear syntax with the possibility of use of the high-level language declarations, skip boring trivial parts of work and avoid freaky syntax peculiarity of "real" Assembly language. However, your course may require "real" Assembly language. Take a look. Depending on your previous experience, you can learn both and safe some time.

What else? Oh, I'm afraid to say, you will need to learn some language environment not related to CPU or the language itself. Here is the thing: the Assembler usually produce not the executable module, but an object file, something needed for modular development. This is a very non-trivial aspect of programming which is not well understood by developers using only high-level language. The object code is not a code in some certain address space. It is composed of unrelated fragments of code operating in different relative address spaces, which will be translated relative to each other later. This is because the executable module is composed of more then one object files (and object libraries, which you can roughly understand as a collection of object files somehow put in one file). This address translation is done by the utility called linker. So, another complication is that you should basically understand this kind of addressing and address translation even though it has nothing to do with CPU architecture. This is a pure artifact of the development cycle. And finally, you should basically understand the operation of such an important OS part as loader. Even though most users and even software developers do not really know that such thing exist, this is a very important part which places the executable module in the RAM (and the location of your data objects and code in RAM can be different each time). So, this is yet another address translation. Only at that moment of time, your code gets the shape which is should have during run time; and only then the "real" CPU architecture comes into play. Note that for complex CPU architectures, there are many other address transforms mapping address space of your process with the physical RAM addresses, which may involve relocation of the physical fragment of memory during run time (virtual memory, which has some different mechanism). So, you should understand all those addressing aspects, at least in general terms.

So, I hope I roughly listed most practical fields of knowledge an Assembly developer needs to learn. It's not really the rocket surgery, but this is quite considerable amount of work. Well, this is the opportunity you get from being a student, use it well. :-)

Good luck,
—SA
P.S.: I did not provide any references, because this would double the volume of this little article. I'm already well beyond the usual volume of the answer. Just use the terms I mentioned and read on each. Perhaps the best way to get the literature is to search each of the term in Wikipedia, read the article with attention and follow the links provided in each article.
 
Share this answer
 
v3
Comments
MT_ 8-Nov-12 0:57am    
There is no facility to vote +10 on CP, else would have given that too. settled for +5 :-)
Sergey Alexandrovich Kryukov 8-Nov-12 1:03am    
Thank you, Milind.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900