Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 17th, 2006, 8:25 PM   #1
purpleorange
Newbie
 
purpleorange's Avatar
 
Join Date: Oct 2006
Location: Oh gosh, where I live. This is all so sudden.
Posts: 7
Rep Power: 0 purpleorange is on a distinguished road
Send a message via AIM to purpleorange
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.
purpleorange is offline   Reply With Quote
Old Oct 17th, 2006, 8:41 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Oct 17th, 2006, 8:46 PM   #3
purpleorange
Newbie
 
purpleorange's Avatar
 
Join Date: Oct 2006
Location: Oh gosh, where I live. This is all so sudden.
Posts: 7
Rep Power: 0 purpleorange is on a distinguished road
Send a message via AIM to purpleorange
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?
purpleorange is offline   Reply With Quote
Old Oct 17th, 2006, 8:56 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
I understand that each person's code may be different
Hm yeah. I'm not talking about each user's code. I'm talking about the coders that write the assemblers. No, they are not the same. For a given processor, the machine code is the same. The translator that kowtows to your ability to deal more successfully with mnemonics than with binary numbers is a product of it's creator's opinion about what will be more effective.

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
DaWei is offline   Reply With Quote
Old Oct 17th, 2006, 9:04 PM   #5
purpleorange
Newbie
 
purpleorange's Avatar
 
Join Date: Oct 2006
Location: Oh gosh, where I live. This is all so sudden.
Posts: 7
Rep Power: 0 purpleorange is on a distinguished road
Send a message via AIM to purpleorange
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?
purpleorange is offline   Reply With Quote
Old Oct 18th, 2006, 12:25 AM   #6
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 417
Rep Power: 3 Wizard1988 is on a distinguished road
Send a message via AIM to Wizard1988
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
Wizard1988 is offline   Reply With Quote
Old Oct 18th, 2006, 12:43 AM   #7
purpleorange
Newbie
 
purpleorange's Avatar
 
Join Date: Oct 2006
Location: Oh gosh, where I live. This is all so sudden.
Posts: 7
Rep Power: 0 purpleorange is on a distinguished road
Send a message via AIM to purpleorange
Thanks a bunch, that was the answer I was looking for.
purpleorange is offline   Reply With Quote
Old Oct 18th, 2006, 2:03 AM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:30 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC