Does anyone still program in Assembly lang. code?

I only dabble in programming. But I found this impressive.menuet
It seems like a lot for one floppy. And yes it does work

Bingo. I don’t compose assembly code, but it’s invaluable when you’re poking thru the registers (with a debugger) to find out what went wrong.

That being said, BALR 14, 15 anyone? :smiley:

Let’s SVC 3 and get the heck out of here!!!

0x90 is the NOP on x86 chips, and 0xCD is first byte of all two-byte INT opcodes (INT 0x21, INT 0x13, etc.). :slight_smile:

Modern reasons to write new assembly code seem to fall into three main categories:
[ul]
[li]Embedded systems that will have a relatively small control program working directly with specialized hardware. scr4 gives a perfect example of this. Plus, an intelligent and experienced programmer can write code tight enough to wring acceptable performance out of outdated chips and limited packages.[/li]
Early microcomputers were so limited they resembled embedded systems, especially machines like the C64 or ZX-80 with ROM BASIC and way too little RAM.
[li]Parts of operating systems, because they need to talk to the hardware directly and provide the foundation for everything else. The task-switching code might not be written in assembly, but the device drivers have to be at least in part. Most modern OSes (at least since Unix in the late 1960s/early 1970s) are largely written in C or another high-level language, but parts must be written in assembly for the reasons I mentioned.[/li][li]Very time-critical code paths that your optimising compiler can’t bum any further. Usually, the part written in assembly is a single kernel surrounded by a program largely written in C or FORTRAN (for scientific/engineering applications). The gurus who can optimize tricky stretches to be tightly efficient on a specific machine and rigorously correct are held in high esteem by the rest of the programming world.[/li][/ul]Of course, those are the technical reasons. Personal reasons range from wanting to learn more about computers to a sense of dissatisfaction with the idea that you’re being protected from yourself when you write in a high-level language.

Ack, pthpppbt! IBM! Don’t you know the best computer for assembly language was the VAX? :wink:

cite?
What knowledge source are you basing this on?
All the major airlines (Sabre), credit card companies (VISA), and hotels (Holidex) still use assembler. Granted a lot of them are using a “C” layer on top now, but all the existing code that was written in the 60’s is still in place and damn near bug free by now. I’ve worked on more than one project where they tried to get off assembler (ACP/TPF), and the project faild. They haven’t yet produced anything that has the processing speed of assembler. I’m sure C comes close.

I’ve been a programmer since 1984, and during that time I’ve heard millions of people talk about how important it is for code to be portable. During the last 20 years do you know how much code I ever had to port over to another machine? NONE. That’s right, zilch. The reality is that mode code is written for a specific purpose, and a specific platform. When you wrote a program for IBM 360, you never expected it to be moved to a different platform.

When I took my first assembly programming course in college, it was made pretty clear that the course was for weeding out the programmer wannabees.

Then they came out with the Berger aptitude test. Anyone else heard of it?

Hey, I have a BSE in electrical from U of M 2003! My freshman year they had a course called EECS 100 that you were supposed to take if you were going to do CS or EE. I didn’t take it since I had no idea what I was going to major in at the time and they dropped it the next year. But in that class they had you write the same program in binary, assembly, and then C. I guess it was good to get the concepts across, and I wish I had taken it because when it came time for my senior design project, I was seriously lacking in programming the DSP chips we were using. So I guess yes, as many others have said, assembly does get used, but no, not for anything very large scale.

You’re wrong. Assembler is not a compiled language… It’s an assembled language. There’s a difference.

This must be specific to a certain programming environment or culture, then. In the open-source world, it’s extremely common for programs to be distributed in source form and made to work on platforms other than the one they were originally written for. gcc has been ported to more hardware/OS pairs than I can comfortably count, including such oddities as VAX/VMS and MS-DOS. NetBSD is almost completely source-portable to a huge number of hardware types, including single-board machines and other non-commercial platforms. There’s even a NetBSD/PDP-10 project.

So portability is a huge concern for a whole bunch of programmers.

Chris Sawyer, a British games programmer, writes all of his games in assembly (Transport Tycoon, Rollercoaster Tycoon 1 + 2 etc.).

Back when I worked for aMajor Airline we wrote our assembler programs in 1K blocks. Before I left we were allowed to write in 4K blocks!

One of the coolest things about writing in assembler was ‘patching’. When you wrote a program, you (usually) tried to leave space in the program block. When you implemented a program, there was a very bad connotation with “falling a program back”, so often we had to fix the problem in real time. We would literally hard code a branch in the program (this is all in Hex notation mind you) to the bottom/unused part of the program, then write the fix in Hexidecimal, then code in a hard branch to the NSI (Next Sequential Instruction) It’s been over 10 years since I’ve worked for an airline but I still remember a lot of the op code.

So, to whoever said BALR 14, 15 above? (By the way, that’s a Branch and Link Register instruction)

How about this: 47F0 C028?

That’s right, that’s a Hard Branch to displacement 0x028 off of register C.

I think this guy does something similar to what you’re describing Enright3: http://www.xs4all.nl/~rsdi/gpxpatch.html His patch adds features to the game that weren’t included by disassembling the executable and fiddling with it. Am I correct?

OK. I mentioned lack of portability as an additional issue. It is sometimes very important. The library that I work on has to build on several platforms (not that we would seriously consider using assembly language instead of C++ if it didn’t). To the writers of the web browser I’m using right now, portability is extremely important. I could go on listing software for which this is true, including most of what unix users are used to having at their disposal (it’s a good thing that grep was not written in assembly language). Even programs I’ve written for strictly my own use have been run on multiple platforms, due to hardware availability and obsolescence.

I was going to say this, but you beat me to it. I’ll just add to your response. :wink:

The Rollercoaster Tycoon series (1 & 2), IMHO one of the PC games of all-time, was written in x86 assembler/machine code and compiled using MS Macro Assembler V6.11c, with a small amount of C code used to interface to MS Windows and DirectX.

He did all of this himself! He has some help with the graphics and sound, but ALL of the assembly code was written by himself.

This just blows me away!

For some people, portability is a big issue.

I’ve had to port code from RSX (the operating system for PDP-11, which if you don’t know what that is, it’s a REALLY OLD computer), to VMS, to windows. Back in the earlier PC days, games were commonly produced for both the PC and the Mac. These days games are commonly produced for both the PC and game consoles. As Linux gets more and more popular, there are more software packages being done for both Windows and Linux. A lot of this code was originally only targetted to one machine and one specific application, and the porting came later. If you get into the habit of always writing portable code, it becomes second nature and you don’t have to really put much effort into it. If the software never gets ported, no big deal, and pretty much no time wasted. If it does get ported, the fact that you wrote the code to be portable makes the life of the person doing the port MUCH easier.

So if assembly is not the “lowest level” code available what is? Would it be theoreticallly possible to program in one’s and zeros? Is there a human “Data” out there somewhere who could (and would have reason to) do this?

Sure. Absolute Machine Code. The very lowest possible level at which you can program a computer is in its own native machine code, consisting of strings of 1’s and 0’s and stored as binary numbers.

You want to know what’s like to program in machine code? Chew on a ball of tin foil, while listening to someone scratch their nails on a chalk board, while having your fingernails slowly removed, while watching a neverending loop of Cop Rock, while listening to a neverending loop of Ashlee Simpson songs…for a week straight!

It’s not fun!

I’ve done it when an assembler was not available, writing diagnostic programs to find hardware faults, creating binary patches for bugs in existing software, fixing problems encountered while debugging a program, writing bootstraps and loaders for new computers.

All you need is a programming card and a pad of paper.

In the beginning, that was how it was done: Humans would write out the program in something like assembly language mnemonics and then manually translate it into machine code, which would be fed into the machine. I’ve done this, but only for computers running under emulation. It isn’t that much more difficult than assembly language, at least for relatively small and uncomplicated programs.

Back in the old days, all machine had front panels: A bunch of rows of lights and switches that displayed the contents of various locations in the machine (a specific RAM location under examination and the registers) and, via the switches, allowed you to deposit binary information directly into the computer. Seymour Cray, the founder of Cray Research, is said to have toggled in the OS of the CRAY-1 by hand using the front panel. Less wizardly programmers had to toggle in the bootstrap code by hand every time the machine was powered on. (The bootstrap code is the little program that is capable of loading the OS and getting it running. It doesn’t do much, and in the interests of efficiency is made as small as possible. Modern machines have their bootstrap code in ROM chips.)

The very first personal computers were kit machines: That is, you bought parts and assembled them yourself. They didn’t have anything by way of input/output capability beyond, you guessed it, a front panel. :slight_smile: Some of them (the KIM-1, for example) had replaced the traditional light-and-toggle system with a hexadecimal keypad and a few seven-segment LEDs, but the essential system was the exact same.