Professional Documents
Culture Documents
D 6 F 7 G 8 Bunim
D 6 F 7 G 8 Bunim
D 6 F 7 G 8 Bunim
Fall 2020
All Logic Functions of Two Variables
x F Map 1st
y row to 23
1 1 1 1
0 1 00 00 10 10 01 01
0 0 0 0 0 1 1 1 1 0 0 0 0
0 1 1 0 0 0 0 1 1 1 1
1
1 0 0 0
1 1 0
1 1 0 0 1 1 0
0
0
1
1
1
1
0
0
0 1 1
11 11 00 11 00 11 00 11 00 11 0 1 0 1 0 1 0 1
0 X Y X xor Y
not Y not X 1 Map last
X and Y
X=Y X nand Y Row to 20
C
AB C D F
AB CD 00 01 11 10
0 0 1 3 2
() 0 0 0 0 ... 00
1
() 0 0 0 1 ... 4 5 7 6
2
() 0 0 1 0 ... 01
3 B
() 0 0 1 1 ... 11 12 13 15 14
4
read as binary values with A =
() 0 1 0 0 ... A 10 8 9 11 10
5
() 0 1 0 1 ...
6
() 0 1 1 0 ... D
7
() 0 1 1 1 …
8
() 1
9
0 0 0 … The minterms are listed by an
() 1 0 0 1 …
10
( )1 0 1 0 … equivalent decimal number for
11
( )1 0 1 1 … easy reference
12
( )1 1 0 0 …
13
( )1 1 0 1 …
14 1 1 0 …
( )1
15
( )1 1 1 1 ...
The Uniting Theorem
(7) 0 1 1 1 1 1 1 1* 0 AD
4 5 7 6 AD
(8) 1 0 0 0 1 01 ABC
0 x 1* 0
(9) 1 0 0 1 0 AD
11 12 13 15 14
(10) 1 0 1 0 x 1* x 0 x
(11) 1 0 1 1 0 8 9 11 10 ABC
10
(12) 1 1 0 0 1 1 0 0 x
(13) 1 1 0 1 x AD BC D
BC D
(14) 1 1 1 0 x ABC
(15) 1 1 1 1 0 Fmin = AD + AD + or
BCD
Combinational Circuits Design
X(t) Combinational
Circuits Z(t)
Z(t) = λ(S(t),X(t))
Latches & Flip-Flops
S
Q
Q
S
Q Q
R
R
t S R S R Qt+Δt Qt+Δt
311 0 0 0 0 Set
210 0 1 1 0
101 1 0 0 1 Reset
0 0 0 1 1 Qt Q
t Hold
S Q
S-R Latch BLOCK
R DIAGRAM
STATE TABLE
Presen Next State Q
t+Δt CHARACTERISTIC or EXCITATION
t
State SR FUNCTIONAL TABLE TABLE
t 00 01 10 11 t+Δt
Q t t t t t
0 0 0 1 - St Rt Qt Qt+Δt Q S R Qt+Δt Function Q Qt+Δt S R
1 1 0 1 - 0 0 0 0 1 0 0 Qt Hold 0 0 0 x
0 0 1 1 0 0 1 0 Reset 0 1 1 0
0 1 0 0 1 1 0 1 Set 1 0 0 1
S
Q 0 1 1 0 1 Indeterminate
1 1 x 0
1 1 0? / Forbidden
Q 1 0 0 1 0 (non-sense)
R 1 0 1 1 0 Characteristic Qt t S t Qt Rt
LOGIC 1 1 0 0? 0? Equation: condition : t t 0
DIAGRAM 1 1 1 0? 0? S R
SR=10
SR=00v01 00v10
STATE DIAGRAM 0 01 1
JK Flip-Flop
10v11
JK=00v01 00v10
0 1 CHARACTERISTIC or
01v11 FUNCTIONAL TABLE EXCITATION
n n TABLE
J K Qn+1 Function n n n
0 0 n
Q Hold Q Q n+1 J K
0 1 0 Reset 0 0 0 x
1 0 1 Set 0 1 1 x
1 1 Toggle 1 0 x 1
Q
n 1 1 x 0
CHARACTERISTIC EQUATION:
MEV representation
n1 n n n n
Q Q J Q K (Map-Entered Variable)
D-Latch Enable D S R
0 0 1 1
Q Q
Q
Q
0 1 1 1 Q
Q
1 0 1 0 0 1
1 1 0 1 1 0
S
D Q
Q
δ R
Enable
Master-Slave D Flop-Flop
D=1 DQ n n n n
D Q Qn+1 Q Qn+1 D
0 0 1 1 0 0 0 0 0 0
CLK
0 Q 0 1 0 0 1 1
STATE DIAGRAM 1 0 1 1 0 0
BLOCK
DIAGRAM 1 1 1 1 1 1
TIME Setup Q n+1 = Dn Dn = Qn+1
DIAGRAM time
Hold There is a timing "window" around the clocking moment during which
time the input must remain stable and unchanged in order to be recognized.
D Din* Input data D may change
CLK 1
0
Propagation
Q time 1
Q = Din* 0
T Flip-Flop
TQ n n n n
T Q Qn+1 Q Qn+1 T
CLK 0 0 0 0 0 0
Q
0 1 1 0 1 1
1 0 1 1 0 1
0 T=1 0 1 1 0 1 1 0
0 1
n n
T=1 Q n1 Q T Q T
Synchronous Sequential Circuits as FSM
s(n)
StateRegister
Next state
x(n) p z(n)
m s(n+1) present λ
Present input state q
clk
Synchronous Sequential Circuits as FSM
State
Register
λ(Sn)
Next state s(n) z(n)
x(n) p
δ m λ
Present input s(n+1) present q
clk state
Sequential Circuits Design
11
x12 x 13 x15 x 14
10 e’8 e’9
011 010
Multi-function Registers
A3
00 No change
Register
I (msb)
1 Shift right (msblsb) 3
A2
10 Shift left (lsb msb) I2
A1
11 Parallel load I1
A0
I0 (lsb)
Multi-function RegistersSerialIn S1S0 CL
CK
0
f3 0M D3 Q
f3
1
1U A
3
2 CLK (msb)
f3 2
Q
X3
3
I3 f3 R
f 3 f 2 f 1
f 0
S1 S0 Function I2 D2 Q
0M
2 2 2 2 1 U A2
CLK
2 X3 Q
R
0
(f ) 0 0 No Change=Store
1
(f ) 0 1 Shift Right: direction msb→lsb
2 f 0
(f ) 1 0 Shift Left: direction lsb →msb 1 0M D1 Q
3
(f ) 1 1 Parallel Load DB I1 f 3 f 2
f1
1 1U A1
1 CLK
1 2 X3 Q
R
0M Q
0 D0
f0 1U A0
1 (lsb)
f0 2 X3 CLK
f0
2 Q
R
3
I0 f0
Memory
Memory A …A A A
N-1 2 1 0
N Address Lines
M Data Lines
N Address Lines
M Data Lines
D
• K = log2(1024) = 10 bits … …
• M = 8 bits E K
(2 -1)2 WORD N-1= 2K-1
D DD
M-1 …… 1 0
ADDR ADDR A A A A A A A A A7 A6 A5 A4 A3 A2 A1 A0 D D D D D D D D D7 D6 D5 D4 D3 D2 D1 D0
15 14 13 12 11 10 9 8 15 14 13 12 11 10 9 8
(HEX)
0 0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0001 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 RAM 0,3 RAM 0,2 RAM 0,1 RAM 0,0
… … … … … 1KX4 1KX4 1KX4 1KX4
1023 03FF 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
1024 0400 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
1025 0401 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 RAM 1,3 RAM 1,2 RAM 1,1 RAM 1,0
… … … … … 1KX4 1KX4 1KX4 1KX4
2047 07FF 0 0 0 0 01 1 1 1 1 1 1 1 1 1 1
2048 0800 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
2049 0801 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1
… … … … …
0BFF 0 0 0 0 1 0 1 1 1 1 1 1 1 1 1 1 EEPROM 1 EEPROM 0
0C00 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 2K X 8 2K X 8
0C01 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1
…
4095 0FFF 0 00 0 11 1 1 1 1 1 1 1 1 1 1
A A S 2K X 8 2K X 8
11 10 3
A -A
15 12
Unsigned Numbers
-5 +5
1011 -6 +6 0101
-7 -8 +7
1010 0110
1001 1000 0111
Signed numbers
• Example: -0
• Example: 0.15625
2- . 0.15625
0 0.3125
3 0 0.625
Impli 1 0.25
cit! 0
1
0.5
0
-3
(0.15625)d = (1.01 x 2 )b
IEEE 754 Standard – 32b Single Precision
0 10000100 001001001000000000000002
S E = 5+127 M
IEEE 754 Standard – 32b Single Precision
C17B000016 =
1 10000010 111101100000000000000002
S E M
Real Exponent n = E-127 Real Mantissa m =
= 100000102 – 127 = 1.11110112
1 = negative =130–127=3 = 1.9609375
0 = positive
Answer = - 1.9609375 x 23 = -15.6875
Write
Memory
Din Addr Dout 16 7 Common Bus Read
LD 16
Memory
Din Addr Dout
16
7
AR
•A typical digital computer
AR 12 1
system contains a large number AR 12 1
of registers. 12
LDPC
•The number of wires will be
PC 12 2
excessive if separate wires are 12 PC 12 2
used to connect each register 16 Select
LDIR
16 5 to all the other registers. 5
IR IR Source
•A more efficient scheme of 16
BUS
bits, determines which register is Data INPR
selected by the bus during each 16 6 Sel
TR
16 6
particular register transfer. LDTR TR
TRAC 16
(destination source) 8
OUTR
OUTR S2-S0 49
8 LD
Select Destination OUTR
D0
Write Memory B
A
D1 Read Din Addr Dout 7
I
14 D2
I LDAR AR
S
13 D3
I D INRAR
12
D5
4
X 12 1
CLRAR
I
3-to-8 D6 input
Other decoder D LDPC PC
C
7 12 2
inputs INRPC
CLRPC
Combinational
Control Circuits LDIR IR 16 5
C
(Control logic
Unit gates) LDDR DR
BUS
O
INRDR
T0 output
Fetch
T1 CLRDR 163
M
T2 ALU 4
4-to-16
T3 present
16
state
P
decoder … LDAC AC
… INRAC
Exec T14
U
CLRAC
T
15
Data INPR
4-bit INRSC
LDTR
path
T
E
sequence
Counter CLRSC Clock INRTR TR CLRTR 16 6 Sel
(State Register) next
R
LD
state OUTR OUTR
S2-S0
Arithmetic microoperations
C
in
Ai
Op1 Σ
Bi
C i 0
FALU
S
0 FALU
in 1 S0
MUX
ALU i
Ai C F Op.4 0 1 S S 1
in0
Op2 2 1 0
Op.5 1
Op2 Σ C E= FLSC
F
0 out0 Op.4 0
Op.6 2 Op.5 1 E=
C LSC
Ai
in
C Op.7 3 Op.6 2 F
in0 3 LSC i
Op3 Σ FOp3
53 3 LSCi
1 C Op .7
out0
Logic Circuit (LC)
AC7
Select Bits Output
A7
C
SSSC in F in7
2 1 0 ALU C =C
F
0000 FAC = A+B 0 Σ in 0
7
AC1
0001 FAC = A+B+1 A 1 S1 S0
Cout7 A1
1
0010 F = A−B−1 C in1
F
AC
0011 AC = A−B 0 2
0
F A Σ
AC7 A0
AC0
0100 F =A C
0 1
in0
F
AC 3 1 C
0101 F = A+1 out1
AC 0
0110 F = A−1 0 2 Σ0
0111 AC = A
S1 S0
F
AC 3 1 C
AC1
out0
100x FLSC = A B 1
101x ∧ B 0 0 0 2 0
FLSC=A
∨ S S AC0
ALU7
110x 1E= FLSC7 1 1 3 1
ALU0
FLSC = shift left B7 1 0
111x FLSC = shift right A6 2 0 0
F
F
F
ALU0 S1 S0
B1 SerIn 3 1E= FLSC1
AC LSC7 B1 A0 2 1 0
B
0 1E= F
LSC0
3 B0
A2 LSC1 SerIn 2
Another way of implementing an ALSU
LC
is to build: - one full arithmetic unit (AC) A1 3
− one full logic unit (LC), and
LSC0
− one full shift unit (SC)
and pass the outputs of all the units to a multiplexer that will select the final output
depending on the values of its selection bits.
Symbol I=0 I= 1 Description
Instruction Set
MRI
AND 0xxx 8xxx AND memory word to AC
ADD 1xxx 9xxx Add memory word to AC
LDA 2xxx Axxx Load memory word to AC
STA 3xxx Bxxx Store content of AC in memory
Memory Reference Instructions BUN 4xxx Cxxx Branch unconditionally
dominate the instruction set: BSA 5xxx Dxxx Branch and save return address
ISZ 6xxx Exxx Increment and skip if zero
– Divided equally between RRI
Direct/indirect memory CLA 7800 Clear AC
CLE 7400 Clear E
addressing CMA 7200 Complement AC
memory INC
SPA
7020
7010
Increment AC
Skip next instruction if AC positive
– Indirect addressing refers SNA 7008 Skip next instruction if AC negative
SZA 7004 Skip next instruction if AC zero
to address in memory SZE 7002 Skip next instruction if E is 0
HLT 7001 Halt computer
IOI
INP F800 Input character to AC
OUT F400 Output character from AC
SKI F200 Skip on input flag
SKO F100 Skip on output flag
ION F080 Interrupt on
lOP F040 Interrupt off
Symbol
Instruction Set
I=0 I= 1 Description
AND 0xxx 8xxx AND memory word to AC
MRI
ADD 1xxx 9xxx Add memory word to AC
performed on AC CLA
CLE 7400 Clear E
the rest of the 12-bits [11:0] specify CMA 7200 Complement AC
an address in memory: CME 7100 Complement E
D =0
7
D 3
STA =$3addr i
AR0
mem D 4
BUN =$4addr BUN =$C(addr) 1 0 0 AR11 AR10 AR9 AR8 AR7 AR6 AR5 AR4 AR3 AR2 AR1
i
AR0
D 5
BSA =$5addr BSA =$D(addr) 1 0 1 AR11 AR10 AR9 AR8 AR7 AR6 AR5 AR4 AR3 AR2 AR1
i
AR0
D 6
ISZ =$6addr ISZ =$E(addr) 1 1 0 AR11 AR10 AR9 AR8 AR7 AR6 AR5 AR4 AR3 AR2 AR1
i
AR0
RRI IOI 1 1 1 C o d e Ext ension
D
7 CLA =$7800 INP = $F800 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
D7 CLE =$7400 OUT = $F400 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0
D7 CMA =$7200 SKI = $F200 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0
D
7 CME =$7100 SKO = $F100 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0
D7 CIR =$7080 ION = $F080 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0
D7=1 D7 CIL =$7040 IOF = $F040 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0
D
reg 7 INC =$7020 n/a 1 1 1 0 0 0 0 0 0 1 0 0 0 0 0
D7 SPA =$7010 n/a 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0
D
7 SNA =$7008 n/a 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0
D7 SZA =$7004 n/a 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0
D7 SZE =$7002 n/a 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0
D7 HLT =$7001 n/a 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1
Binary encoding One-hot (bit-per-state) encoding “addr” = 12 bit address of the operand
“(addr)” = address of the operand address
Instruction Set Completeness
T1 T4 T6
EXECUTION
FETCH
T T3 T
T0 2 5
Fetch Cycle – @ ASM Level1
reister
1
H
T
0 RTL
O Fetch T1
ASM#2
T T2
E 4-to-16 T3
N State
C Decoder
T4
…
RTL
O Exec T ASM#2
D 14
T
I 15
N
G
4-bit
Sequence
Counter (SC)
RTL RTL
From the Instruction List: ASM#2
ASM#2
RTo
2
R'(T0+T1+T2)’
RT1 4
RT
3 2
1
Interrupt Cycle
72
Basic Computer Operation
RTL
Init
R’ R
Fetch INT
Exec FSM
Fetch R'To: AR <- PC
Decode IR <- M[AR], PC <- PC + 1
RTL R'T1:
R'T2: D0, ... , D7 <- Decode IR(12-14),
AR <- IR(0-11), I <- IR(15)
Indirect D'7IT3: AR <- M[AR]
Interrupt: T T T (IEN)(FGI + FGO): R <- 1
0 1 2
RTo: AR <- 0, TR <- PC
RT1: M[AR] <- TR, PC <- 0
RT2: PC <- PC+1, IEN <- 0, R <- 0, SC <- 0
Memory-reference:
AND D0T4: DR <- M[AR]
D0T5: AC<-AC^DR,SC<-0
ADD D1T4: DR <- M[AR]
D1T5: AC <- AC + DR, E <- Cout, SC <- 0
LDA D2T4: DR <- M[AR]
D2T5: AC <- DR, SC <- 0
STA. D3T4: M[AR] <- AC, SC <- 0
BUN D4T4: PC <- AR, SC <- 0
BSA D5T4: M[AR] <- PC, AR <- AR + 1
D5T5: PC <- AR, SC <- 0
ISZ D6T4: DR <- M[AR]
D6T5: DR<-DR+1
D6T6: M[AR] <- DR,
if (DR = 0) then (PC <- PC + 1), SC <- 0
Reg-ref D7I'T3 = r (common to all reg.-ref. instr.)
IR(i) = Bi (i = 0, 1, 2, ... , 11)
r: SC <-0
CLA rB11: AC <-0
CLE rB10: E<-0
CMA rB9: AC <- AC'
CME rB8: E<-E'
CIR rB7: AC <- shr AC, AC(15) <- E, E <- AC(0)
CIL rB6: AC <- shlAC, AC(0) <- E, E <- AC(15)
INC rB5: AC<-AC+1
SPA rB4AC'(15): If (AC(15) = 0) then (PC <- PC + 1)
SNA rB3AC(15): If (AC(15) = 1) then (PC <- PC + 1)
SZA rB2AC': If (AC = 0) then (PC <- PC + 1)
SZE rB1E': If (E = 0) then (PC <- PC + 1)
HLT rB0: S<-0
In-out D7IT3 = p (common to all input-output instructions)
IR(i) = Bi (i = 6, 7, 8, 9, 10, 11)
p: SC<-0
INP pB11: AC(0-7) <- INPR, FGI <- 0
OUT pB10: OUTR <- AC(0-7), FGO <- 0
SKI pB9FGI: If (FGI = 1) then (PC <- PC + 1)
SKO pB8FGO: If (FGO = 1) then (PC <- PC + 1)
74
ION pB7: IEN <- 1
IOF pB6: IEN <- 0
Assembly Language Program to
Subtract Two Numbers
• In order for a program to be executed by any computer it has to be converted into
that computer’s specific machine code by an appropriate compiler.
• An assembler is a compiler that translates each assembly instruction into its
equivalent binary instruction.
• The translation of the assembly program for subtracting two numbers (presented in
the previous example) into its equivalent machine code is shown in the following table.
Assembl Address Conten Run time
yLanguage (source code) (hex) t (hex) AC
ORG 100 /Origin of program is location 100 100 2107
LDA SUB /Load subtrahend to AC 0017
CMA /Complement AC 101 7200 FFE8
INC /Increment AC 102 7020 FFE9
ADD MIN /Add minuend to AC 103 1106 003C
STA DIF /Store difference 104 3108 003C
HLT /Halt computer 105 7001 003C
MIN, DEC 83 /Minuend 106 0053
SUB, DEC 23 /Subtrahend 107 0017
DIF, HEX 0 /Difference stored here 108 0000
END /End of symbolic program 75
Table 6.8 6.9
LOOPS DO-WHILE
DO …. In Assembly Language, a
START
…. variable, called counter is
Increment ctr stored at label CTR and
ptr := ADS
ctr := -n =(-5) ENDO keeps track of the number
sum:= 0 of iterations were executed.
WHILE ctr < 0
Yes
... … …
10E FFFB CTR equ -5
STOP
Double-
• To increase the accuracy of an
BH BL
ADD BL / Add B low, carry in E
CH CL
STA CL /Store in C low
CLA /Clear AC 1615 210
onA C
0000 1011 0000 1111+
E
0001 1110 0001 1110
0010 1101+ ORG 100
0000 1011 0011 1100 0000 0000 LOP, CLE /Clear E
0010 1101+ LDA Y /Load multiplier
0000 1011 0111 1000 0111 1000 CIR /transfer multiplier bit to E
1010 0101 STA Y /Store shifted multiplier
The basic computer designed in SZE /Check if bit is zero
Chapter 5 does not contain an BUN ONE /Bit is one; go to ONE
instruction to perform BUN ZRO /Bit is zero; go to ZRO
multiplication operation. ONE, LDA X /Load multiplicand
Thus, a SW implementation ADD P /Add to partial product
is necessary to provide the STA P /Store partial product
basic computer with the
capability to perform a CLE /Clear E
multiplication of two ZRO, LDA X /Load multiplicand
numbers. CIL /Shift left
To simplify the SW implementation STA X /Store shifted multiplicand
of the multiplication operation in ISZ CTR /Increment counter
the basic computer, it is assumed BUN LOP /Counter not zero; repeat loop
that the two operands are HLT /Counter is zero; halt
unsigned and that they have no CTR, DEC -8 /This location serves as counter
more than eight significant bits so X, HEX 000F /Multiplicand stored here
that the product cannot exceed the Y, HEX 000B /Multiplier stored here
16-bit word capacity P, HEX 0 /Product formed here
(Table 6.14). END
MAIN CALLS SUBROUTINE
RAM
MAIN 1. m(808) (PC) m(808) = 0805
…. 2. PC addr op + 1 PC = 0809
0804 BSA 808
1
0805 …. RAM
RAM
803 MAIN 803 MAIN
BSA 808 804 BSA 808
804
805 805
2 AC 806
AC
806
807 807
808 08 05
DR DR
808 Ret addr
TR TR 809 S
PC = 0805 809 S 80A U
PC = 0809
80A U 80B B
80B B 80C BUNin808
80C BUNin808 1
SUBROUTINE RETURNS TO MAIN
RAM
Subroutine 3. PC [m(m(808))] PC=0805
080B …
080C BUNindirect808
RAM
080D …. 803 RAM
20 BSA 135
21 next instruction
22 …… 3 1
…. …….
135 stored ret. addr (21) 2
136 Subroutine 1st instruc
137 …..
… …..
159 Subroutine last instr 3
160 BUNindirect 135
81
Parameter Linkage ORG 200 Table 6.17
– Pointer to memory
Pass the address of the parameters in memory
to the subroutine by
– a register or
– memory = global variable or parameter
linkage
More complex, extra overhead for use of
the pointer
Addr ORG 0 /Main program
program
nMai
0 BSA MVE /Branch to subroutine
1 HEX 100 / 1st parameter = address of first source data
Call-by- 2 HEX 200 / 2nd parameter = address of first destination data
parameters
3 DEC -16 / 3rd parameter (FF0) = Number of words to move
reference 4
5
HLT
HEX 0
/To store address provided by BSA MVE (1)
MVE,
Write and test a 6 LDA MVE I /Copy 1st parameter, i.e., address of source (100),
subroutine that copies 7 STA PT1 / into the first pointer (PT1:=100)
a block of 16 16-bit 8 ISZ MVE /Increment M[5] to point to 2 = addr. of 2nd param.
words {a0, a1, … a15} 9 LDA MVE I /Bring address of destination (200)
from memory A STA PT2 / and store it in the second pointer (PT2:=200)
B ISZ MVE /Increment M[5] to point to 3 = addr. of 3rd param.
locations starting at C
100 HEX to 200 HEX LDA MVE I /Bring the number of words to be copied (-16)
D STA CTR / and initialize the word counter with it (CTR:=-16)
E ISZ MVE /Increment M[5] to obtain correct return address
F LOP, LDA PT1 I /Load source item: AC ak @ M[PT1]
Subroutine
MVE(PT1,PT2,CTR)
POL 10 STA PT2 I /Store in destination: M[PT2] ak @ AC
11 ISZ PT1 /Increment source pointer
12 ISZ PT2 /Increment destination pointer
AC:=M[PT1] 13 ISZ CTR /Increment counter
M[PT2]:=AC 14 BUN LOP /Repeat 16 times
PT1:=PT1+1
15 BUN MVE I /Return to main program
16 PT1, / pointer to the source data
17 PT2, / pointer to the destination data
18 CTR,
PT2:=PT2+1
CTR:=CTR+1
ORG 100
100
Data