Four questions

Reply

Join Date: Sep 2008
Posts: 94
Reputation: pywriter is an unknown quantity at this point 
Solved Threads: 0
pywriter's Avatar
pywriter pywriter is offline Offline
Junior Poster in Training

Four questions

 
0
  #1
Apr 2nd, 2009
Hi
I have 4 questions
1-Is it right that when you learn assembly you learn machine language,too?How?
2-What makes a programming language feature OS dependent?
3-Does Assembly have OS dependent feature?what about HLA?
4-How can i write an OS independent program(bootable programs)?
thanks alot
My heart hates death
but in the moment that the morning of life is dark,
and there is a war between the good and the evil
being sank by the mouth of death,is sweet.
and yes that is worthy for chilvary
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 489
Reputation: shadwickman will become famous soon enough shadwickman will become famous soon enough 
Solved Threads: 76
shadwickman's Avatar
shadwickman shadwickman is offline Offline
Posting Pro in Training

Re: Four questions

 
0
  #2
Apr 2nd, 2009
I can answer 1 and 3 for you right now.

1. As far as I know, Assembly IS machine language. It's the actual instructions that get passed to the CPU. Hence having to manually keep track of a lot of things that high-level languages do for you automatically.

3. Assembly isn't OS dependent. However, compiling it to runnable files can be dependent on the OS (like a .exe file for Windows). The source is unchanged by the OS it's run on, but what it IS dependent on is the architecture of the CPU. The most common is the 80x86 architecture (found in most desktops), but there are others like MIPS. This means that different architectures have different instruction sets, etc.
The other thing the source does actually depend on is the compiler too. Like, NASM and MASM use slightly different syntaxes in the ASM source code.
And I don't know anything about HLA
Last edited by shadwickman; Apr 2nd, 2009 at 6:21 pm.
"Two good old boys in a fire-apple red convertible. Stoned. Ripped. Twisted. Good people."
- Hunter S. Thompson

my photography
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 94
Reputation: pywriter is an unknown quantity at this point 
Solved Threads: 0
pywriter's Avatar
pywriter pywriter is offline Offline
Junior Poster in Training

Re: Four questions

 
0
  #3
Apr 3rd, 2009
But again ASM instructions must be introduced to the CPU.no?
if yes,What does that?
and HLA stands for High Level Assembler and is a kind of assembly that supports some commands of high level languages like condition statements
My heart hates death
but in the moment that the morning of life is dark,
and there is a war between the good and the evil
being sank by the mouth of death,is sweet.
and yes that is worthy for chilvary
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1,568
Reputation: BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all 
Solved Threads: 196
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Re: Four questions

 
0
  #4
Apr 3rd, 2009
Originally Posted by pywriter View Post
Hi
I have 4 questions
1-Is it right that when you learn assembly you learn machine language,too?How?
2-What makes a programming language feature OS dependent?
3-Does Assembly have OS dependent feature?what about HLA?
4-How can i write an OS independent program(bootable programs)?
thanks alot
In response to the poster above me, no, Assembly is not machine language. Assembly is a language that is translated into machine code by the assembler. Programming languages are not OS dependent, they are dependent on the hardware. The Operating System is a piece of software, not hardware. And no, Assembly does not have an OS independent feature, since 1. the OS is software, not hardware; 2. Assembly breaks down into machine code, and machine code is dependent on the specific architecture you are running on.


-A specific hardware has a specific set of instructions that it can execute. http://en.wikipedia.org/wiki/Instruc...t_architecture
-If your programming language wants to run on that architecture, it must somehow break all of its high level statements down into instructions that that architecture can understand. So if I want C code to run on a specific architecture, there needs to be a compiler that breaks the C code statements into machine code that the machine understands.

Note: I think this process happens by first breaking the C code down into assembly language statements that the machine understands, then breaking the assembly into machine code. But I'm not positive about that.
Last edited by BestJewSinceJC; Apr 3rd, 2009 at 11:43 am.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 94
Reputation: pywriter is an unknown quantity at this point 
Solved Threads: 0
pywriter's Avatar
pywriter pywriter is offline Offline
Junior Poster in Training

Re: Four questions

 
0
  #5
Apr 3rd, 2009
So there must be different versions of a compiler for different architectures.Is it right?
And does the word architecture returns just to CPU?
Last edited by pywriter; Apr 3rd, 2009 at 1:29 pm.
My heart hates death
but in the moment that the morning of life is dark,
and there is a war between the good and the evil
being sank by the mouth of death,is sweet.
and yes that is worthy for chilvary
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 210
Reputation: rahul8590 is on a distinguished road 
Solved Threads: 10
rahul8590's Avatar
rahul8590 rahul8590 is offline Offline
Posting Whiz in Training

Re: Four questions

 
0
  #6
Apr 3rd, 2009
Well in computer architectures , the newer versions have new technology appended to the older ones .
so if ur programming 8086 on an intel core 2 duo processor , it would still work (but the vice - verse will not ) , its just the size of the registers and their no changes but the primary architecture still remains the same .
well the above i said assuming that intel pc s are used .
well as far as i know it may/maynot work for motorola or IBM pc `s .
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1,568
Reputation: BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all 
Solved Threads: 196
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Re: Four questions

 
0
  #7
Apr 3rd, 2009
Originally Posted by pywriter View Post
So there must be different versions of a compiler for different architectures.Is it right?
And does the word architecture returns just to CPU?
Yes, since different architectures have different sets of instructions (instructions break down into machine code), different architectures would need a different compiler.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 94
Reputation: pywriter is an unknown quantity at this point 
Solved Threads: 0
pywriter's Avatar
pywriter pywriter is offline Offline
Junior Poster in Training

Re: Four questions

 
0
  #8
Apr 4th, 2009
And is it right for all compiled languages?(I meant High level languages)
My heart hates death
but in the moment that the morning of life is dark,
and there is a war between the good and the evil
being sank by the mouth of death,is sweet.
and yes that is worthy for chilvary
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1,568
Reputation: BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all 
Solved Threads: 196
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Re: Four questions

 
0
  #9
Apr 7th, 2009
...???

I'm not sure what you mean by that. Put it like this: since every architecture has it's own set of instructions, a compiler needs to be capable of breaking a high level language's statements down into those instructions. Those instructions are then broken down into the machine code.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Assembly Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC