Familia 68 K
Familia 68 K
Familia 68 K
+
|
+
|
+
|
+
|
+
+---------- +
|LongWord0 H|
+---------- +
|LongWord0 L|
+---------- +
|LongWord1 H|
+---------- +
|LongWord1 L|
+---------- +
Addressing Modes
68000 is a CISC machine and has many addressing modes (14 to be exact). These
addressing modes can be categorized into 6 groups.
Address generation
Assembler Syntax
--------------------------------------------------------------------
(1)Register Direct
Data Register Direct
Address register direct
(2)Address Register Indirect
Register Indirect
Dn
An
(An)
Dn
An
(An)
(An); An<-An+N
(An)+
An<-An-N; (An)
-(An)
(An)+ disp16
d(An)
(An)+ (Ri) + disp8 d(An)
(Next Word)
(Next two Word)
(PC)+disp16
(PC)+ (Ri) + disp8
xxxx
xxxxxxxx
d
d(Ri)
68000 Memory
68000 uses linear address to access the memory. Even though it has a 32-bit PC, only the
lower 24 bits are used. With 24-bit address it can directly access up to 16 MB of memory.
68000 Stacks
68000 supports stacks and queues with the address register indirect postinrement and
predecrement addressing modes. That is, with register indirect addressing mode all of the
seven address registers can be used as stack pointers. Subroutine calls, trap and
interrupts use the dedicated stack pointers - USP and SSP. Stacks from high to low
memory are implemented with predecrement mode for PUSH and postincrement mode for
POP. On the other hand, stacks from low to high use postinrement for PUSH and
predecrement for POP. (Note: when address registers is used only 24 bits are valid.)
68020
68020 is a true 32-bit processor and it is object code compatible with 68000. It has many
more registers. Besides the 8-data registers, 7-address registers, 1-PC and 1-SR, there
are 3 SPs instead of 2. There are also 1 16-bit Vector-Based Register (VBR), 2 3-bit
function code registers, 1 32-bit Cache address register (CAAR) and 1 32-bit Cache
COntrol Register (CACR). There is an on-chip instruction cache of size 128 words (16-bit).
The PC is a true 32-bit registers and can address up to 4GB of memory space. There are
new instructions as well as new addressing modes. The new addressing modes are
related to Memory Indirect and Memory INdirect with PC.
68030
68030 is a virtual memory processor based on 68020. That is 68030 has on-chip memory
management unit which performs the paged data memory management. There are four
new instructions for the MMU part of the processor. It also has an on-chip data cache of
size 128 words besides the instruction cache.
68040
68040 is a better implemented 68030. It has larger on-chip data and instruction caches. It
also has an on-chip floating point unit.
Example Assembly Programs for 8086 and 68000
The following two programs implements the summation of multiplying two set of numbers.
This process is described as SUM Xi*Yi for i=1 to 100. In a pseudo language this
calculation is described as:
sum <- 0
for i<- 1 to 100 do
endfor
LOOP:
MOVEQ.L #99, D0
; DO is the index i
LEA
P, A0
; Array X starts at P
LEA
Q, A1
; Array Y starts at Q
CLR.L D1
;
MOVE (A0)+, D2 ; get X(i)
MULS (A1)+, D2 ; get Y(i) and dose the multiply X(i)*Y(i)
ADD.L
D2, D1
; sum <- sum + X(i)*Y(i)
DBF
D0, LOOP ; test for zero; decrement and loop