Index to Introduction to Computing Systems

Index



Symbols and Numbers | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V |W | X | Y | Z

Symbols and Numbers

! negation operator, 261, 262, 268
!= inequality operator, 262, 263, 268, 304
' ' (single quotes)
      versus double quotes, 381
      for single characters, 381
      surrounding ASCII literals, 244, 491
" " (double quotes)
      around a filename, 235
      enclosing string literals, 381, 491
      versus single quotes, 381
      using with #include, 235
# (pound sign), 142, 228
% (modulus operator), 258, 268
% (percentage symbol), conversion specifications for printf and scanf, 236, 397, 398
%= operator, 265
( ) function call operator, 270
( ) (parentheses)
      enclosing arguments, 316
      overriding evaluation rules, 259
      surrounding the condition of an if statement, 276
{ } (curly braces)
      associating statements, 281
      enclosing a function body, 316
      enclosing blocks, 256
      indicating compound statements, 276
      surrounding statements with, 503
} (closed brace character), 242, 243
{ (open brace character), 242, 243
* (asterisk), for declaring a pointer variable, 367, 368, 496
* indirection (deference) operator, 268, 368-370, 374
* multiplication operator, 255, 257, 258, 268
*/, ending comments in C, 233, 490
*= operator, 265, 268
+ addition operator, 241, 257, 258, 268
++ operator, 263, 264, 268
      postfix form, 265, 268
      prefix form, 265, 268
+= operator, 265, 268
- (minus sign), indicating a negative value in literals, 490
- subtraction operator, 257, 258, 268
-- operator, 263, 264
      postfix form, 265, 268
      prefix form, 265, 268
-= operator, 265, 268
-> operator, 268
, (commas), separating declarations in C, 295
. operator, 268, 412
; (semicolons). see semicolons (;)
/ (forward slash), division operator, 257, 258, 268
/*, beginning comments in C, 233, 490
/= operator, 265
< relational operator, 263, 268
> relational operator, 263
< > (angle brackets) around a filename, 234-235
<< left shift operator, 260, 261, 268
>> right shift operator, 260, 261, 268
<= relational operator, 263, 268
<<= operator, 265
>= relational operator, 263, 268
>>= operator, 265
= (equal sign)
      assignment operator, 241, 256-257, 265, 268, 277, 278, 304, 499
      assignment operator symbol, 256
      difference between equals in mathematics, 257
      specifying an initializer, 295
= operator, 268
= = equality relational operator, 262, 263, 268
? (question mark), part of the conditional operator, 266, 268
[ ] (brackets)
      indicating an array declaration, 375
      indicating an optional portion of a declaration, 295
      precedence of, 268
\ (backslash)
      beginning special characters, 236, 398
      indicating an optional portion of a declaration, 398
      with printf statements, 236
^ bitwise operator, 261, 268
^ (XOR) operator in C, 259
^= operator, 265
_ (underscore character), 247
|, bitwise OR operator, 259, 261, 268
||, OR logical operator in C, 261, 262
~ bitwise not operator, 259, 261, 268
& address operator in C, 268, 368-369, 374
      emulating call by reference, 370-372
      for use in scanf, 237, 238
& bitwise AND operator in C, 259, 261, 268
&= operator, 265
&& operator, 261, 262, 268
\0, for terminating character strings, 380, 381, 397
0 (zero), 17, 18, 490
0x, preceding hexadecimal constants, 249, 259, 490
1 (one), as a bit, 17, 18
1's complement integers, 20, 21
2 ²-by-3 bit memory, 65-67
2-to-1 mux, 57
2+3=e, 210, 214-215
2's complement integers, 18, 20, 21-23
      addition of, 26-27
      arithmetic on, 25-28
      conversion of, 210, 211-214, 214-215
      converting from decimal to, 24
      converting to ASCII, 126
      converting to decimal, 23-24
      overflow of, 27-28
      positional notation with, 19
4-bit register, 63
4-input mux, 58
64-bit addressable memory, 65
8086 ISA, 451
Back to top

A

abacus, 6
abstract data type, 196
activation record
      allocating at run-time on a stack, 320-322
      for a function with a local variable of structure type, 409, 411
      layout of a, 319, 320
      popping off of the stack, 322, 323, 325, 326
      pushing on top the run-time stack, 320
      return address in, 320, 324-325
ADD instruction. see also operate instructions
      example of, 100, 104
      Intel IA-32, 84
      LC-2, 81, 83-84, 96, 432, 433
      LC-2 opcode for, 454
      operands required for, 142
      performing on a stack machine, 202
      on a three address machine, 201
      on a zero-address machine, 201
Add program, 130-131
adding machines, 6
addition
      of 2's complement integers, 25, 26-27
      of floating point values, 258
      of integers, 258
      subroutine for, 203, 204-207
addition (+) operator, 241, 257, 258, 268
address control logic, 481, 482
address decoder, 66
address of a memory location, 64
address operator (&) in C, 268, 368-369, 374
      emulating call by reference, 370-372
      for use in scanf, 237, 238
address override prefix, 462, 463
address space
      in current computers, 76
      of the LC-2, 76, 92
      of memory, 64
addressability
      in current computers, 76
      of the LC-2, 76, 92
      of memory, 64-65
addresses, symbolic, 148
addressing mode calculation, 464-465
addressing modes
      example of, 99-101
      for JSR, 183
      for JSRR, 183
      in the LDR instruction, 81
      of the operand specifier, 98
      specified by the ISA, 11, 95
      supported by the LC-2, 95
      types of, 98-99
adds, for multiplication, 207
aggregate data types. see structures
algorithmic errors, 336, 339
algorithms, 10
      adding 12 integers, 102-104
      binary search, 349-350
      conducting arithmetic operations, 203-210
      counting occurrences of a character, 107-110
      initialization of, 126
      recursive, 348
      using a sentinel for loop control, 105-106
Alpha 21264 microprocessor, 47
Alpha ISA, 11, 12
ALU
      adding integers, 21-23
      in the LC-2, 77, 112
      in the Von Neumann model, 77-78
ambiguity in natural languages, 9-10
American National Standards Institute (ANSI), 228
analog calculating machines, 6
AND function, 29
AND gates, 52-53
      in a 2-to-1 mux, 57
      example of, 53
      in full adder circuits, 58-59
      symbol for, 54
      three-input, 55
AND instruction of the LC-2 ISA, 96, 432, 434
angle brackets (< >), 234-235
ANSI (American National Standards Institute), 228
ANSI C, 228
      compilers, 381
      standard library, 509-512
ANY operation, 30, 31
application-visible registers of the IA-32 ISA, 459-460
arcs in a state machine, 473, 474
arguments, 317
      in functions, 315
      one-to-one correspondence with conversion specifications, 401
      passing by reference in scanf, 399
      passing to a function, 366, 370, 372
      transmitting a function, 316
      variable lists, 401-402
arithmetic
      on 2's complement integers, 25-28
      data types for, 210
      processing using stacks, 201-210
      saturating, 454
Arithmetic and Logic Unit. see ALU
arithmetic expressions, order of evaluation, 257, 258-259
arithmetic operators, 95
      in C, 258, 500
      combining with assignment operators, 265
      precedence of, 268
arrays, 365, 374-388
      allocating with extra space, 388
      base address of, 495
      in C, 496
      common pitfalls in C, 387-388
      compared to linked lists, 417
      creating strings, 380
      declaring, 375-376
      examples using, 376-379
      exceeding the bounds of, 387
      individually assigning the elements of, 381
      mimicking dynamically-sized arrays using malloc, 417
      naming in C, 379
      as parameters, 379-380, 381
      passing by reference, 379
      precedence of array operators, 268, 502
      reassignment of, 384
      relationship with pointers, 383-384
      sorting sequences of numbers stored in, 385-387
      with structures, 411-413
ASCII characters
      inputting and outputting in C, 235-238, 400
      inputting and outputting on the LC-2, 79, 160-165
ASCII codes, 18, 36, 514
      converting characters to, 107, 109
      converting from 2's complement binary integers, 126, 214-215
      converting to 2's complement binary integers, 210, 211-214
      converting to, from binary, 145-146
      functions converting integers to, 358-359, 360
      initializing with zero-extended, 144-145
      for interaction with input and output devices, 210
      for new lines, 164, 165
      table of, 514
ASCII data files, reading and writing in C, 402-404
ASCII keystrokes, converting to integers, 237
ASCII literals, 244
ASCII to binary conversion, 212, 213-214
assemble command, 147
assembler, 12, 141. see also LC-2 assembler
assembler directives, 141, 144-145, 228
assembly language, 11, 139-151
      example program, 140-149
      instructions in, 141-144
      program counting occurrences of a character, 146
      simplifying programming for the LC-2, 224
      translation process, 12, 147-149
asserted signals, 56
assertions, 340-341
assignment operator (=), 241, 256-257, 265, 268, 277, 278, 304, 499
associativity of operators in C, 258, 259
asterisk (*), for declaring a pointer variable, 367, 368, 496
asynchronous transfer, 159
attributes of variables in C, 242, 243
automatic storage class for variables, 243, 247, 248, 495
Back to top

B

%b specification, 397
backslash (\)
      beginning special characters, 236, 398
      indicating an optional portion of a declaration, 398
      with printf statements, 236
base 16, 36-38
base case in recursion, 351
BASE+offset addressing mode, 85, 99
      in the DECODE phase, 113
      as in the LDR instruction, 81
binary adder, truth table for, 58, 68
binary ALU, addition performed by, 21-23
binary digits. see bits
binary functions, 25, 32
binary notation, 18
binary operations, 96
binary operators, 260
binary search, 349-350
binary strings, 21, 36-38
binary to ASCII conversion, 145-146, 214-215
binary to decimal conversion, 23-24
bit numbering of the LC-2 ISA, 429
bit patterns, interpreting, 56
bits, 17-18
      flipping, 22
      formula for distinguishing distinct items, 18
      operations on, 25-32
      pattern of, 243
      representing unsigned integers as, 19
      shifting to the left, 26
      shorthand notation for a sequence of, 63
      storing, 62-63
bitwise AND operation, 29
bitwise complement instruction of the LC-2 ISA, 442
bitwise logical AND instruction of the LC-2 ISA, 434
bitwise operators, 259-260, 261, 265, 268, 500
black box models, 7
blank lines, 143, 233
.BLKW, 144
blocks, 296, 503
      in C, 242
      forming, 256
      in if statements, 276
      placing declarations in, 498
      variables declared in, 247
      variables declared outside of, 247
body of a loop, 104
bookkeeping information, within the activation record, 319
bounds, exceeding in an array, 387
BR instruction of the LC-2 ISA, 432, 435
brackets [ ]
      indicating an array declaration, 375
      indicating an optional portion of a declaration, 295
      precedence of, 268
break statements, 284, 294-295, 507-508
breakpoints
      conditional, 341
      in debugging, 341, 342
      setting, 128
      tracing with, 129, 130
brute-force testing, using permutations, 339
BRx instruction, 101
buffered I/O, 395-397, 509
buffers, 396
      flushing I/O in C, 509
      for I/O streams, 396
bugs, 119, 335. see also errors
      detecting, 339-342
      finding, 335, 339-342
      safeguards against, 226
      types of, 336-339
bus, 110-112
BUSYNESS example, 31-32
busyness of a set of machines, 333-334
byte-addressable memory, 64-65, 457
Back to top

C

C compiler, 228, 268, 270
C conditional expression, 266-267, 501
.c extension for C source files, 489
C header files, 234, 489-490
C I/0, 235-238
C operators, 370, 499-502
C preprocessor, 228, 229, 233-235
C processor, macro substitution, 301
C programming examples. see also programs
      calculating factorial, 314
      calculating the sum of two 10 element vectors, 376-377
      for a calculator, 285
      computing the area and circumference of a circle, 253
      converting all the lowercase letters to uppercase, 466-469
      converting francs and yen into dollars, 317, 318
      determining the number of days in a month, 281
      determining the number of repeated values in an input sequence, 378-379
      echoing a number typed at the keyboard, 243
      network rate calculation, 263, 264
      performing simple operators on integers, 268-270
      using a conditional expression, 266, 267
      using a function to print a banner message, 313
C programming language, 10
      assignment operator, 256
      conditional expressions in, 266-267
      control flow in, 503-508
      conventions of, 489-492
      development of, 227-228
      do-while statement, 292-294
      expressions in, 503
      as a free format language, 233
      functions, 311-329
      I/O in, 393-404
      if statement, 263
      keywords, 247, 492
      library functions, 509-512
      logical operators, 262
      mistakes, common, 277-278
      naming conventions, 247
      precedence of special operators, 265
      problem solving with, 296-304
      relational operators, 262
      sorting program, 385-387
      special operators of, 263-267
      statements, 256, 503
      strings in, 380-383
.c source files, 228, 234, 489
%c specification, 397, 398
C standard library, 393-394, 509-512
      dynamic allocation handled by functions, 415
      prewritten functions for strings, 383
calculating machines, 6
call by reference, 372
callee function, 322, 324, 325
callee-save, 180, 201
caller function, 322, 325-326
caller-save, 180, 199, 200, 201
calloc function, 416
carry, ignoring in 2's complement arithmetic, 22-23
carry flag of IA-32, 461
case keyword, 283-284
case sensitivity in C identifiers, 492
cast (type) operator, 268
CD-ROM, 3
central processing unit (CPU), 3
CF flag of IA-32, 461
char data type, 244, 245, 493, 494
character arrays, 380-383, 510
character codes, 36
character count program
      in assembly language, 145-147
      C version of, 384-385
      object files in, 151
      systematic decomposition, 123-126
character input
      from the keyboard, 160
      service routine, 175, 177-179
      TRAP service routine for, 184-186
character literal, 491
character output service routine, 173, 178-179
character strings, 186, 381
characters
      in C, 491
      converting lowercase to uppercase, 327-329
      counting occurrences of, 107-110, 145-147, 301-304
      as data types in C, 244
      echoing on the monitor, 163
      inputting from a keyboard, 107
      as read by the computer, 159
      transferring to monitor, 162-163
circuit packages, integrated, 3, 4
circuits
      CMOS, 49
      full adder, 57-60
      N-type transistor in, 48
      P-type transistors in, 49
      transistor, 49-55
clearing
      the leading bit, 32
      an R-S latch, 61
clock, 86, 179
clock cycles, 471, 472-473
closed circuits, MOS transistors and, 48, 49
closing brace character ( } ) in a block, 242, 243
CMOS circuits, 49
CMOS inverter, 50, 54. see also NOT gates
COBOL, 10
coin holder, as example of a stack, 196
combinational logic structures, 55-60
commands for debugging, 128
commas, separating declarations in C, 295
comments, 143, 233, 490
compilation, 226-230
compiled program, 226
compilers, 226-230, 381. see also LC-2 C compiler
complement operation, 30
complementary metal oxide semiconductor, 49
compound statements, 296
      forming, 256
      in if-else statements, 279
      in if statements, 276
computation, 7, 254
computer design, 12
computer programs. see programs
computer systems, 3, 5
computers, 2, 3, 5
      components of, 3
      electrons working inside of, 8
      stopping, 85-86
      TRAP routine for halting, 179, 181
      as universal computational devices, 6-8
condition codes, 95, 101-102, 429
condition construct, 125, 126
conditional branch instruction, 101-104
      example of, 103, 104
      format of, 101
      of the LC-2 ISA, 435
conditional breakpoints, 341
conditional constructs, 262, 276-285
      connecting together, 281
      in systematic decomposition, 120, 121, 122
conditional decomposition, 121-122
conditional expressions in C, 266-267, 501
const qualifier, 253, 254, 495
constants, 253-254
      combined with operators, 255
      in operands, 142
      special region of memory reserved for, 401
      symbolic, 234
      types of, 254
constructs, 275, 276-285. see also iteration constructs
      conditional, 120-122, 262, 276-285
      control, 296
      counter-controlled iteration, 297
      high-level programming, 224
      sequential, 120-122, 124, 126, 275
continue statement, 294-295, 508
control characters, 164
control constructs, 296
control flow errors, 337, 340, 342
control instructions, 84
      of the IA-32 ISA, 456
      in the LC-2, 93, 100-107, 121-122
control opcodes, 454, 455
control signals
      additional logic required to provide, 480
      in the clock cycle, 472-473
      in the data path of the LC-2, 475, 477
      for the microsequencer, 478
      specifying the state of the control structure of the LC-2 microarchitecture, 473
      used by hardware, 202
control store, 475, 477, 486-487
control structures, 225, 275-304
      for LC-2, 475, 477-481
      of a microprogrammed implementation, 478
control unit, 78-79, 82-84
conversion specifications, 398, 513
conversions
      binary to decimal, 23-24
      of data types, 210-215
      decimal to binary, 24-25
counter-controlled loops, 105, 291
CPU (central processing unit), 3
CRT, 162
CRTDR register, 79, 162, 164
CRTSR register, 79, 162, 163, 164
crystal oscillator, 86
curly braces ( { } )
      associating statements, 281
      enclosing a function body, 316
      enclosing blocks, 256
      indicating compound statements, 276
      surrounding statements with, 503
      cycle time of a microprocessor, 471
Back to top

D

%d specification, 235-238, 397-399, 510
data movement instructions, 84. see also LDR instruction
      of the IA-32 ISA, 456
      of the LC-2, 93, 97-101
data movement opcodes, 454, 455, 456
data path, 471, 472
      arrows in, 110
      control signals for, 477
      of the LC-2, 67-68, 110-114, 475, 476-477, 484
data registers, 79, 171
data segment descriptors, 461
data structures, 407-425
data types, 18, 19, 210
      2's complement integers, 21-23
      abstract, 196
      in C, 244, 493
      conversion of, 210-215
      floating point data type, 32-36
      integer, 19-21
      of LC-2 compared to IA-32, 452-454
      Signed-Magnitude, 20
      specified by the ISA, 11, 93, 95
dbx, 127
debuggers
      interactive, 128-135, 341-342
      source-level, 335, 341-342
debugging, 119, 335-342
      ad-hoc techniques for, 340-341
      commands for, 128, 341-342
      techniques of, 339-342
decimal integers, converting 2's complement to, 23-24
decimal to binary conversion, 24-25
decision elements, 55-56
declarations, 295
      of arrays, 375-376, 388
      of the character type, 244
      of the double type, 245
      of functions, 232, 315, 317
      of the integer type, 244
      of variables, 242, 248-250
DECODE phase, 83, 101, 113
decoders, 56
decrement (postfix) operator, 265
decrement (prefix) operator, 265
default case in a switch statement, 284
#define directive, 233, 235, 247
      constant, created by, 254
      creating fixed values within a program, 234
      replacing occurrences of text, 234
definiteness of an algorithm, 10
delay loop, 396
DeMorgan's law, 54-55
dereferencing pointer operator, 268, 368-370, 374
derived types in C, 495-496
destination operand, 81
deterministic system, 1
device registers, 157-158
      assignments of the LC-2 ISA, 430
      mapping, 158
      output, 162
      reading, 160
DF flag of IA-32, 461
digital calculating machines, 6
Digital Equipment Corporation's PDP-8, 158
digital logic structures, 47-68
direct addressing mode, 98, 100
direction flag of IA-32, 461
directives, 228. see also pseudo-ops
disks, 3
displacement in IA-32 instructions, 464-465
division of integers in C, 258
division operator, 257, 258, 268
DLLs (dynamically linked libraries), 394
do-while statement, 292-294, 507
dot-c files, 228, 234, 489
double, format specifications for, 317
double data type, 245, 493
double quotes (" ")
      around a filename, 235
      enclosing string literals, 381, 491
      versus single quotes, 381
      using with #include, 235
DR control field in the STORE RESULT phase, 114
dynamic link, 320
dynamic memory allocation, 388, 407, 413-416
dynamically linked libraries (DLLs), 394
Back to top

E

effective computability of an algorithm, 10
electrical circuits, 47-48
electrons, 8, 17
else statement, 281
.END, 145
end-of-string character (\0), 380, 381, 397
enumerated types, 493
enumeration constants, 493
EOF preprocessor macro, 404
EOT (end of text) character, 126
equal sign (=)
      assignment operator, 241, 256-257, 265, 268, 277, 278, 304, 499
      assignment operator symbol, 256
      difference between equals in mathematics, 257
      specifying an initializer, 295
equality (==) relational operator, 262, 263, 268
equations, recurrence, 348, 354
error checking, 282, 415, 416
error checks, 340, 341
error messages, produced by high-level languages, 226
errors. see also bugs
      classification of, 336-339
      examples of, 128-135
      syntax of, 336-337
      triggering with a set of inputs, 336, 337
EVALUATE ADDRESS phase
      of a conditional branch instruction, 101, 102
      of an instruction cycle, 83, 113
evaluation of operators, 257, 258-259
exclusive-OR function, 31
executable image, 150, 228
      binary module that executes, 189, 190
      constructing from multiple object files, 151, 190, 191
      linking, 230
      as output of the compilation process, 229
      region of memory for, 252
EXECUTE phase
      of a conditional branch instruction, 101
      of an instruction cycle, 84, 113
      loading the PC during, 85
execution, changing the sequence of, 84-85
exit library call, 421
exponent field, 33, 245
exponential notation, 491
expressions
      in C, 255-256, 503
      complex, 267
      conditional, 501
      constructing mixed types, 257
      containing the assignment operator, 257
      forming in C, 255-256
      order of evaluation, 257, 258-259
      promoting, 257
      in statements, 296
      terminated by a semicolon, 503
expressiveness of high-level languages, 225
extern qualifier, 495
external event, requesting an interrupt, 482
.EXTERNAL pseudo-op, 189, 190
Back to top

F

%f specification, 397, 398
FETCH OPERANDS phase of an instruction cycle, 83-84
FETCH phase
      of a conditional branch instruction, 101
      of an instruction cycle, 82-83, 113
Fibonacci numbers, 354-358
file I/O, 402-404. see also I/O
file pointers, 402-404
filename, 234-235
.FILL, 144
finiteness of an algorithm, 10
flags, 159, 460-461
FLAGS register of IA-32, 460-461
float data type, 33, 245, 246, 493
Floating Point Arithmetic, IEEE Standard for, 33, 35, 246
floating point literals, 245, 490-491
floating point number, precision of a, 246
floating point opcodes in IA-32, 454
floating-point variable, single-precision, 246
flushing output, 396-397
fopen call, 402-403
for loops, 232
      common error of, 290
      components of, 289
      constructing using a while loop, 290-291
      containing a nested loop, 379
      indentation of, 290
      LC-2 translations of, 290
for statement, 288-292, 506
formal parameter list, 316, 317
format specifications
      with function printf, 235, 236, 237
      with function scanf, 237, 382, 383
format strings, 397
      for printf, 235
      for scanf, 237, 399
formatted I/O, performed by printf and scanf, 397-402
formatting of programs, 233, 492
Fortran, 10
forward slash (/), 257, 258, 268
fprintf function, 393, 402, 403
fractions in the floating point data type, 33
free-format language, C programming language as, 233
free function, 416, 421, 511
fscanf function, 393, 402, 403, 404
full adder circuits, 57-60
function activation record, return address in a, 320, 324-325
function call ( ) operator, 270
function calls, 311, 315, 316, 317
      LC-2 code for, 326
      signaling a problem during, 372, 373
      simplest form of, 313
      translating, 323
function declarations in C, 498
function definitions in C, 232
function fprintf, 393, 402, 403
function free, 416, 421, 511
function fscanf, 393, 402, 403, 404
function getchar, 303-304, 393, 394, 395, 509
function main, 232-233, 312, 314, 315
      activation record of, 321
      checking the return value in debugging, 372, 373
function malloc, 415, 511
      allocating memory on the heap, 421
      error checking the return value from, 415, 416
      mimicking dynamically-sized arrays, 417
function printf, 235, 397-398, 510
      in the C standard library, 393
      calling, 313
      compared to function scanf, 399
      containing \t sequence, 291
      conversion specifications, 513
      displaying values, 237
      general-purpose version of, 402
      a variable number of arguments passing to, 401
function prototype. see declarations
function putchar, 394-395, 509
      in the C standard library, 393
      causing output to be flushed, 396-397
      output function, 359, 360
function rand, 511-512
function realloc, 416
function scanf, 237-238, 373, 399-401, 509-510
      in the C standard library, 393
      compared to function printf, 399
      conversion specifications, 513
      general-purpose version of, 402
      passing a variable number of arguments to, 401
      reading an input string from the keyboard, 382-383
      reading ASCII characters, 400
function srand, 511-512
function strcmp, 510
function strcpy, 510
functions, 311, 314. see also subroutines
      AND, 29
      activation record for, 318-320
      binary, 25, 32
      body of, 316
      in C, 232, 311-329
      calling, 317
      declaration of, 315
      library, 235
      math, 511
      naming, 315
      output of, 317
      parameters for, 315
      recursive, 347, 348, 350, 358-359, 360
      returning pointer values, 373
      returning values, 315
      string, 510
Back to top

G

gate-level descriptions of a full adder, 59
gated D latch, 62, 63
general purpose registers. see GPRs (general purpose registers)
getchar function, 303-304, 393, 394, 395, 509
global bus of the LC-2 data path, 110-112
global data section, 250-251
      allocating variables in, 413
      region of memory for, 252
global variables, 243, 247, 248
      allocating in structures, 409
      storage of, 250-251
GPRs (general purpose registers)
      condition codes and, 95
      of the LC-2 ISA, 92, 429
      moving information between memory and, 97-101
graphic images, preprocessing routines for, 190
graphical user interface (GUI) in debuggers, 341
Back to top

H

.h extension for C header files, 489
HALT instruction, 86, 128, 179
halt service routine for the LC-2, 180, 181
halting the machine banner, 179, 181, 186
handshaking mechanism, 159
hardware stack, 196-197
header files
      in C, 234, 489-490
      of the C standard library, 394
      for I/O functions, 394
heap, 413-414
hexadecimal constants, preceding with 0x, 249, 259, 490
hexadecimal notation, 36-38
high-level languages, 11, 139-140
      advantages of, 224-226
      translating, 11-12, 226-227
Back to top

I

I/O, 157-167. see also file I/O; input
      buffered, 395-397, 509
      in C, 393-404
      conversion specifications for C, 513
      from files, 402-404
      interrupt-driven, 165-167
      memory-mapped in the LC-2, 429, 481, 482
      performing from a C program, 235-238
      processor-controlled, 160-166
      speed compared to a processor, 158-160
      streams, 394
      TRAP routines for handling, 177-179
I/O devices, 157-158, 167
I/O functions, 394, 509-510
IA-32, 11
      application-visible registers for, 459-460
      compared to LC-2, 451-469
      data movement opcodes, 455
      data types, 452-453
      FLAGS register, 460-461
      instruction pointer, 460
      instructions set, 452, 462-466
      memory of, 457-458
      microprocessors implementing, 12
      opcodes for, 454-455
      system registers, 460
      as a two-address ISA, 456
identifiers in C, 246-247, 492
IE (Interrupt Enable) bits, 166, 167
IEEE Standard for Floating Point Arithmetic, 33, 35, 246
if-else statement, 278-282
      in C, 504
      compound statements in, 279
      error checking with, 282
      LC-2 code for, 280
IF flag of IA-32, 461
if statement, 263, 276-278
      associating with an else statement, 281
      in C, 503-504
      format of, 276
      nesting, 278
immediate operands, 95, 142
immediate values in IA-32 instructions, 465-466
IN trap routines, 235
#include directive, 233, 234, 235
inclusive-OR function, 30, 31
increment (postfix) operator in C, 265
increment (prefix) operator in C, 265
indentation
      of an if statement, 276
      of for loops, 290
      style for C, 233
index of arrays, 376
indirect mode addressing, 99
indirection (deference) * operator, 268, 368-370, 374
inequality (!=) operator, 262, 263, 268, 304
infinite loops, 135, 288
infinite series, 297
information storage, logic structures involving, 60-63
init component of the for statement, 288, 289
initialization, 126
      in C, 244, 248, 295
      of variables, 107, 124, 248
initializer, 244, 248, 295
input. see also I/O
      accomplished by LC-2, 79, 481
      buffered, 395
      in the LC-2, 79
      one character at a time, 394
      routines for, 163-165
input activity, synchronous, 159
input and output instructions, 158
input device registers, 158
input devices in the Von Neumann model, 78
input/output. see I/O
input parameters. see parameters
input service routine, 160-161
inputs, triggering errors with, 336, 337
instruction cycle, 82-84
      changing the sequence of, 84-85
      for conditional branch instruction, 101-102
      phases of, 167
      stopping, 85-86
      through the LC-2 data path, 113-114
instruction flow, changing, 101, 102
instruction pointer (IP) of IA-32, 460
instruction processing as part of the Von Neumann model, 79-84
instruction register (IR), 79, 82, 113
instruction set
      formats for LC-2, 94
      LC-2 compared with IA-32, 452-457
      specified by the ISA, 93
Instruction Set Architecture. see ISA (Instruction Set Architecture)
instructions, 80-84
      assembling, 149
      in assembly language, 141-144
      for data movement, 97-101
      executing, 84, 128
      formats in LC-2, 430, 432
      for IA-32, 462-466
      identifying I/O, 158
      speed of execution, 158-160
      types of, 84-85
      zero-operand, 174
int data type, 244, 246, 493
integer arrays, 376
integer data types, 19-21
integers
      adding in LC-2, 258
      algorithm for adding 12, 102-104
      calculating the maximum of two, 266, 267
      converting to ASCII, 358-359
      dividing, 258
      extending the size of, 454
      literal constants in C, 490
      performing simple operations on, 268-270
integral types, 493
integrated circuit packages, 3, 4
Intel ISAs, 451
interactive debuggers, 128-135, 341-342
internal state of LC-2 compared to IA-32, 459
interpreters, 226-227
interrupt control of LC-2, 481-486
interrupt-driven I/O, 160, 165-167
Interrupt Enable (IE) bits, 166, 167
interrupt flag of IA-32, 461
interrupt mechanism of LC-2, 480
interrupt service routine, 485
interrupt signal, 166-167
interrupt vector, 485
Interrupt Vector Table, 173
interrupts
      initiating, 482-483, 485
      returning from, 485
      testing for, 167
inverters, 50, 54
IP (instruction pointer) of IA-32, 460
IR (instruction register), 79, 82, 113
ISA (Instruction Set Architecture), 91-92
      Alpha, 11, 12
      assembly language of, 140
      components of, 471, 472
      device registers in, 158
      of the LC-2, 91-110, 429-449, 451
      microarchitecture and, 12
      PA-RISC, 11
      PowerPC, 11
      SPARC, 11
      support of data types, 95
      as a transformation process level, 11-12
      types in use today, 11
      word length of, 78
ISA of the IA-32. see IA-32
iteration constructs, 285-295. see also constructs
      in C, 275
      differences between various types in C, 294
      do-while statement, 292-294, 507
      example, 124, 126
      for statement, 288-292, 506
      in systematic decomposition, 120, 122
      while statement, 286-288, 506
iteration control, sentinel method for, 107, 110
iterations, 104, 107
Back to top

J

JMP instruction, 183, 436
JMPR instruction, 85, 183-184, 437
JSR instruction, 182, 183
      compared to the TRAP instruction, 182
      initiating the callee function, 323
      of the LC-2 ISA, 432, 436
JSR pop, executing, 201
JSR/RET mechanism, 182, 184
JSRR instruction, 183-184, 432, 437
JuMP, 183, 436
Jump, Base+Offset of the LC-2 ISA, 437
Jump to SubRoutine. see JSR instruction
Back to top

K

KBDR (keyboard data register), 79, 160, 161
KBSR (keyboard status register), 79, 160-161
keyboard, 3
      buffering of the input stream, 396
      device registers for, 160, 161
      echo, 163
      getting a string from, 382-383
      input from, 107, 160-161
      interacting with the processor, 160-161
      registers required for, 79
      status registers for, 171
keyboard data register (KBDR), 79, 160, 161
keyboard input service routine, 173, 184-186
keyboard keys, ASCII codes for, 36
keyboard status register (KBSR), 79, 160-161
keywords in C, 247, 492
Back to top

L

labels
      identifying, 148
      matching in a switch statement, 283, 284
      for memory locations, 142-143
Last In, First Out (LIFO), 195, 196
latches
      gated D, 62, 63
      R-S latch, 61-62
      RUN, 86, 179
LC-2
      addressing modes supported by, 95
      assembly language example, 140-147
      compared to IA-32, 451-469
      condition codes, 95
      control instructions, 100-107, 121-122
      CRTDR assigned, 162
      CRTSR assigned, 162
      data movement instructions, 455
      data path, 67-68, 110, 111-112, 475, 476-477, 484
      data types, 95, 452
      as an example of the Von Neumann model, 79, 80
      halt service routine for, 180, 181
      instruction formats for, 94
      instructions, 81, 430, 432-449, 462
      ISA of, 91-110, 429-449
      memory organization, 92, 429, 457
      microarchitecture, 471-487
      microsequencer, 479
      opcodes, 183, 454, 454-455
      operate instructions, 95-96, 454
      service routines, 173
      state machine for, 473-474
      state machine showing interrupt control, 483
      structures needed to implement the ISA of, 110-114
      System Control Block of, 173
      system registers, 460
      as a three-address ISA, 201, 455-456
      TRAP routines, 171-181
      word length, 78
LC-2 assembler, 141, 144. see also assembler
      as an example of a compiler, 227
      pseudo-ops, 144-145
      translating assembly language programs, 147-148, 149
LC-2 C compiler, 228, 268, 270. see also compilers
LC-2 device registers, 158
LC-2 simulator
      debugging interactively, 127-135
      as a form of interpreter, 227
LD instruction, 98
      compared to LDI, 99
      of the LC-2 ISA, 432, 438
LDI instruction, 99
      example of, 100-101
      of the LC-2 ISA, 432, 439
      loading the memory-mapped address of KBSR, 161
LDR instruction, 83, 99. see also data movement instructions
      identifying in the DECODE phase, 113
      for LC-2, 81, 84, 432, 440
LEA instruction
      example of, 100
      immediate modes with, 98
      of the LC-2 ISA, 432, 441
leading bit, clearing, 32
left shift (<<) operator, 260, 261, 268
less than or equal (< =) relational operator, 263
less than (<) relational operator, 263, 268
Levels of Transformation, 8-13
libraries, 182, 394
library call, 421
library functions, 187-191, 230, 235, 311, 509-512
library objects, 230
library routines, 187-191, 230
LIFO (Last In, First Out), 195, 196
Lightbulb icons, xv
standard file, 494
line breaks with printf statements, 236
line number, adding to a program, 140
link of the JSR instruction, 183
link time, 151
linked lists, 416-424
linker, 151, 229, 230
      linking library routines to executable images, 230
      producing an executable image, 190, 191
LISP, 11
literal constants, 254
literal operands, 95
literal values. see constants
literals, 254
      ASCII, 244
      in C, 254, 490-491
      floating point, 245, 490-491
      hexadecimal values, 249
Little Computer. see LC-2
load base + index instruction of the LC-2 ISA, 440
Load Effective Address instruction. see LEA instruction
load indirect instruction of the LC-2 ISA. see LDI instruction
load-store ISA, 457
local variables, 247-248, 320
      in the activation record, 319
      in an if-else statement, 279
      storage of, 251
locations. see memory locations
lock and repeat prefix of IA-32, 462, 463
logic circuits
      building for any truth table, 60
      combinational, 55-60
      designing to add two integers, 21
      implementing, 12
      storage elements, 60-63
logic functions, 29-31
logic gates, 49-55, 60, 223
logical completeness, 60
logical operations, 29-32, 95
logical operators in C, 260-262, 500
logical variables, 29
logically false values in C, 260-261
logically true values in C, 260-261
long modifier, 246, 494
loop body, statements occurring within, 294
loop control, 104-106, 129-130
loops, 104
low-level languages, 11, 139, 140
Back to top

M

machine cycles, 83, 86
machine independent language, 11
machine language
      example of, 107-110, 150
      generating, 149
      translating high-level languages into, 226-227
machines, programmable, 8
macro substitution, 234, 301
macros, preprocessor, 317, 377, 404
main function. see function main
malloc function. see function malloc
MAR (memory address register), 76-77
      in the LC-2 data path, 112
      in the Von Neumann model, 79
mask, example of, 32
math functions in C, 511
Math Library, 182, 188-189, 191, 511
header file, 511
MDR (memory data register), 76-77
      in the LC-2 data path, 112
      in the Von Neumann model, 79
mechanical languages, 10, 139
megabyte (MB), 76
memory, 3, 64-67
      accessing, 66
      address space of the LC-2 ISA, 429
      addresses, 148, 367
      allocation of, 511
      byte-addressable, 64-65, 457
      contents of, in the Von Neumann model, 79
      in current computers, 76
      deallocation of, 511
      depositing values for debugging, 127, 128
      implementation of a stack, 197-198
      initializing words of, 144-145
      in the LC-2, 112
      LC-2 compared to IA-32, 457-459
      linked list in, 418
      moving information to GPRs, 97-101
      organization specified by the ISA, 92
      organizing storage for a function's local variables, 319
      regions for allocating storage to C variables, 250
      segmentation of, 457
      as a sequence of pages, 92
      taking multiple cycles to read a value, 480
      in the Von Neumann model, 75-77
      word lines of, 66
memory address register. see MAR (memory address register)
memory allocation, dynamic, 388, 407, 413-416
memory allocation functions, 416
memory data register. see MDR (memory data register)
memory locations
      characteristics of, 77
      examining the contents of, 132-133
      identifying, 19, 64
      meaningful symbolic names to, 140
      reading, 66
memory-mapped I/O, 158, 429, 481, 482
memory operands, 142, 457
metal-oxide semiconductor, 47-49, 223
microarchitecture of the LC-2, 471-487
microinstruction, 475, 477
microprocessors, 3, 4, 47, 471
microsequencer, 477, 479
minus sign (-), 257, 258, 268, 490
mixed expressions, 257
MMX instructions, 93, 454
modes for fopen, 402-403
ModR/M byte of IA-32 instructions, 462, 463-464
modular programming, 339-340
modules
      combining multiple at link time, 189-190
      creating executable images, 150
      object, 150, 228, 230
      in programs, 127
modulus operator (%), 258, 268
monitor, 3
      device registers for, 162
      displaying on, 107, 109
      as a standard output device in C, 235
      status register for, 171
MOS transistors, 47-49, 223. see also P-type MOS transistor
mouse, 3
multimedia instructions, 454
multiplexor, 56-57, 58, 68, 266
multiplication
      LC-2 code, 255
      performing as a sequence of adds, 207
      subroutine for, 204, 207, 208-209, 216
multiplication operator (*), 255, 257, 258, 268
mux, 56-57, 58, 68, 266
Back to top

N

N condition code, 101, 106
N (negative) condition register in LC-2, 95
\n (new line character). see new line character (\n)
N-type MOS transistor, 47, 48
      in an AND gate, 52-53
      in a NOR gate, 50, 51
      in a NOT gate, 49-50
      in an OR gate, 52
names, variable, 246-247, 492
naming conventions in C, 247
NAND gates, 52-54
nanoseconds, 83
natural languages, 9-10
negation (!) operator, 261, 262, 268
negative integers, representation of, 19-22
negative results, produced by adding two positive numbers, 28
nested loops, 291, 292, 379
new line character (\n), 236
      ASCII code for, 164, 165, 304
      causing output to be flushed, 396-397
NOR function, 51
NOR gates, 50-52, 54
NOT-AND gates, 52-54
not equal (!=) relational operator, 262, 263, 268, 304
NOT function, 30
NOT gates, 49-50. see also CMOS inverter
NOT instruction of LC-2, 96, 432, 442
NOT logic function, electronic circuit implementing, 50
NOT operator, performing a bitwise NOT, 259
NOT-OR gates, 50-52, 54
null statement, 256
NULL symbol, 415
null-terminated strings, 380
numbers
      adding a column of, using a sentinel, 105-106
      generating random, 511-512
      representing small, 26-27
numerical prefixes, commonly used, 515
Back to top

O

object files, 151
object modules, 150, 228, 230
OF flag of IA-32, 461
opcodes, 56, 80, 81, 93
      in assembly language instructions, 141-142
      data movement, 454, 455, 456
      of IA-32 instructions, 462, 463
      in an instruction set, 452
      LC-2 compared to IA-32, 454-455
      mnemonic devices for, 140
      specified by the ISA, 93
open brace character ( { ) in C, 242, 243
open circuits, 48, 49
OPERAND FETCH phase of an instruction cycle, 113
operand override prefix, 462, 463
operand specifier, 98
operands, 80, 81, 93
      in assembly language instructions, 141-142
      destination, 81
      in an instruction set, 452
      memory, 457
      number required for each instruction, 142
      register, 142
      as specified by the ISA, 11
      specifying the location of, 95
operate instructions, 84, 454. see also ADD instruction
      for the IA-32, 454-455
      for the LC-2, 93, 95-97, 429, 454
operating systems, 85, 86
      invoking a service call, 106, 172, 175, 179
      library routines for, 187-191
      returning control back to the user program, 173
operators, 241, 254-268
      arithmetic, 259, 500
      assignment, 256-257, 499
      binary, 260
      bitwise, 259-260, 500
      in C, 370, 499-502
      combining with operands, 267
      evaluation of, 257, 258-259
      logical, 260-262, 500
      manipulating pointer values, 370
      manipulating variables, 254
      miscellaneous in C, 502
      for pointers, 368-374
      precedence of, 268, 499, 502
      relational, 501
      special, 501
OR function, 30, 31
OR gates, 50-52, 54
OR logical function, circuit implementing, 51-52
OR (||) logical operator in C, 261, 262
.ORIG pseudo-op, 144, 177
output
      accomplished by LC-2, 481
      device registers, 158, 162
      devices, 78, 245
      functions, 235-237, 359, 360
      instructions, 158
      one character at a time, 394
      registers, 162
      routines for, 162-163
      service routine, 162-163
      stream, 394, 396-397
overflow
      of 2's complement integers, 27-28
      flag of IA-32, 461
      of a stack, 200
Back to top

P

P condition code, 101
P (positive) condition register in LC-2, 95
P-type MOS transistor, 47, 49. see also MOS transistors
      in an AND gate, 53
      in a NOR gate, 50, 51
      in a NOT gate, 49-50
      in a OR gate, 52
PA-RISC ISA, 11
packed decimal data types, 452
parameters
      in the activation record, 320
      arrays as, 379-380, 381
      required by a function, 315
parentheses
      enclosing arguments, 316
      overriding evaluation rules, 259
      surrounding the condition of an if statement, 276
Pascal, 11
passes in the assembly process, 147, 148-149
PC. see program counter
PDP-8, I/O instructions used by, 158
Pentium processors, 47, 451
percentage symbol (%), conversion specifications for printf and scanf, 236, 397, 398
permutations, using in brute-force testing, 339
personal computers. see computers
phases of the instruction cycle, 82-84
physical files, declaring file pointers for, 402
pipeline, 89
plus sign (+), addition operator, 241, 257, 258, 268
pointer arithmetic, 496
pointer declaration, 374
pointer values, manipulating, 370
pointer variables
      declaring, 367-368, 374
      dereferencing, 412
      examples using, 370-373
pointers, 107, 365, 366-374
      in C, 496
      operators in C, 502
      reassignment of, 384
      relationship with arrays, 383-384
      with structures, 411-413
      type casting, 415-416
polling for I/O, 160-166
pop operation on the stack
      in activation records, 321-322
      elements from a stack, 196, 198, 201
positional binary notation, 36
positional notation with unsigned integers, 19
positive integers, representation of, 20
positive result, produced by adding two negative numbers, 28
postdecrement operator in C, 264
postfix ++ operator, 265, 268
postfix -- operator, 265, 268
postincrement operator in C, 264
pound sign (#), 142, 228
PowerPC ISA, 11
precedence
      arranging operators in terms of, 258-259
      of operators, 268, 499, 502
Precision Architecture, 93
precision of a floating-point number, 246
predecrement operator in C, 264
predefined types in C, 493
prefix ++ operator, 265, 268
prefix -- operator, 265, 268
prefixes of IA-32 instructions, 462-463
preincrement operator in C, 264
preprocessor, 228, 301
preprocessor directives, 228
      #define, 233, 234, 235, 247, 254
      #include, 233, 234, 235
preprocessor macros, 317, 377, 404
printer, 3
printf function. see function printf
privileged registers, 172
problems
      decomposing, 119-126
      describing in natural language, 9-10
procedures. see functions; subroutines
processing unit in the Von Neumann model, 77-78, 79
processor, 3
processor boards, 3, 4
processor-controlled I/O, 160-166
program counter, 79
      containing the address of the next instruction, 82
      incrementing, 82-83
      in the LC-2 data path, 112
      as specified by the LC-2 ISA, 429, 460
programmable machines, 8
programming, 119-135, 139-140
programming languages
      high-level, 224-226
      as a level of transformation, 10-11
      types of, 11
programming tasks, 312-313, 347
programs. see also C programming examples; user programs
      changing the flow of, 263
      debugging, 127-135
      executing one statement at a time, 341
      execution of C, 232
      high-level structure of, 312-313
      partitioning, 127
      readability of, 233
      requesting services from the operating system, 106
      stopping to debug, 341, 342
      testing to prevent bugs, 339-340
      tracing, 127
      typographic errors in, 336
      unstructured, 339
      visual presentation of, 143
Prolog, 11
propagation delay, 73
protected mode, 461
protocols for asynchronous relationships, 159
prototype of functions in C. see declarations
pseudo-ops, 141, 144-145, 177. see also directives
pseudocode, 349
pushing on a stack
      with activation records, 322
      inserting an element into a stack, 196, 198, 201
putchar function. see function putchar
Pythagorean theorem, 188
Back to top

Q

qualifiers, unsigned, 246, 494
question mark (?), part of the conditional operator, 266, 268
quiescent state of an R-S latch, 61
quotes. see double quotes; single quotes
Back to top

R

R (ready signal), generated by memory in the LC-2, 480
R-S latch, 61-62
rand function, 511-512
random numbers, generating, 511-512
readability of code, 225-226, 233, 498-499
Ready bit, 159
ready signal, generated by memory in the LC-2, 480
realloc function, 416
recurrence equations, 348, 354
recursion, 347-354
recursive algorithms, 348
recursive function, 347, 348, 350, 351, 358-359, 360
register file in the LC-2 data path, 112
register operands, 142
register qualifier for data items, 495
register+offset addressing mode, 457-459
registers, 62-63
      depositing values for debugging, 127, 128
      of LC-2, 68, 429
      privileged, 172
      saving and restoring, 179-181
      specified by the ISA, 92
      system, 460
      for temporary storage, 78
reinit component of the for statement, 288, 289
relational operators, 262-263, 268, 304, 501
reserved words, 247, 492
RET instruction, 174-176, 182, 432, 443
return address in a function activation record, 320, 324-325
return from interrupt (RTI) instruction of the LC-2 ISA, 432, 444
return from subroutine (RET) instruction of the LC-2 ISA, 443
return statement in C, 316, 508
return value of a function, 315, 316-317, 319-320
right shift (>>) operator, 260, 261, 268
Ritchie, Dennis, 227
routines. see subroutines
RTI instruction
      execution of, 485
      of the LC-2 ISA, 432, 444
RUN latch, 86, 179
run-time error messages, 338
run-time stack, 250, 251, 317-322
      containing activation records, 320
      making recursion work with, 355-357
      variables allocated in, 413
Back to top

S

%s specification
      causing characters stored consecutively in memory to be output, 397
      in printf, 381
      in the scanf statement, 382, 383
      scanning in a string in scanf, 399
saturating arithmetic, 454
saving registers, 179-181
scanf function. see function scanf
scientific notation, 18, 33
scope of a variable, 242-243, 247-249
scoping rules of C, 248-249
seed value for random numbers, 511
segment base registers, 457, 458, 461
segment descriptor table, 461
segment descriptors, 457, 458
segment limit registers, 457, 458
segment override prefix, 462, 463
segment registers of IA-32, 460, 461
segmentation of IA-32 memory, 457
semantic errors, 336, 337-339
semantics of a programming language, 226
semicolons (;)
      beginning lines with, in LC-2 assembly language, 141
      in C, 232-233
      ending declarations, 315
      ending statements, 256, 503
      identifying LC-2 assembly language comments, 143
      missing in declarations, 336
      separating for statement components, 288
      terminating directives, 235
sentinel method for iteration control, 107, 110
sequence of execution, 84-85
sequence of instructions, tracking, 127
sequential constructs, 122, 275
      examples, 124, 126
      in systematic decomposition, 120, 121, 122
service call, 106, 145, 146, 172
service routines in LC-2
      character input/output, 177-179
      executing with TRAP instructions, 173
      input, 160-161
      PUTS, 186-187
      TRAP, 173, 182, 184-186
Set Breakpoint command, 128
setting an R-S latch, 61
SEXT (sign-extension), 26-27
shared libraries, 394
shift operators in C, 260
shifting bits to the left, 26
short int, size of compared with char, 493
short qualifier, 246, 494
SIB byte, 462, 464, 465
sign bit, 27, 34
sign-extension (SEXT), 26-27
signal from an I/O device, 166
signals, asserted, 56
signed integers, 19-21, 244
Signed-Magnitude data types, 20
signed type qualifier in C, 494
simple statements, 296
simulator, LC-2, 127-135, 227
single-precision floating-point variable, 246
single quotes (' ')
      versus double quotes, 381
      for single characters, 381
      surrounding ASCII literals, 244, 491
single-stepping, 128, 341-342
sizeof operator in C, 268, 415
slide rule, 6
small numbers, representing, 26-27
source files, 228, 234, 489
source-level debuggers, 335, 341-342
source operands, 29, 30, 81
source program, 145, 228-229
spaces in assembly language, 143
spaghetti code, 339
SPARC ISA, 11
special characters
      in C, 491
      embedding in the format string, 398
      with printf statements, 236
special operators in C, 263-267, 501
specifier, operand, 98
speeds, I/O compared to processor, 158-160
SR1 register number in the LC-2 data path, 112
SR2 register number in the LC-2 data path, 112
srand function, 511-512
ST instruction, 98
      compared to STI, 99
      example of, 100
      of the LC-2 ISA, 432, 445
stack machine, 201
stack pointer, 197
      decrementing to pop a value from a stack, 198
      in a function, 320
      incrementing, 198
      for the run-time stack, 251
stack protocol, 198, 202
stacks, 195-201
      arithmetic computation with, 204
      examples of, 196-197
      implementing in memory, 197-198
      insertion and removal of elements from, 196
      popping the activation record off of, 323, 325
      as temporary storage, 201-203
standard library functions, 311, 509-512
state machine, 473-474, 483
statements in C, 256, 295, 296, 503
      for, 288-292, 506
      break, 284, 294-295, 507-508
      continue, 294-295, 508
      do-while, 292-294, 507
      if, 263, 276-278, 503-504
      if-else, 278-282, 504
      repeating a specified number of times, 288
      return, 316, 508
      switch, 282-285, 504-505, 507
      while, 286-288, 293, 506
static qualifier for variables, 495
static storage class, 248, 251, 495
static variables, 243
status register, IE bits in, 166
status registers for the keyboard and the monitor, 171
stdin file pointer, 402
stdin input stream, 394, 395
stdio.h header file, 234, 394, 395, 509
stdlib.h header file, 511
stdout file pointer, 402
stdout output stream, 394
step debugger command, 128, 342
stepwise refinement, 275
STI instruction, 99, 432, 446
storage, 247, 248
storage class, 243, 495
storage elements, 60-63
store base+offset (STR) instruction of the LC-2 ISA, 432, 447
store direct (ST) instruction of the LC-2 ISA, 432, 445
store indirect (STI) instruction of the LC-2 ISA, 432, 446
store instructions, formats of, 98
STORE RESULT phase
      accompanied by a test for the interrupt signal, 167
      of the instruction cycle, 84, 114
storing
      data movement instructions, 97, 98
      in a stack, 195
STR instruction, 99
      example of, 100
      of the LC-2 ISA, 432, 447
strcmp function, 510
strcpy function, 510
string functions, 383, 510
string literals, 491
string of characters, 186
string.h header file, 510
strings, 380-383, 510
.STRINGZ, 144, 164
struct. see structures
structure declaration, syntax for, 409-410
structure variables, declaring, 408
structured programming, 339
structures, 411
      accessing individual members, 409
      allocation of, 409
      arrays and pointers with, 411
      in C, 407-413, 496-497
      for data, 407-425
      declaring, 408-410
      operators in C, 502
      typedef declaration with, 410
style in C, 233
sub-blocks, creating within functions, 248
subroutines, 181-191, 203-210. see also functions
subtasks, 120, 121, 122, 311
subtraction
      on 2's complement integers, 26
      subroutine for, 204, 207, 209, 216
subtraction operator, 257, 258, 268
"surrender control to the programmer philosophy" of C, 388
switch statement, 282-285
      break statement in, 507
      in C, 504-505
      matching case constants, 284
symbol NULL as a preprocessor macro symbol, 415
symbol table, 147-148, 230
      allocated storage in memory in, 318
      in C, 250, 251
      creating, 148
      entries for variables, 250
      for a function, 319
symbolic addresses, 148
symbolic constants, 234
symbolic names
      giving to values, 225
      identifying memory locations with, 142
      in a symbol table, 230
symbolic values, 254
symbolically named values. see variables in C
synchronization mechanism for output, 160-161, 162
synchronous transfer, 159
syntactic errors, 336-337
syntax
      for associating if statements with else statements, 281
      of C, 295-296
      of dereference * operator in C, 374
      of a programming language, 225-226
syntax errors, 336-337
synthesis as a phase of compilation, 230
system call, 106, 145, 146, 172
System Control Block, 173, 175
system registers, 460
systematic decomposition, 120
      constructs of, 120-122, 275
      example using LC-2 machine language, 121-122
      notation for the do-while statement, 293
      notation for the while statement, 286
Back to top

T

tags, given to structures, 408
temporary storage, 78, 92
terminal case for a recursive function, 351
terminals in MOS transistors, 48
test component
      of the do-while statement, 293
      of the for statement, 288, 289
      of the while statement, 286
tests, checking conditions with switch, 282-283
text streams for I/O, 394
TF flag of IA-32, 461
three-address ISA of LC-2, 456
three address machine, 201
tilde (~) bitwise not operator, 259, 261, 268
tracing the execution of a program, 127, 340
transformation, 5, 119
transformation process, levels of, 8-13
transistor circuits, 49-55
transistors, 47-49, 223
translation of high-level programs, 226-227
translation process in assembly language, 141
trap flag of IA-32, 461
TRAP instruction, 106-107, 173-174
      accomplishing with I/O, 157
      compared to the JSR instruction, 182
      invoking an OS service routine, 172
      of the LC-2 ISA, 432, 448-449
TRAP routines, 171-180, 186
      for halting the computer, 179, 181
      for handling I/O, 177-179
      starting address of, 174
TRAP vector table, 186, 449
trapvectors, 106, 113, 173, 174
tri-state devices in the LC-2 data path, 111-112
truth tables, 29
      for a binary adder 58, 68
      building logically complete gates, 60
      DeMorgan's law, 54
      for the exclusive-OR function, 31
      for the AND function, 29
      for an AND gate, 53
      for the NOT function, 30
      for the OR function, 30
      for an OR gate, 52-53
      for a three-input AND gate, 55
Turing, Alan, 7-8
Turing machines, 7-8
two-address ISA, IA-32 as, 456
two-input decoders, 56
two-input multiplexor, 56
type casting, 415-416
type char, 493
type double, 493
type float, 493
type int, 493
type qualifier of C, 494-495
type specifiers, 244
typedef declaration, 410, 418-419, 498-499
types
      of arrays, 375
      of declarations, 295
      naming by programmers, 410
      providing a programmer-defined name for, 498
      of variables, 242-243
typographic errors in programs, 336
Back to top

U

unary function, 30
unary notation, 18
unary operation, 96
unary operator, 268
unconditional branch instruction, 102, 104
unconditional jump, 183, 436
underflow, 199-200
underscore character ( _ ), 247
uninitialized variables, 248
universal computational devices, 6-8
universal Turing machine, black box model of, 8
unsigned integers, 19, 210, 246
unsigned literal, 490
unsigned qualifiers, 246, 494
unstructured programs, 339
user programs. see also programs
      flow of control to an OS service routine and back, 174, 175
      performing I/O activity directly, 171-172
      resources not accessible to, 172
      services calls made by, 172
      terminating, 86
utility functions in C, 511-512
Back to top

V

values, 241-242
      constant, 254
      creating fixed, 234
      depositing in memory and registers for debugging, 127, 128
      displaying with function printf, 237
      giving symbolic names to, 225
      returned by a function, 315
      specifications on how to print out in C, 235
      symbolic, 254
      testing the relationship between two, 262
variable argument lists, 401-402
variable declarations in C, 497-498
      in blocks, 296
      example of, 248-250
      forms of, 295
      missing, 336
variable names, 246-247, 492
variables in C, 232, 241-254
      accessing, 247
      accessing indirectly, 365
      allocating locations for memory, 250-253, 413
      attributes of, 242, 243
      beginning with an underscore, 247
      declared as constants, 253
      declared at the beginning of a function, 248
      declared within a sub-block, 248
      declaring as arrays, 496
      declaring floating-point, 245
      declaring on a single line, 250
      declaring two different with the same name, 248-249
      examining values with during debugging, 342
      global, 243, 247
      identifiers consisting of multiple words, 247
      incrementing or decrementing, 263-264
      initial values of, 248
      initializing, 102, 107, 244
      local, 247
      memory addresses of, 365
      naming, 247
      nonglobal, 242, 243
      scope of, 242-243, 247-249
      specifying the location of indirectly, 374
      static qualifier for, 495
      storage class qualifiers for, 495
      storage classes of, 248
      tracking, 250
      types of, 242-243
void data type, returned by a function, 315
void functions, 316
void * generic data item, 415
voltages, detecting, 17-18
Von Neumann model, 75-86
      LC-2 as an example of, 79, 80
      overall block diagram for, 76
      parts of, 75
      processing unit, 77-78, 79
Back to top

W

WE (write enable), 62, 77, 112
while loop
      constructing a for loop with, 290-291
      executing zero iterations, 292
      programs with, 288, 293-294
while statement, 286-288
      in C, 506
      compared to the do-while statement, 293
      LC-2 code for, 287
white space, 383, 399, 400
word addressability of the LC-2, 92
word length of a computer, 78
word lines of memory, 66
write enable (WE), 62, 77, 112
Back to top

X

x86. see IA-32
XOR (exclusive-or) function, 31
XOR (^) operator in C, 259
Back to top

Y

Year 2000 (Y2K) computer bug, 339
Back to top

Z

Z condition code, 101, 104
Z (zero) condition register in LC-2, 95
zero, 17, 18, 49
zero-address machine, 201
zero-extending a trapvector, 113
zero-extending in BASE+offset mode addressing, 99
zero-operand instruction, 174
Back to top


Symbols and Numbers | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V |W | X | Y | Z

Back to Main Page

feedback form | permissions | international | locate your campus rep | request a review copy

digital solutions | publish with us | customer service | mhhe home


Copyright ©2001 The McGraw-Hill Companies.
Any use is subject to the Terms of Use and Privacy Policy.
McGraw-Hill Higher Education is one of the many fine businesses of the The McGraw-Hill Companies.