.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

Difference between native code, machine code and assembly code

Posted By :Ravi Ranjan Kumar     Posted Date :June 29, 2011    Points :40   Category :.NET Framework 
Native code:- This term is sometimes used in places where machine code (see above) is meant. However, it is also sometimes used to mean unmanaged code. Unmanaged code is the kind of code that requires you to manually allocate and de-allocate memory, sometimes causing memory leaks (when you forget to de-allocate) and sometimes segmentation faults (when you de-allocate too soon).

Machine code:- This is the most well-defined one. It is code that uses the byte-code instructions which your processor (the physical piece of metal that does the actual work) understands and executes directly. All other code must be translated or transformed into machine code before your machine can execute it.

Assembly code:- This term generally refers to the kind of source code people write when they really want to write byte-code. An assembler is a program that turns this source code into real byte-code. It is not a compiler because the transformation is 1-to-1.

You can also find related Interview Question to Difference between native code, machine code and assembly code  below: 

Difference between imperative and interrogative code.

  
There are imperative and interrogative functions and I think they are talking about that. Imperative functions are the one which return a
value while the interrogative functions do not return a value. (More...)

What's the difference between code-based security and role-based security? Which one is better?

  
Code security is the approach of using permissions and permission sets for a given code to run. Role-based security most of the time involves the code running with the privileges of the current user. Both are equally better. Depending on the deployment type security can be implemented. (More...)

Difference between server-side code and client-side code.

  
Server-side code executes on server side. Client-side code executes in the client's browser. (More...)

What's the difference between and XML documentation tag?

  
Single line code example and multiple-line code example. (More...)

Describe the difference between inline and code behind - which is best in a loosely coupled solution

  
ASP.NET supports two modes of page development: Page logic code that is written inside runat="server"> blocks within an .aspx file and dynamically compiled the first time the page is requested on the server. Page logic code that is written within an external class that is compiled prior to deployment on a server and linked ""behind"" the .aspx file at run time. (More...)

What is difference between Code access and role based security?

  
Code security is the approach of using permissions and permission sets for a given code to run. The admin, for example, can disable running executables off the Internet or restrict access to corporate database to only few applications.

Role security most of the time involves the code running with the privileges of the current user. This way the code cannot supposedly do more harm than mess up a single user account.

Neither is better. It depends on the nature of the application; both code-based and role-based security could be implemented to an extent.
(More...)

Describe the difference between inline and code behind?

  
Inline code written alond side the html in a page.Code-behind is a code written in a separate file and referenced by the .aspx page. (More...)

Difference between imperative and interrogative code.

  
imperative :Does not return value
interrogative :Return Value
(More...)

What is the managed and unmanaged code in .net?

  
The .NET Framework provides a run-time environment called the Common Language Runtime, which manages the execution of code and provides services that make the development process easier. Compilers and tools expose the runtime's functionality and enable you to write code that benefits from this managed execution environment. Code that you develop with a language compiler that targets the runtime is called managed code; it benefits from features such as cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, a simplified model for component interaction, and debugging and profiling services. (More...)

Can code inside multiple catch block be executed?

  
No, Code can not execute in mutiple catch block (More...)

What is managed code and managed data?

  
Managed code is code that is written to target the services of the Common Language Runtime (see What is the Common Language Runtime?). In order to target these services, the code must provide a minimum level of information (metadata) to the runtime. All C#, Visual Basic.NET, and _JScript.NET code is managed by default. Visual Studio.NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).
Closely related to managed code is managed data-data that is allocated and de-allocated by the Common Language Runtime's garbage collector. C#, Visual Basic, and _JScript.NET data is managed by default. C# data can, however, be marked as unmanaged through the use of special keywords. Visual Studio.NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed by using the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector. In addition, the class becomes a full participating member of the .NET Framework community, with the benefits and restrictions that brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class). An example of a restriction is that a managed class can only inherit from one base class. (More...)

What is a Managed Code?

  
Managed code runs inside the environment of CLR i.e. .NET runtime. In short all IL are managed code. But if you are using some third party software example VB6 or VC++ component they are unmanaged code as .NET runtime (CLR) does not have control over the source code execution of the language. (More...)

What is CODE Access security?

  
CAS is part of .NET security model that determines whether or not a piece of code is allowed to run and what resources it can use while running. Example CAS will allow an application to read but not to write and delete a file or a resource from a folder. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend