assembly language

assembly language

Portrait de Manisha V.

What actually is Assembly language?????? 
How and where actually is assembly language and c language used???? 
software used for the development of assembly language code and linking the same???

 

33 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de Manisha V.

can any one help me????

Portrait de Abhishek 81

Assembly Language: Low level programming language understood by PC,Micrcontroller and goes by Machine instruction.that in turn is converted by assembler to and executable machine code
Assembly language is used for microcontroller such as 8085,8086 which understands machine code instructions.
Mixing Assembly Language and C language helps:Subroutines,polling,interrupt using assembly routines of a high level language as C helps bind machine code easier and faster
Here is a link for downloading th softwares available:http://www.intel-assembler.it/portale/indice.asp?sz=1020
or you can just go through this Link available at Intel Software to better understand the 64 architecture:http://software.intel.com/en-us/articles/introduction-to-x64-assembly

Abhishek Nandy
Portrait de daflippers

Hi Manisha,

Machine code is the program data sored in binary format and usually read by Humans in Hex.

Assembly Language is more or less a straight translation of instructions (opcodes) to make it easier for Humans to write code but each line of instructions translates into one or more bytes/words depending on processor.

C and other compiled high level languages are a method of writing programs where a single line of code translates into many lines of assembly language and therefore many bytes/words.

The higher the language the faster you can write code but the code might not be as efficient as a good Assembler programmer could do. The bulk of code is written in a high level language dropping to Assembler for time critical tasks.

However if you are asking this sort of question you really need to read some basic background material.

David

Portrait de daflippers

Also Manisha this is a forum of users so please don't post a hurry up 10 minutes after posting a question.

David

Portrait de Manisha V.

What abt I-32 architecture????which software is required for the same n where can i get it???
n how to start programming in the same???

Portrait de daflippers

Assuming you want to program Win8 App you will need to download Visual Studio 2012.

David

Portrait de Manisha V.

Can u guide me????
how do i get started with I-32 & I-64 assembly language programming.i have only worked with masm till date...

Portrait de daflippers

Hi Manisha,

MASM....that brings back memories.

First question, what do you want to write? If you want to write an App then you don't use Assembler. If you want to write a very tight routine called from an App then I can understand why you are asking about Assembler but I think this is unlikely.

Let us know what you want to do in the program and we can try to help.

David

Portrait de Manisha V.

Actually currently m completing my bachelors and as a part of it i have subject Microprocessors,we have practicals assignments based on it,and those assignments r very simple juz like adding 2 hex nos,block transfer,string operations,etc.
they are so basic level programs n also m curious to knw where actually are they used(these asm files)n what is the scope of it?
n also m interested in developing these files n programming too. if i get a chance to knw more abt these n ways i could develop these file
currently m using masm bt the version does not support for 32/64 bit register set.

Portrait de Bob Duffy (Intel)

Manisha is your question specific to Ultrabook App development for Windows 8? If not this may not be the right forum to seek the help you need

Portrait de Maikel Cordeiro

Assmbly language is the same of byte-code of Java.

This is not a binary language but a machine language. the JIT (Just In Time) of frameword.net interprets it and convert it to binary in run time.

MC
Portrait de Jayant-Akolkar

Hi Manisha,
You might want to refer to a book written by Gaonkar (This is Author's Name). Forgot the name of the book. But it is supposed to be the best book for Assembly Language. To start you need to understand the Bus concept, Data bus and address bus. Data bus is the BIT you need to know. 8085 was a 8 bit processor and the journey of Micro-processors (Pronounced mue P) started and it's still on. You'll encounter some instructions like MOV A,B and MVI . This is the language (micro)processor understands. Yon can actually get OPCODE for the same instructions and punch it into a (micro) processor key. I suggest you start with (Micro)Processor Kit Write "Hello World" program. Write the code (Assembly language) on paper (with Instructions like MOV & MVI, Stack Push,pop, Accumulator etc), convert the instructions to OPCODE, punch it on (Micro)Processor Kit and see if you get expected result.Once this task is complete, move up the ladder.
Regards,
Jayant Akolkar

Portrait de allexberg

hi

Portrait de Sergey Kostrov

Duplicate deleted.

Portrait de Sergey Kostrov

>>...Can u guide me????
>>how do i get started with I-32 & I-64 assembly language programming.i have only worked with masm till date...

Here are two examples of a classic Hello, World! application in C and Assembler languages:

[ In C language ]

#include "stdio.h"

void main( void )
{
printf( "Hello, World!\n" );
}

[ In Assembler language ]

Comment *
It also verifies that your CPU is a Genuine Intel
*

.MODEL tiny
.STACK 128
.DATA

Hello db 10,13,"Hello, World!",10,13,"$"
VendorID db 12 dup (?)
IntelID db "GenuineIntel"

.CODE

.586

@start:
mov AX, @DATA
mov DS, AX
mov ES, AX

xor EAX, EAX
cpuid

mov DWORD PTR VendorID, EBX ; Test for a vendor CPU
mov DWORD PTR VendorID[+4], EDX
mov DWORD PTR VendorID[+8], ECX

mov SI, OFFSET VendorID
mov DI, OFFSET IntelID
mov CX, LENGTH IntelID

@compare:
repe cmpsb
cmp CX, 0 ; If CX=0 you have a GenuineIntel
jne @cpuid_data

mov AH, 09h
mov DX, OFFSET Hello
int 21h

@cpuid_data:

mov AH, 09h
mov DX, OFFSET Hello
int 21h

mov AX, 4C00h ; Terminate
int 21h

END @start

Portrait de iliyapolak

>>>mov AH, 09h
mov DX, OFFSET Hello
int 21h>>>

Instead of calling int 21h there is also possibility to use MessageBox function,but kernel32 and user32 libraries must be included and linked.

Portrait de iliyapolak

>>>Assmbly language is the same of byte-code of Java.

This is not a binary language but a machine language. the JIT (Just In Time) of frameword.net interprets it and convert it to binary in run time.>>>

How assembly language is not binary language?At the lowest level it is simply binary encoded bitstream which is read by the CPU frontend(decoder units) and further break down into micro-ops(which encoding is not known).Intel x86 assembly uses mnemonics like mov,xor or which are compiled by the assembler into their corresponding opcodes and executed directly by the processor.Java bytecode as its name says it is fixed-lenth instruction set which is compiled by the JVM which in turn is written in C and executed as a Intel x86 assembly.

Portrait de iliyapolak

t>>>hey are so basic level programs n also m curious to knw where actually are they used(these asm files)n what is the scope of it?>>>

In order to enhance your knowledge I would recommend you to read a few books on assembly language programming one of such a books is Kip Irvine"Intel assembly language programming".You can also consult Iczelion MASM tutorials.

Portrait de Sergey Kostrov

>>>>...
>>>>mov AH, 09h
>>>>mov DX, OFFSET Hello
>>>>int 21h
>>>>...
>>
>>Instead of calling int 21h there is also possibility to use MessageBox function, but kernel32 and user32
>>libraries must be included and linked.

I understood that Manisha just started learning programming and it is a good approach to keep examples as simple as possible.

Portrait de iliyapolak

>>>I understood that Manisha just started learning programming and it is a good approach to keep examples as simple as possible.>>>

Yes.Agree with you.

Portrait de daflippers

First you need to understand the strengths and weaknesses of each language. 

Most software is written using a high level language such as C#, C++ which is compiled into machine code whereas Assembly language uses mnemonics to allow programmers to write machine code.  This means a line of high level language generates the equivalent of perhaps 50 lines of assembly language.  Typically the number of debugged lines of code written per day by a programmer is independent of the programming language used which is why high level languages are used.

Now the efficiency of the Compiler or Interpreter used to generate the machine code is good but not necessarily good enough for time critical tasks and so low level drivers, interrupt service routines etc. tend to be written in Assembler but unless you have a specific requirement or just want to learn the real basics of processors you are unlikely to need to use Assembler. 

My rules would be:

  1. Learn about processors and Assembler by using simple stuff like PIC, Atmel or similar devices - hands on.
  2. If you want to use Assembler in the Ultrabook/Windows 8 discussed here then you need to understand the low level fundementals of processors. See Rule 1.
  3. If you don't agree with rule 2 then see rule 1.

 

David

 

Portrait de daflippers

Quote:

iliyapolak wrote:

>>>Assmbly language is the same of byte-code of Java.

This is not a binary language but a machine language. the JIT (Just In Time) of frameword.net interprets it and convert it to binary in run time.>>>

How assembly language is not binary language?At the lowest level it is simply binary encoded bitstream which is read by the CPU frontend(decoder units) and further break down into micro-ops(which encoding is not known).Intel x86 assembly uses mnemonics like mov,xor or which are compiled by the assembler into their corresponding opcodes and executed directly by the processor.Java bytecode as its name says it is fixed-lenth instruction set which is compiled by the JVM which in turn is written in C and executed as a Intel x86 assembly.

Machine code can be represented in Hex, Octal or Binary.

Assembly Language is the lowest 'high' level language and is convertered from Human readable form to machine code by the Assembler.  As such Assembly language is not a binary language as a number of bytes of ASCII are transformed by the Assembler into a far smaller number of bytes of Machine Code.

Java bytecode is a sort of psuedo code as it is opcodes for a virtual processor implemented in a standardised enviroment running on a wide range of processor platforms.  So while bytecode is technically binary there is a high level of indirection as there isn't a physical processor running those instructions.

 

David 

Portrait de iliyapolak

>>>Machine code can be represented in Hex, Octal or Binary.>>>

I'm talking about the machine code which at the hardware level is represented by square-wave like bitstream.The exact encoding of the machine opcode is represented by binary encoded values(square-wave bitstream).

 

 

Portrait de iliyapolak

Assembly is the human redable abstraction of the binary encoded machine code,

Portrait de iliyapolak

 >>>So while bytecode is technically binary there is a high level of indirection as there isn't a physical processor running those instructions.>>>

Java bytecode is stored as a binary file and it is binary translated by JIT compiler which simply "maps"  bytecode to corresponding x86 machine opcodes. 

Portrait de daflippers

Hi iliyapolak,

Apologies if I am being overly pedantic....

I'll respond in 1 post rather than 3.

8< I'm talking about the machine code which at the hardware level is represented by square-wave like bitstream.The exact encoding of the machine opcode is represented by binary encoded values(square-wave bitstream).

The machine code is a set of instructions usually stored in memory, loaded into registers in the CPU and acted upon by the CPU.  How they are 'represented' is irrelevant to this audience.

 8< Assembly is the human redable abstraction of the binary encoded machine code,

Agreed but that doesn't mean Assembly language is Machine code.  Just like a book written in a different language it needs translating.  Assembly Language is translated by the assembler into Object code that is then linked by the linker into an image that can be loaded into memory and interpreted by the CPU as machine code.

8< Java bytecode is stored as a binary file and it is binary translated by JIT compiler which simply "maps"  bytecode to corresponding x86 machine opcodes. 

The Java bytecode is not run natively on the physical processor it is code run on a virtual processor which is implemented in a program running on an OS which runs on a physical processor - although there could be even more indirection if the OS is running in virtualised environment.

All that aside, the audience here are looking at Windows 8 and Ultrabooks and unless I am very much mistaken there will be very, very little chance that anyone will need to use any Assembly language when writing an application for Windows 8 on an UltraBook.

 

David

 

Portrait de iliyapolak

Hi!

>>>The machine code is a set of instructions usually stored in memory, loaded into registers in the CPU and acted upon by the CPU.  How they are 'represented' is irrelevant to this audience>>>

Yes here I agree with you completely.I simply went to deep into the hardware.

>>>Agreed but that doesn't mean Assembly language is Machine code>>>

Assembly language is the mnemonic representation of the machine code.Each mnemonic could be probably encoded by the ASCII values and converted into machine code by the assembler.Assembly mnemonic as I told you earlier is simply more human-readable than hex values or binary values.

>>>The Java bytecode is not run natively on the physical processor it is code run on a virtual processor which is implemented in a program running on an OS which runs on a physical processor - although there could be even more indirection if the OS is running in virtualised environment.>>>

And what I have written in my post? Java program is physically represented by the bytecode which if ordered to run directly on the processor will cause an invalid opcode exception because of unknown for the CPU encoding.There is needed a program compiled in native CPU machine code which will translate bytecode into x86 opcodes.

Regarding the last sentence I completely agree with you.

 

 

Portrait de daflippers

Ok I think we have all done the Assembly Language discussion to death now....

David

Portrait de iliyapolak

Quote:

daflippers wrote:

Ok I think we have all done the Assembly Language discussion to death now....

David

Yes you are right.

Portrait de Registry Recycler

you might like to read this hello world assembly program http://www.fieggen.com/software/assembly.htm

Portrait de iliyapolak

Quote:

Registry Recycler wrote:

you might like to read this hello world assembly program http://www.fieggen.com/software/assembly.htm

Good tutorial for the beginners.

Portrait de JudLup Luna

Hi, which application you want to develop?

JudLup Luna

Connectez-vous pour laisser un commentaire.