Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!tnc!m0154 From: m0154@tnc.UUCP (GUY GARNETT) Newsgroups: comp.sys.amiga.programmer Subject: Re: Assembly Language & Programming Message-ID: <794@tnc.UUCP> Date: 12 Apr 91 15:08:19 GMT References: Reply-To: m0154@tnc.UUCP (GUY GARNETT) Organization: The Next Challenge, Fairfax, Va. Lines: 41 About the only comment I have to make is where you say "If you were programming on a mini or a mainframe, you shouldn't care what the hardware looks like". I would like to point out that the difference between modern home computers, minis, and mainframes is no longer one of kind, but is one of degree: mainframes have more memory and faster I/O. The IBM 3090 I use here at work is actually a much more primitive architecture than the 68000. Even when programming in FORTRAN, a knowledge of the machine will help. For example, when placing variables in a COMMON block, they should be arranged so that variables (especially arrays) start on longword boundries (because non-longword aligned fetches involve extra memory cycles). Performance is also enhanced when arrays and COMMON blocks are less than 4096 bytes long (the maximum displacement for relative addressing in the S/370 architecture; displacements of more than 4096 bytes require an additional base register, or require address arithmetic; the compiler will choose which one is faster). As you can see, knowledge of the hardware will help you write better programs, even on a large mainframe. You can also see how primitive the architecture of the 3090 (which is an S/370 machine) really is: there are 16 32-bit registers (one of which has special meaning as the program counter in some instructions) which can hold addresses or data. There are no stack instructions (if you want a stack, you can write the macros yourself), and there are no subroutine call instructions (again, you write the macros yourself, and dedicate a register to point to a save area which holds the caller's context, including program counter). Knowledge of the hardware and machine architecture will always help you write better programs, but it is not required to write decent software, or to be a competent programmer. I strongly suggest that anyone who calls him or her self a programmer learn as much as possible about the hardware, and also learn as much as possible about mathematics; in many ways, computer programming is "mathematical engineering". Wildstar