![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
|
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. |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.)
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Newbie
|
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?
|
|
|
|
|
|
#4 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#5 |
|
Newbie
|
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? |
|
|
|
|
|
#6 |
|
Professional Programmer
|
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.
__________________
JG-Webdesign |
|
|
|
|
|
#7 |
|
Newbie
|
Thanks a bunch, that was the answer I was looking for.
|
|
|
|
|
|
#8 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Introduction and assembler question: | Wilheimer | Community Introductions | 4 | Apr 13th, 2006 2:19 AM |
| Best resources for learning assembler | cyberphreak | Assembly | 8 | Nov 2nd, 2005 7:39 AM |
| How do I load a C program within assembler? | stevenup7002 | Assembly | 13 | Aug 24th, 2005 12:08 PM |
| Should I learn assembler? | teencoder | Assembly | 9 | Aug 7th, 2005 9:39 AM |
| Access COBOL external data in Assembler | packerm | Other Programming Languages | 0 | May 24th, 2005 5:03 AM |