Sponsored Content
The Lounge What is on Your Mind? Can assembly language be dispensed with ? Post 302661095 by bakunin on Sunday 24th of June 2012 06:54:52 PM
Old 06-24-2012
I started my career back in the late seventies and on IBM mainframes there was either COBOL or assembler - with the 2.5 KB real memory my first system (already outdated at that time) had the choice was quite clear: learn assembler and every dirty trick there was to save some bits here, some cycles there ....

Later, in the eighties, i wrote software for DSPs and embedded systems, mainly the DSPs of Analog Devices and the Motorola 56k-series. Again, it was assembler to the fullest extent: when you write the internal software for a telephone switchboard and the company wants to sell a few millions the only thing that counts is: how many cycles did you use for that task? The lower cycles, the lower the clock rates could be, which means you can buy lower graded CPUs, which cost exponentially less which means a BIG difference in customer price. If you could save one arithmetic unit or one register, the custom-built processors could be built without these parts which made them cheaper too.

We used to beat optimizing compilers by a very large margin. OK, we couldn't decipher our own code three months after "tape-out" (the tasks got simulated on an ICE and finally the tape with the processor specification was sent to the provider of the DSPs to be built on order), but it was expected to write the next version from scratch anyway.

One of my first jobs on a PC was to write a DOS device driver for a specialized file system for the real-time storage of acoustic data. This was the time of MFM-disks and the data rate for a usual 16-bit sampling in stereo frequency (44.1 kHz) is just a tad below the bandwidth of the ST-506 interface. My driver had to use every ounce of bandwidth it could get just keep up. Mind you, we had one of the brand-new hot 16 MHz NEAT 286, an extremely fast system!

Sure, these are extremes. But ones uses assembly language for the same reason we used to use assembly throughout computing history: for its unparalleled speed and for the sheer control it gives you over the system and its hardware. C is a language nicely suited for rapid prototyping, but i'm still quite confident to be able to beat any C-compiler in terms of speed of execution with hand-crafted assembler code. Even with all those nifty optimizations switched on.

This is nothing to say against C - in fact i like C. But to really understand what C is about you have to have experienced the problems solved/avoided by its use. You have to have been at the very bottom at least once to appreciate being on top. And, who knows, you might even start to like being at the source of things.

bakunin
These 2 Users Gave Thanks to bakunin 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

Why Assembly Language?

Hi guys, Assembly language is a low level language designed in 1950's, both system and application programs were written in assembly at that time. There is no question of assembly being very effecient compared to the other high level languages. But it is very cumbersome to write programs in... (9 Replies)
Discussion started by: gabam
9 Replies

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

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

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
no-involuntary-power-cycles(9P) 			   Kernel Properties for Drivers			   no-involuntary-power-cycles(9P)

NAME
no-involuntary-power-cycles - device property to prevent involuntary power cycles DESCRIPTION
A device that might be damaged by power cycles should export the boolean (zero length) property no-involuntary-power-cycles to notify the system that all power cycles for the device must be under the control of the device driver. The presence of this property prevents power from being removed from a device or any ancestor of the device while the device driver is detached, unless the device was voluntarily powered off as a result of the device driver calling pm_lower_power(9F). The presence of no-involuntary-power-cycles also forces attachment of the device driver during a CPR suspend operation and prevents the suspend from taking place, unless the device driver returns DDI_SUCCESS when its detach(9E) entry point is called with DDI_SUSPEND. The presence of no-involuntary-power-cycles does not prevent the system from being powered off due to a halt(1M) or uadmin(1M) invocation, except for CPR suspend. This property can be exported by a device that is not power manageable, in which case power is not removed from the device or from any of its ancestors, even when the driver for the device and the drivers for its ancestors are detached. EXAMPLES
Example 1: Use of Property in Driver's Configuration File The following is an example of a no-involuntary-power-cycles entry in a driver's .conf file: no-involuntary-power-cycles=1; ... Example 2: Use of Property in attach() Function The following is an example of how the preceding .conf file entry would be implemented in the attach(9E) function of a driver: xxattach(dev_info_t *dip, ddi_attach_cmd_t cmd) { ... if (ddi_prop_create(DDI_DEV_T_NONE, dip, DDI_PROP_CANSLEEP, "no-involuntary-power-cycles", NULL, 0) != DDI_PROP_SUCCESS) goto failed; ... } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), pm(7D), attach(9E), detach(9E), ddi_prop_create(9F) Writing Device Drivers SunOS 5.10 22 Mar 2001 no-involuntary-power-cycles(9P)
All times are GMT -4. The time now is 02:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy