120 likes | 248 Views
Basic Concepts of Assembly Language. Computer Science 210 FALL 2006. General. Language for processor Data structures and program structures are created by directly implementing them on the underlying hardware.
E N D
Basic Concepts of Assembly Language Computer Science 210 FALL 2006
General • Language for processor • Data structures and program structures are created by directly implementing them on the underlying hardware. • Focus on programming microprocessors compatible with the Intel IA-32 processor family
History • IA-32 family began with Intel 80386, continuing to the Pentium 4 • MASM (Macro Assembler) 5.0 • MASM 6.0, in 1992 • MASM 8.0, running under MS-Windows • TASM (Turbo Assembler) 5.0 by Borland • NASM (Netwide Assembler)
Definitions • Assembler: is a utility program that coverts source code programs from assembly language into machine language • Linker: is a utility program that combines individual files created by an assembler into a single executable program • Debugger: a utility that let user to step through a program while it’s running and examine registers and memory
Virtual Machine Concept • L0: A computer execute programs written in its native machine language. Each instruction in this language is simple enough to be executed using a relatively small number of electronic circuits. • L1: New language is constructed that was easier to understand and use by Programmers. • Interpretation: As the L1 program is running, each of its instructions could be decoded and executed by a program written in language L0. The L1 program begins running immediately, but each instruction has to be decoded before it can execute • Translation: The entire L1 program could be converted into an L0 program by an L0 program specifically designed for this purpose. Then the resulting L0 program could be executed directly on the computer hardware
Virtual Machine • Digital Logic: hardware representation • Microarchitecture • Instruction Set Architecture • Operating System • Assembly Language • High-Level Languages
Assembly Language vs. High-level language • Assembly language are close to one-to-one correspondence between symbolic instructions and executable machine codes • High-level language have a one-to-many relationship with assembly language and machine language • Understandability and Maintainability • Portability • The instructions in assembly language may directly match the computer’s architecture or they may be translated during execution by a program inside the processor known as a micro-code interpreter
Why Assembly Language? • Efficiency • Direct access to key machine features essential for implementing low level routines, e.g. OS kernel, devices driver, etc. • Economical for embedded programs, e.g. telephones, automobile fuel, and air-conditioning control system, video cards, sound card, printers, and etc.
Usage of Assembly Language • Early program • Early IBM PC spreadsheet Lotus 123 • Console video games in 1990, NBA Jam 1993 • Some system-dependent task performed by operating system • System BIOS of a computer
Comments • While the modern role of assembly differs greatly from the past in that most software developers do not use assembly coding for entire projects anymore, it is still a very valuable tool to use when writing frequently-accessed components of an application or an operating system • “Some people [say] that having machine language, at all, was the great mistake that I made. I really don’t think you can write a book for serious computer programmers unless you are able to discuss low-level detail” - Donald Knuth, The Art of Computer Programming