![]() |
Which assembler?
I have a couple of questions. I have a basic understanding of how computers operate. I learned to program some assembly for the virtual calculator from the book, How Computers do Math. I would like to write programs for real processors though. I would like to learn IA-32 assembly and am aware there are different assemblers.
I know each kind of processor architecture calls for a different assembly language. I figured that the instructions would be the same in assembly language as long as I am programming for the same processor. Is that the case? Because if the instructions are the same, what makes MASM different than TASM or NASM? I guessed that each assembler may have different macros and stuff that make programming assembly easier. If I write x86 assembly code for one assembler, would it be able to assemble with another? I'm so confused. |
Let's say that I want to produce a binary pattern, 1011001101011110, but I don't want my user to have to type all that in. I can write a program that maps the word, "Crapola", to that pattern. I can also write a program that maps "OhBaby!!" to that pattern. There is no reason to presume that one person writing a mapping program would choose to make it exactly like another person's, or that one person's mapper would produce the same code as another person's. Which is better? Ford or Chevy? (I vote Lamborghini.)
|
Hm yeah I understand that each person's code may be different or if they're the same and assembled with different assemblers, the output machine code could be different, but I guess my real questions would be, is there a single assembly language for x86 processors? Or is the assembly language different for each assembler. Do some assemblers require specific syntax or statements to allow for the program to assemble?
|
Quote:
I'm considered cryptic, but the answer wasn't THAT bad: "I don't want MY user (ed: the assembler writer's user) to have to type all that in" seems to be a fairly straightforward implication. |
Hahah yeah thanks I'm just a bit slow. Thank you so much for your time and efforts and I apologize if I am being hard to work with at all. And gosh you seem to be getting back to this thread quickly. Appreciated very much.
Now is it possible for you to tell me how each assembler syntax may be different? Each assembler must have loads, adds, stores, increments, decrements, jumps, etc right? How can these vary with different assemblers? |
The commands are all the same if its for the same processor. However the directives for specifying what kind of a file you will be making are different. You should check out FASM and MASM32. I personally find FASM easier to work with.
|
Thanks a bunch, that was the answer I was looking for.
|
Even though the commands (as machine code) are the same, the mnemonics might be different. For instance, Intel assembler for the 8080 used MOV A, B whereas the Zilog versions used LD A, B. Intel, for the other direction, used MOV B, A whereas Zilog used ST B, A. Another (different processor, maybe, it's been a long time) used LDA B, for instance.
|
| All times are GMT -5. The time now is 1:11 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC