What IS Assembly??-VBForums
Results 1 to 16 of 16

Thread: What IS Assembly??

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2011
    Posts
    23

    What IS Assembly??

    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

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: What IS Assembly??

    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.
    ---My Flickr photo (mostly screenshots these days!) stream. Have a look!

    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    TCP client/server connection | Retrieving the EventHandler for any Event by code.
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: What IS Assembly??

    This is a site dedicated to Assembly so it won't directly relate to any specific development language (although it is probably most closely related to C)

    http://www.friedspace.com/assembly/intro.php
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  4. #4
    New Member
    Join Date
    Oct 2012
    Posts
    2

    Re: What IS Assembly??

    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.

  5. #5
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: What IS Assembly??

    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.

  6. #6
    Lively Member mikorians's Avatar
    Join Date
    Jun 2010
    Location
    In a fog
    Posts
    83

    Re: What IS Assembly??

    Called Instructions or OpCodes

  7. #7
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,144

    Re: What IS Assembly??

    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


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    11,409

    Re: What IS Assembly??

    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)

  9. #9
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,144

    Re: What IS Assembly??

    Quote Originally Posted by dilettante View Post
    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?


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  10. #10
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,144

    Re: What IS Assembly??

    Quote Originally Posted by dilettante View Post
    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 by jmsrickland; Feb 16th, 2013 at 10:31 AM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  11. #11
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: What IS Assembly??

    Quote Originally Posted by dilettante View Post
    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.

  12. #12
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,144

    Re: What IS Assembly??

    @ 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.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  13. #13
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,144

    Re: What IS Assembly??

    @ 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 by jmsrickland; Feb 16th, 2013 at 04:24 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  14. #14
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: What IS Assembly??

    Good point. But I have successfully compiled programs with significant errrors such as no terminator in a string or calling the wrong memory location.

  15. #15
    Lively Member geek648's Avatar
    Join Date
    Apr 2011
    Posts
    75

    Re: What IS Assembly??

    I think the OP may have meant a .net assembly
    http://en.wikipedia.org/wiki/Assembly_(CLI)

  16. #16
    Member pocket's Avatar
    Join Date
    Oct 2013
    Location
    Greater London
    Posts
    37

    Re: What IS Assembly??

    Quote Originally Posted by Atheist View Post
    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. Ha!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.