Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

What IS Assembly??

affan546

New member
Joined
Dec 29, 2011
Messages
23
Can Any 1 give me Basic COncept oF Assembly related to vb 6 and vb 2010 and Why it is used for???thanks in advance:wave:
 

Atheist

Raging swede
Joined
Aug 19, 2005
Messages
8,020
Assembly instructions is the language that your processor speaks (Or rather machine code). Your processor does not directly execute VB, C, C++, or any other language.
An assembly instruction more or less directly maps to machine code.

VB.NET compiles to an intermediary language called CIL (formerly MSIL).
When you run your .NET application, the Just-In-Time (JIT) compiler will translate the CIL code to native code to be executed by the processor.
I'm probably missing some details in there somewhere but thats roughly how it works. Thats the relationship between VB and assembly instructions.
 

sai krupa

New member
Joined
Oct 2, 2012
Messages
2
Assembly is one of the toughest programming language which will be used in hardware of Embedded for the Micro controller of all the IC's as per the instructions which are related to the controllers of IC version. It also helps to get the Embedded c because it is one of the combination language with the C.
 

Og_ofthejungle

New member
Joined
Feb 12, 2009
Messages
34
If I can build on what some of the others have said:

The simplest computer would be some electrical relays cobbled together so that if this condition is met (relay 1 on) and that condition is not met (relay 2 off) then an output happens (relay 3 goes on). A microchip can be thought of as millions of microscopic relays, and we could program a microchip by telling each individual relay what to do, using a shorthand with 1 for on and 0 for off. It would be a nightmare of 10010110 00110101 10001001 and so forth, but it's possible. That's called low level programming.

Well, to make it easier, chip designer build in "BIOS" level instructions. Using those instructions, we can program the microchips without going blind typing 0 and 1. These use simple instructions called Interrupts. You place the data you need to manipulate into memory locations called "Registers," you trigger the appropriate Interrupt, and the output appears in a different register. This is not quite as low level -- It's called "Machine Language" and it's what all code winds up doing -- but it's the lowest level that you can actually work with.

That's still tough to manipulate, so the hardware people made up "Mnemonics." These are things like words that are easier to remember, and that you can use to write code that another programmer can make sense out of. That's Assembly language. It's very powerful, because it will do let you do anything that the machine is capable of doing.

As the programming languages get easier for programmers to read and use, they are called "high level" languages. VB is a very high level language. The only higher languages I can think of are various scripts, HTML, and "Batch file" programming. High level programs return syntax errors if you get them wrong, or refuse to do many things that you shouldn't do. Low level programs don't.

In short, Assembly is the lowest level code that is practical for a programmer to use. I hope that helps.
 

jmsrickland

PowerPoster
Joined
Jan 15, 2008
Messages
11,074
Just a few.....


Assembly Instructions: What the programmer writes

Code:
  '
  '
HELLO    CSECT               
*                            
         USING *,12          
         STM   14,12,12(13)  
         LR    12,15                
         LA    15,SAVE      
         ST    15,8(13)      
         ST    13,4(15)                    
         LR    13,15         
*                           
         WTO   'Hello World' 
*
         L     13,4(13)                       
         LM    14,12,12(13) 
         SR    15,15         
         BR    14           
*           
SAVE     DS    18F           
         END  HELLO



Machine Code: Assembly instructions assembled to machine code

Code:
5F23 F45C
D205 033F D03C
1A55
0255 3000
4F2C 2015 
  '
  '
  '



Assembler: Statements used by the Assembler - they are not converted to machine code

Code:
CNOP
COPY
END
EXITCTL
ICTL
ISEQ
LTORG
ORG
POP
PUNCH
PUSH	
REPRO
CSECT
DSECT
ENTRY
EXTRN
DROP
USING
CCW
DC
DS
EQU
 

dilettante

PowerPoster
Joined
Feb 5, 2006
Messages
20,939
Don't confuse assembly language with machine code.

Most decent assemblers (the assembly language analog of compilers) are quite sophisticated. They manage memory locations as symbolic names, offer powerful macro facilities, do assembly-time expression evaluation, have data table building features, pack literal values into string pool blocks, create linkable modules, and a whole host of other things.

The fact that the output is machine code... isn't any different from saying that a compiler's output is machine code.

The main difference is that you are working at a far lower level, much closer to machine instructions, then when writing compiler language programs.

None of this has anything to do with the "BIOS" or other wacky things mentioned.

Modern CPUs offer sophisticated levels of security. These prevent user programs from executing privileged instructions, can prevent execution of data as code, isolate processes from each others' memory, and so on. The result is that using assembly language doesn't help you bypass security.

Microsoft offers a free one for non-commercial Windows programming: Microsoft Macro Assembler 8.0 (MASM) Package (x86)
 

jmsrickland

PowerPoster
Joined
Jan 15, 2008
Messages
11,074
Don't confuse assembly language with machine code.

Most decent assemblers (the assembly language analog of compilers) are quite sophisticated. They manage memory locations as symbolic names, offer powerful macro facilities, do assembly-time expression evaluation, have data table building features, pack literal values into string pool blocks, create linkable modules, and a whole host of other things.

The fact that the output is machine code... isn't any different from saying that a compiler's output is machine code.

The main difference is that you are working at a far lower level, much closer to machine instructions, then when writing compiler language programs.

None of this has anything to do with the "BIOS" or other wacky things mentioned.

Modern CPUs offer sophisticated levels of security. These prevent user programs from executing privileged instructions, can prevent execution of data as code, isolate processes from each others' memory, and so on. The result is that using assembly language doesn't help you bypass security.

Microsoft offers a free one for non-commercial Windows programming: Microsoft Macro Assembler 8.0 (MASM) Package (x86)

Who's doing that?
 

jmsrickland

PowerPoster
Joined
Jan 15, 2008
Messages
11,074
Don't confuse assembly language with machine code.

Most decent assemblers (the assembly language analog of compilers) are quite sophisticated. They manage memory locations as symbolic names, offer powerful macro facilities, do assembly-time expression evaluation, have data table building features, pack literal values into string pool blocks, create linkable modules, and a whole host of other things.

The fact that the output is machine code... isn't any different from saying that a compiler's output is machine code.

The main difference is that you are working at a far lower level, much closer to machine instructions, then when writing compiler language programs.

None of this has anything to do with the "BIOS" or other wacky things mentioned.

Modern CPUs offer sophisticated levels of security. These prevent user programs from executing privileged instructions, can prevent execution of data as code, isolate processes from each others' memory, and so on. The result is that using assembly language doesn't help you bypass security.

Microsoft offers a free one for non-commercial Windows programming: Microsoft Macro Assembler 8.0 (MASM) Package (x86)

Not necessarily true. Depends on the data. If the data just happens to have same hex value as an instruction then it would execute it as an instruction.

Here's two ways that it is possible to execute data as code.

You can branch into the middle of a data stream

You can move data to a location where it overlays instructions

When programmers are not paying attention to what they are doing the above two are very common occurances. The computer does not know the difference between data and instructions and does not care since they all look like machine code.

As far as privileged instructions go one can execute them if one knows how to set their program to a supervisor state which is quite possible and easy to do.

This is not normal in the application world of programming but in the systems world of programming it is quite common.
 
Last edited:

Og_ofthejungle

New member
Joined
Feb 12, 2009
Messages
34
Don't confuse assembly language with machine code.

Most decent assemblers (the assembly language analog of compilers) are quite sophisticated. They manage memory locations as symbolic names, offer powerful macro facilities, do assembly-time expression evaluation, have data table building features, pack literal values into string pool blocks, create linkable modules, and a whole host of other things.

The fact that the output is machine code... isn't any different from saying that a compiler's output is machine code.

The main difference is that you are working at a far lower level, much closer to machine instructions, then when writing compiler language programs.

None of this has anything to do with the "BIOS" or other wacky things mentioned.

Modern CPUs offer sophisticated levels of security. These prevent user programs from executing privileged instructions, can prevent execution of data as code, isolate processes from each others' memory, and so on. The result is that using assembly language doesn't help you bypass security.

Microsoft offers a free one for non-commercial Windows programming: Microsoft Macro Assembler 8.0 (MASM) Package (x86)
I simplified. Sue me.

"BIOS" or "Basic Input/Output System" is, indeed, relevant to interrupts. From mnemonic "Assembly Code" you can call BIOS interrupts or DOS interrupts. In fact, DOS interrupts rely upon BIOS interrupt 21h.

BIOS interrupts are hard-coded; DOS interrupts use a BIOS interrupt to access hardware. It's a fine distinction, but it's a distinction.

For the purpose of answering "What is Assembly?" I think that my explanation was sufficient, though actual mileage may vary.
 

jmsrickland

PowerPoster
Joined
Jan 15, 2008
Messages
11,074
@ Og_ofthejungle



In you post #5 you made the following statement:

High level programs return syntax errors if you get them wrong, or refuse to do many things that you shouldn't do. Low level programs don't.

That is not exactly so. Assembly is a low level language and you better believe it will return syntax errors. Write a program in Assembly instructions or 'mnemonics' and put in the wrong operands. When you go to assemble it (compile) your program will get a syntax error and refuse to run your code.
 

jmsrickland

PowerPoster
Joined
Jan 15, 2008
Messages
11,074
@ Og_ofthejungle



In you post #5 you made the following statement:

High level programs return syntax errors if you get them wrong, or refuse to do many things that you shouldn't do. Low level programs don't.

That is not exactly so. Assembly is a low level language and you better believe it will return syntax errors. Write a program in Assembly instructions or 'mnemonics' and put in the wrong operands. When you go to assemble it (compile) your program will get a syntax error and the Assembler will refuse to compile your code into an executable modlule.
 
Last edited:

Og_ofthejungle

New member
Joined
Feb 12, 2009
Messages
34
Good point. But I have successfully compiled programs with significant errrors such as no terminator in a string or calling the wrong memory location.
 

pocket

New member
Joined
Oct 21, 2013
Messages
37
Assembly instructions is the language that your processor speaks (Or rather machine code). Your processor does not directly execute VB, C, C++, or any other language.
An assembly instruction more or less directly maps to machine code.

VB.NET compiles to an intermediary language called CIL (formerly MSIL).
When you run your .NET application, the Just-In-Time (JIT) compiler will translate the CIL code to native code to be executed by the processor.
I'm probably missing some details in there somewhere but thats roughly how it works. Thats the relationship between VB and assembly instructions.

Thats is informative. I actually thought VB was like a blanket over the processor.:bigyello: Ha!
 
Top