Assembly Programming Page
Hello all,
I wrote a page about Assembly language programming. I need your advice about it and what else I could add that could be usefull ? Here it is : http://www.ifrance.com/programmershouse/ASS-EN.HTML -------------------- ASSEMBLY : It is a difficult to code language. It is very close to the "machine language". Its single interest is to control directly and exactly what the processor is doing. It is used to optimize programs on processors with little memory, or to write the BIOS. The code is not portable from a processor to another from a different trend. INTEL INSTRUCTIONS : CALL "address" : Calls a program. CMP, TEST "register or address" : Compars both arguments. JMP "address" : Calls a program. JNE or JE "address" : Jump if (Non) Equal JZ or JNZ "address" : Jump if (Non) Zero LEA arg1,arg2 : Loads arg1 with value pointed by arg2 MOV arg1,arg2 : Puts arg2 in arg1 PUSH "hexa number or register" : Push register into stack POP "hexa number or register" : Pop stack into register SUB, ADD, MUL arg1,arg2 : results into arg1 COMPILER : Allows to go from the code (.asm) to executable (.exe). The best compilers are : MASM32 MY FIRST PROGRAM IN INTEL ASSEMBLY : ; Data Data Segment Message DB "Hello The World ! $" Data EndS ; Le code Code Segment Assume Cs : Code, Ds : Data Main Proc ; Printing of the message Mov Ah, 09h Mov Dx, Offset Message Int 21h ; end of the program, ; then return to MS-DOS Mov Ah, 0C00h Int 21h Main EndP Code EndS End Main LINKS : |
Quote:
are superior to Microsoft Assembler. Quote:
The code is not portable from one architechure to another. This page is obviously microsoft product centric, no? |
by programmershous
I need your advice about it and what else I could add that could be usefull ? depends on your audience and purpose, sorry if this seems a bit harsh but i just wanted to be thorough. your intel(x86) instruction set is a bit lacking even for an 8086. if this is the processor family you are concentrating on then i suggest you add more instructions, list the contents of the flags register and the control registers, discuss real mode vs protected mode and talk about the x87 fpu. you could if you wished go into a discussion about some of the more recent extensions to the family like mmx or the other one(does vector operations fast but forgotton name) you could also do some general discussion on things like cisc vs risc, pipelining, cache size, etc. a page explaining that processor speeds are not comparable between architectures and speed isnt everything would be really nice but is probably off your topic. to be honest you appear to be a bit of a newbie to assembly and the processors you are trying to document are very very complicated(heard of gdt, idt, or ring 0-3?). perhaps you should try a simpler processor something like a pic microcontroller or a z80 if your attempting to learn assembly then may i suggest you try something like corewars or one of the programming robot games, because most of these use types of assembly and you will learn 'how' to program assembly without having to worry about all the features of a general purpose processor. cos once you have a grasp of all the concepts the x86 will be much easier to understand. by jinksys What about NASM, GNU assembler? I cant be the only one who feels they are superior to Microsoft Assembler. for x86 ive only ever used nasm so i cant really comment but i find superior to be quite a loose word and feel it needs some clarification maybe if the good and bad points of both were listed instead. as for the gnu assembler i cant do AT&T syntax cos the src, dest thing does my head in but im sure people who grew up with it say the same about dest, src by jinksys This page is obviously microsoft product centric, no? a) executable (.exe). b) MASM32 c) Int 21h by the looks of it i'd say yes but more out of naiveity(sp?) than intent. |
Web Page Updated !
Thanks for the comments ! :-) I added : It is important to know the Registers : EFLAGS, Segments, General etc. To know more about 80X86 Architecture : click on THIS MMX are extensions of X86 Assembly but they are usefull only for multimedia and intensive graphical applications. They are not used for "normal" applications. MMX are quite a "marketing" extensions, because RISC processors take more advantage of the hardware. x86 are poorly designed CISC. To know more about RISC vs CISC : click on THIS Real mode vs Protected mode : The 80x86 chip can be in those different modes by selecting the Mode Flag Register. Microsoft OS, Linux and the Hardware Drivers use Real mode to have full control but it is dangerous because nothing is protected (memory, disks, screen etc.). "Normal" Programs use Protected Mode, which is safe from hardware failures. These modes are also found on other processors. The best assembly compilers for x86 are : MASM32, AS86 and NASM. The best assembly compiler for SUN and MOTOROLA is : GAS +some code for GAs and NASM +LINKS : Assembly HOWTO http://linuxassembly.org/resources.html The Art Of Assembly http://webster.cs.ucr.edu/Page_asm/ArtOfAsm.html x86 assembly FAQ http://www2.dgsys.com/~raymoon/faq/ Usenet: news://comp.lang.asm rem : *The assembly page is not intented only for x86, but thats the most used processor. *I am not newbie in assembly but I just wanted to write a page FOR newbies without going deep into details... and sometimes I make mistakes, and I dont know everything. Thats why you are very helpfull. (sometimes I need to reread docs or books to be sure about what I am talking about). |
Quote:
vm8086 mode to access bios functions, but their native state is protected mode. . . . . actually I just looked at your page and it seems your post is different from your actual page. You actually have: Quote:
protected ? Normal programs run in 32 bit protected mode, which protects the operating system from application failures. Remember that protected mode is the native state of the processor, real mode is just kept so compatibility remains. |
sorry you are right : I have all mixed up, I am a bit tired.
By the way : do you know when a driver needs to access in real mode ? is it only needed for bios ? what do you mean with compatibility ? |
When in 32bit protected mode all code runs in 32bit mode, but should
code need to run in 32bit mode (to access bios, or run 16 bit code), there is the vm8086 mode. You usually dont need to access the bios once in 32bit mode very often. The native state of the processor is 32bit protected mode, but intel still has it start up in real mode since they want their chips to be backward compatible, therefore chips made today will still run old realmode code (ie: DOS). |
All times are GMT -5. The time now is 03:54 AM. |