Professional Documents
Culture Documents
ISA
microprocessors instruction set
set of all assembly language instructions
details of the programmer accessible registers within the
microprocessor.
information necessary to interact with memory
handling interrupts
Pentium
Object code
Compiler for G4
Power Mac Computer
Other
G4
Object files
G4
Object code
SPARC
Object code
Pentium Linker
G4 Linker
SPARC Linker
Pentium
Executable file
G4
Executable file
SPARC
Executable file
Windows
Pentium PC
G4
Pentium PC
SPARC
UNIX workstation
Assembler for
Processor X
Processor X
Object code
Other processor X
Object files
Process X
Linker
Processor X
Executable file
Computer with
processor X
Java compiler
Byte code
Java VM for
Windows Pentium PC
Java VM for
G4 Power Mac
Java VM for
SPARC UNIX workstation
Windows
Pentium PC
G4
Power Mac
SPARC
UNIX workstation
2. Indirect
0: LDAC 5 ;instruction gets data from location 5
. . .
5: 10
;then gets data from location 10
. . .
10: 20
;stores value in CPU
3. Register direct
0: LDAC R ;instruction gets address from register R
. . .
R: stores value in CPU
5. Immediate
0: LDAC #5 ;stores value from instruction in CPU
6. Implicit
0: LDAC (implicit)
;instruction gets value from stack
. . .
stack -> stores value in CPU
LDAC $5
instruction adds address of next instruction (1) to
offset (5) to get address (6)
12 -> stores value in CPU
8. Indexed
0: LDAC 5(X)
;instruction gets value from index
register
. . .
X: 10
; then adds contents of X(10) to offset
(5) to get address (15)
. . .
15: 30 -> stores value in CPU
2 bits
2 bits
2 bits
opcode
operand
#1
operand
#2
operand
#3
1010
2 bits
2 bits
opcode
operand
#1
operand
#2
MOVE A,B
(A=B)
1010 00 01
ADD
(A=A+C)
1010 00 10
A,C
2 bits
opcode
operand
#1
LOAD B
(Acc=B)
0000 01
ADD C
(Acc=Acc+C) 1010 10
STORE A
(A=Acc)
0001 00
(Stack=B)
0101
PUSH C
(Stack=C,B) 0110
ADD
(Stack=B+C) 1010
POP A
(A=Stack)
1100
Byte 1
Low-order 8 bits of
Byte 2
High-order 8 bits of
Byte 3
1-byte format
Instruction code
Byte 1
i
i 0
or
1 2 ... n
Algorithm
1:
2:
3:
4:
total = 0, i = 0
i = i + 1
total = total + i
IF in THEN GOTO 2
total
i
total = 0, i = 0
i
i = i + 1
i
total
total = total + i
total
n
IF in THEN GOTO Loop
Loop