22C:18, Lecture 1, Fall 1996

Douglas W. Jones
University of Iowa Department of Computer Science

What is This Course?

The title says it all: Assembly Language and Computer Architecture We will be studying assembly language and we will be using it as a vehicle for studying computer architecture.

What is Computer Architecture?

What is Architecture? The definition of architecture is most easily discussed in the context of its original meaning with respect to the design of buildings. The Architecture of a building includes all aspects of the building's design that its occupants are aware of. This includes such details as the arrangement of rooms, location of doorways and windows, surface finishes and location of switches, lights, wall outlets and other conveniences.

Buildings, of course, are made using some technology, bricks, beams, plaster and stone, and these may be visible elements of the architecture. Brick exteriors and exposed beams are examples of engineering elements that are exposed to the occupant by the architecture. Note, however, that many engineering elements of the structure of a building may be hidden from the occupants, and that some exposed aspects of the engineering may be highly misleading. For example, a brick exterior does not indicate that the bearing walls of a building are brick; Brick exteriors are commonly applied over wood frame walls! Similarly, not all the exposed beams in buildings are actually structural elements. Architects have been incorporating false beams into their structures since Roman times!

The buildings on the University of Iowa Pentacrest provide an excellent example of architecture and engineering. The oldest building on campus, the Old Capitol, is a brick building with a limestone exterior and wood porticos. Most people seeing the porticos think they are stone! Macbride and Schaeffer halls are also brick and stone construction, but with real stone pillars holding up their porticos. Maclean Hall is reinforced concrete construction, with a very thin stone facing, and Jessup Hall is a steel frame building, also with a thin stone facing. These buildings are "architecturally compatable" while being based on very different engineering.

Computers also have architecture and engineering. The architecture of a computer system includes all aspects of the computer visible to the programmer. Every architecture must be built, somehow, using some underlying technology in the realm of computer engineering, and in many cases, some aspects of the underlying engineering show through in the architecture. Nonetheless, many computer architectures have been implemented compatably over many years using a variety of different technologies.

For example, the DEC PDP-5 and PDP-8 architecture first appeared on the DEC PDP-5, sold in 1963; these machines were built using core memory and discrete transistors. The PDP-8, introduced in 1965, was an architecturally compatable reimplementation of this architecture using a newer generation of discrete transistor technology. The PDP-8/I was a reimplementation using TTL integrated circuits; the PDP-8/F, in 1970, was another reimplementation using some MSI chips. The PDP-8/A, in 1974, used some LSI chips, and the VT/78 was a reimplementation based on an architecturally compatable microprocessor. The PDP-8 family ended with the end of the DECmate III+ production run in 1990. The range of technology represented by this example is immense, yet a programmer who learned to program on the PDP-5 would notice very little change programming on a DECmate III+, except, of course, that a system that used to occupy many 6 foot high relay racks was now a small desktop machine and the system software had grown considerably over the 27 year lifetime of the architecture.

What Specific Computer Architecture Will We Study?

We will be studying the Hawk architecture. This fictional architecture combines elements of many modern RISC architectures with historical features that date back to the very first computers.

Why a fiction? The dominant textbooks on the market today focus on the Intel 80x86 and on the Motorola M68000 architectures. These architectures are very badly dated! The Intel architecture is the end product of an evolution from Intel's first microprocessors, and as such, it is saddled with immense accidental complexity, making it very poorly suited for teaching. The Motorola architecture is far cleaner, illustrating very well the state of the art in computer architecture in 1976. There has been immense progress in computer architecture since 1976, though!

The Hawk architecture, while fictional, is designed within the RISC (Reduced Instruction Set Computer) framework that dominates modern work in computer architecture. The Apple/Motorola/IBM Power architecture found in the Apple Power PC and the IBM RSF/6000 family is in this class, as is the MIPS architecure used by Silicon Graphics and the DEC 64 bit Alpha architecture, which is probably still the best illustration of the leading edge of computer architecture.

The Hawk architecture deliberately incorporates a few elements of older methodology, and as a result, those who have learned the Hawk architecture should not be surprised by elements of other architectures.

What Is Assembly Language?

Most high level languages do their best to hide the architecture from the users. Users of Ada and Pascal, for example, cannot even determine, from within the bounds of the standard language, whether the machine has bytes within its words or how many bits are allocated for basic type within the languag! Languages like C are at a lower level, exposing the programmer to some architecture details such as the sizes of bytes and words, but they still hide many details.

Assembly languages completely expose the computer architecture to the programmer, providing a convenient textual way for expressing programs for the machine while doing nothing to hide the hardware from the programmer. This is why assembly language is almost universally used to teach elementary computer architecture.

Assembly languages went through a great burst of creative development in the 1960's, but by the 1970's, it was clear that the majority of programmers would rarely need to know much assembly language. Today, assembly language is primarly used as the target language for compilers. Thus, while most systems include assemblers, the code they assemble is written by other programs and not by humans. As a result, many modern assembly languages are not as well developed as the assembly languages of the mid 1970's.

It is worth noting that, while computer architectures are best studied at the assembly language level, assembly languages have only loose connections to the architectures they support. There are historically important examples of the use of assemblers designed to support one machine to assemble code for a completely different computer architecture. For example, all of the early code development for the DEC PDP-11 computer, a machine with a 16 bit word, was done on DEC PDP-10 computers, machines with 36 bit words, using DEC's MACRO-10 assembler for the PDP-10.

What Assembly Language Will We Study?

We will be using the SMAL assembly language. SMAL stands, creatively, for Symbolic Macro Assembly Language (a fact nobody needs to remember) and it is far ritcher than many of the assembly languages used today, particularly those provided with introductory assembly language texts.

SMAL includes well developed macro features and a syntax representative of some of the best assemblers of the 1970's. SMAL itself was developed in the early 1980's, predating the HAWK architecture by over a decade and even slightly predating the widespread recognition of RISC architectures.

Where Next?

Before getting deeply involved in one machine, we will focus on questions of representation. In high level languages, we take for granted that the machine can represent data, whether it is in the form of numbers or text, but at the assembly language level, the programmer must take direct responsibility for all issues of representation. Conversion between number bases and questions of character coding will be at the center of this!