Sponsored Content
Full Discussion: Why Assembly Language?
Top Forums Programming Why Assembly Language? Post 302580143 by Corona688 on Wednesday 7th of December 2011 04:19:07 PM
Old 12-07-2011
Quote:
Originally Posted by gabam
My question is that where does Assembly language stand today against the high level languages, I mean what can assembly do, that the other langues can't????

I hope you will explain your good points.
Thanks alot!
The most vital thing about assembly is that it's freestanding. It makes extremely few assumptions about the environment you're writing code for, and can create code which needs no operating system at all. That's what makes it almost impossible to get rid of.

When you're programming in assembly, all it amounts to in the end is "put these exact bytes in this exact location in memory" except you can give it instructions as well as bytes, and it does the conversion for you. That's precisely the kind of thing you need when writing a BIOS for example, when the computer does in fact start up blindly looking for its very first instruction at a very specific place.

You also need it to write a bootloader, which gets loaded from a hardcoded location on disk then blindly executed from, again, a specific spot inside that location.

You also need at least some of it to write an operating system. That gets loaded by the bootloader and, again, blindly executed starting from a very specific spot.

You don't get a nice, programmer-friendly environment where you can load whatever language you like to do whatever you please until after all these things have already happened. Even after that, assembly language is still useful.

The other thing about being freestanding is that, since machine code is executed by the host processor, there's no interpretation step. That's why you can write a better C compiler in C. C code isn't a program, it's a design which a C compiler uses to build a program out of raw assembly. You certainly couldn't write a better Perl inside Perl.

You can also write other languages in C. Name any language -- Perl, PHP, Java, C#, awk, Python, sh -- and chances are, it was written in C.

Last edited by Corona688; 12-07-2011 at 05:24 PM..
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Assembly vs C programming

I am currently looking into an os on developed on an x86 platformwhich contains certain assembly code written in .s files(NASM- compatible ) instead of using C I was wondering why C could not be used to do low level stuff instead? Do anyone have any idea or could enligthen me?Appreciate any help... (0 Replies)
Discussion started by: duoshock
0 Replies

2. Shell Programming and Scripting

Unix assembly help

Hey guys, well I'm extremely knew to Unix so any help advice is very appreciated. What I am trying to do is assemble a source code (Programming from the Ground Up: Chapter 3: Your First Programs) The source code named "FINDING A MAXIMUM VALUE" is the code I am trying to link and run, but I... (1 Reply)
Discussion started by: ac09
1 Replies

3. Programming

Assembly Language ( compile )

Can someone explain how to compile assembly language code. I made my first assembly language code, but don't know how to run it. I know i can debug with gdb, but is there any way to just compile it and get the answer like in C and java compilers. (3 Replies)
Discussion started by: Learnerabc
3 Replies

4. Programming

Help with assembly code

I want make simple assembly code for some thing like this a^6+6a^2+2a and range of a is between -3 to 3. I tried but it is not working properly. As this is my first assembly program that I am going to try, I want some help with it. I found this example online but i dont want this kind of... (2 Replies)
Discussion started by: Learnerabc
2 Replies

5. Programming

Fibonacci (assembly)

When i run this with gcc filename.s -o filename. It is giving fatal error: Unknown opcode at define registers. Anyhelp will be appreciated .section ".data" prompt: .asciz "\nThis program prints the Fibonacci sequence" prompt2: .asciz "\nEnter a limit on the largest number to be displayed:"... (2 Replies)
Discussion started by: Learnerabc
2 Replies

6. Programming

Ok i have a small assembly question

I have this small program that runs with the flat assembler. My problem is that at the receive line function it receives the line and if there isn't a $ typed at the end of the user input the program displays a lot of strange stuff, sometimes beeps and then it seems to terminate without causing any... (13 Replies)
Discussion started by: Errigour
13 Replies

7. Programming

Assembly 8085

Hi eneryone, Im trying to learn about assemply 8085 in order to make a project i have. First of all which emulator to use? I work in linux and I currently istalled GNUSim8085. Also, maybe somewhere I can find some simple examples? The project is about making an array saved in specific... (8 Replies)
Discussion started by: giampoul
8 Replies

8. What is on Your Mind?

Can assembly language be dispensed with ?

Hi. I learned C in high school and am proficient in it:D. At the college while learning microcontrollers there was a short course on assembly language which I skipped:p but had no trouble as most of the application programming had to be done in C. Should I go back n learn assembly language as I... (9 Replies)
Discussion started by: priyadarshianu
9 Replies

9. Homework & Coursework Questions

Sparc Assembly

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am having a hard time with this assignement i cant get the pfib value to print out the fib sequence. ... (1 Reply)
Discussion started by: kenjiro310
1 Replies

10. Programming

Understanding Assembly Code

As the title suggests, I want to better understand the following assembly code: section .text global main ; must be declared for linker (gcc) main: ; tell linker entry point mov edx, len ; message length mov ecx, msg ; message to write... (2 Replies)
Discussion started by: Azrael
2 Replies
gacutil(Mono 1.0)														 gacutil(Mono 1.0)

NAME
gacutil - Global Assembly Cache management utility. SYNOPSIS
gacutil [-user] [command] [options] DESCRIPTION
gacutil is a tool used by developers to install versioned assemblies into the system Global Assembly Cache (GAC) to become part of the assemblies that are available for all applications at runtime. Notice that they are not directly available to the compiler. The convention is that assemblies must also be placed in a separate directory to be accessed by the compiler. This is done with the -package directive to gacutil. The tool allows for installation, removal, and listing of the contents of the assembly cache. The GAC is relative to the Mono installation prefix: mono_prefix/lib/mono. COMMANDS
-i <assembly_path> [-check_refs] [-package NAME] [-root ROOTDIR] [-gacdir GACDIR] Installs an assembly into the global assembly cache. <assembly_path> is the name of the file that contains the assembly manifest The -package option can be used to also create a directory in in prefix/lib/mono with the name NAME, and a symlink is created from NAME/assembly_name to the assembly on the GAC. This is used so developers can reference a set of libraries at once. The -root option is used to specify the "libdir" value of an installation prefix which differs from the prefix of the system GAC. Typical automake usage is "-root $(DESTDIR)$(prefix)/lib". To access assemblies installed to a prefix other than the mono prefix, it is necessary to set the MONO_GAC_PREFIX environment variable. The -gacdir option is included for backward compatibility but is not recommended for new code. Use the -root option instead. The -check_refs option is used to ensure that the assembly being installed into the GAC does not reference any non strong named assemblies. Assemblies being installed to the GAC should not reference non strong named assemblies, however the is an optional check. -l [assembly_name] [-root ROOTDIR] [-gacdir GACDIR] Lists the contents of the global assembly cache. When the <assembly_name> parameter is specified only matching assemblies are listed. -u <assembly_display_name> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR] Uninstalls an assembly from the global assembly cache. <assembly_display_name> is the name of the assembly (partial or fully qualified) to remove from the global assembly cache. If a partial name is specified all matching assemblies will be uninstalled. As opposed to the install option that takes a filename, this takes as an argument the assembly name, which looks like this: MyLibrary.Something, version=1.0.0.0, publicKeyToken=xxxx,culture=neutral Notice that you can have spaces in the command line. There is no need to quote them. Performs a greedy removal. If you only specify one component like, "MyLibrary.Something", it will remove all versions of the library. -us <assembly_path> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR] Uninstalls an assembly using the specified assembly's full name. <assembly path> is the path to an assembly. The full assembly name is retrieved from the specified assembly if there is an assembly in the GAC with a matching name, it is removed. Unlike the -u option this option takes a file name, like this: Example: -us myDll.dll -ul <assembly_list_file> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR] Uninstalls one or more assemblies from the global assembly cache. <assembly_list_file> is the path to a test file containing a list of assembly names on separate lines. Example -ul assembly_list.txt assembly_list.txt contents: assembly1,Version=1.0.0.0,Culture=en,PublicKeyToken=0123456789abcdef assembly2,Version=2.0.0.0,Culture=en,PublicKeyToken=0123456789abcdef FILES
On Unix assemblies are loaded from the installation lib directory. If you set `prefix' to /usr, the assemblies will be located in /usr/lib. On Windows, the assemblies are loaded from the directory where mono and mint live. /etc/mono/config, ~/.mono/config Mono runtime configuration file. See the mono-config(5) manual page for more information. WEB SITE
Visit: http://www.go-mono.com for details SEE ALSO
mcs(1),mono(1) gacutil(Mono 1.0)
All times are GMT -4. The time now is 09:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy