Lab 1 Complete

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 20

GROUP 2

ELECTRICAL ENGINEERING DEPARTMENT


DEC 3043 MICROPROCESSOR FUNDAMENTALS
DIPLOMA IN COMPUTER ELECTRONICS
LAB 1
TITLE : Introduction of Instruction Set for Easy68K
NAME

MOHD SYAHIR BIN ABD SUKOR

MATRIX
NUMBER

16DTK14F1019

DTK5A

Nur Akhyar bin Nordin

CLASS
LECTURE

SESION: JUNE 2016

GROUP 2
CONTENTS

GROUP 2
INTRODUCTION
Theory:

Motorola 68000 Designed by Motorola Inc. in 1979 which is consists of 68,000


transistors (< 1 MIPS (Million Instructions per Second)). It is used in Apple Mac,
Sun, Silicon Graphics, and Apollo workstations. 16-bit microprocessor lends to
the 16-bit data bus and it introduced to replace 8-bit microprocessors. This 16-bit
microprocessor helps to overcome the lacking of instruction sets and addressing
capabilities. Motorola 68000 also known as multiprocessing and multitasking
microprocessor because it can executes many programs at one time.
EASY68K stand for Editor, Assembler, and Simulator for the 68000
microprocessor. This software able you to create and run 68000 assembly
language program on a Windows PC. EASY68K consists of:
1.
Edit68K Editor program for writing and assembling a program.
2.
Sim68K Simulator program for simulate or running a program.
LAB1.X68
(source
file)
Edit68K
(assemble
r)

LAB1.L68K
LAB1.S68
(listing
file)
(S-record file)
Sim68K

(simulato
r)

program
execution
Assembly Language Syntax stated that each line of a program must have an
instruction, an assembler directive (or pseudo-op) and a comment. Whitespace
(between symbols) and case are ignored. Comments (beginning with ;) are also
ignored. An instruction has the following format:
LABEL

OPCODE

OPERANDS

Mandatory
Optional
3

; COMMENTS

GROUP 2
Opcodes - Reserved symbols that correspond to LC-3 instructions; for example:
ADD, AND, LD, LDR
Operands - Registers: specified by Rn, where n is the register number
- Numbers: indicated by numbers symbol typing
- Label: symbolic name of memory location (separated by comma)
Example:
MOVE.B
#$12,D2
Label - placed at the beginning of the line and assigns a symbolic name to the
address corresponding to line
Example:
LOOP MOVE.B
#$12,D2
Comment - anything after a semicolon is a comment and used by humans for references because
its ignored by assembler

GROUP 2
Objectives:

1. Understanding instruction line up for each block and try simulate.


2. Understanding for simple for Address Register Direct
3. Determine the using for Define Variables and Define Constant

Equipment:

1. Computer
2. Easy68K software
3. Calculator
4. Flash drive

GROUP 2
Activity 1: Program Writing With Edit68K
1. Click: Start > All program > EASy68K > Edit68K.

Figure 1: Edit68K
2. Type the following program and saved as LAB1A.X68
*----------------------------------------------------------* Program Number: LAB1A.X68
* Written by
: (GROUP)
* Date Created : DD.MM.YYYY
* Description
: MOVE INSTRUCTION
*----------------------------------------------------------START ORG
$1000
MOVE.B
#$12,D0
; Instruction 1
MOVE.W
#$1234,D1
; Instruction 2
MOVE.L
#$12345678,D2 ; Instruction 3
MOVE.W
D2,D3
; Instruction 4
MOVE.B
D1,D4
; Instruction 5
MOVE.W
D1,D5
; Instruction 6
MOVE.B
D3,D6
; Instruction 7
MOVE.W
D5,D7
; Instruction 8
MOVE.W
D7,D0
; Instruction 9
MOVE.B
D3,D1
; Instruction 10
END
START

GROUP 2

Figure 2: LAB1A.X68

3. Make sure every writing is in the right place for LABEL, OPCODE, OPERAND and
COMMENT
4. There are several way to assembling file, choose either one:
a. Click : Tools | Assembly Source or
b. Click button
c. Press F9
5.

or

EASy68K will check error and display it if available. If any, double click the Error
Message to locate and correct the error. Repeat step 1 until no error available.

GROUP 2

Figure 3: No Error in program

Figure 4: Enter Load L68

GROUP 2
Activity 2: Address Register Direct
1. By referring to the instruction in Figure 2, manually do instructions according to the below
statements first without using Easy68K.
Table 1: Translation statement into code
Statement
Instruction Code
ex: Input 8-bit data from register D6 into D7
MOVE.B D6,D7
Input decimal value 69 into D6
MOVE.B #69,D6
Input 32-bit $1200 into register D0
MOVE.L #$1200,D0
Input 16-bit -1 (Negative one) into register D1
MOVE.W #(-1),D1
Input octal value 753 into D2
MOVE.L #@753,D2
Input binary value 11001001011 into D3
MOVE.L #%11001001011,D3
Input character A into D4
MOVE.L $A,D4
Input character QUIT into D5
MOVE.L #QUIT,D5
Input hexadecimal value 1350 into A0
MOVE.W #$1350,A0
Copy data from register D5 into D6
MOVE.L D5,D6
Copy value from register A0 into A1
MOVE.L A0,A1

Figure 2: LAB1A.X68 after type coding

GROUP 2

Figure 3: No Error in program

Figure 4: After Enter Load L68

10

GROUP 2

Activity 3: Using Define Variable and Define Constant


1. Refer to the Table 1 below to get understanding of directive description.
Directive Name
Description
EQU
Give a value to a symbol
ORG
Set starting value of location counter
where code or data will go
DC[.size]
Allocate and initialize storage for
variables. Size can be b (byte), w (two
bytes) or l (4 bytes). If no size is
specified, b is uses
DS[.size]
Allocate specified number of storage
spaces. size is the same as for dc directive
2. Key-in instruction below using Easy68K and RUN it.

LEN
TABLE1
TABLE2

ORG
EQU
DC.B
DS.B

$0900
$0902
$23,$17,$F2,$A3
6
11

LEN

Example
EQU 100
ORG $0800

VAR

DC.B 2,18

TAB

DS.B 10

GROUP 2
VAR

DC.W

$43AF

Figure 1:Type this code at LAB1A.X68

12

GROUP 2

Figure 2: LAB1A.X68

Figure 3: After enter code Run it

13

GROUP 2
3. Click View > Memory. Go to address $0900 and analyze the content inside memory. Put your
analysis into Table 3 below.
Address
$0900
$0902
$0904
$0906
$0908

Data (Hex)
23
F2
FF
FF
FF

Analysis
Data 23 into Address 900
Data F2 into Address 902
Data FF into Address 904
Data FF into Address 906
Data FF into Address 908
Table 2

Figure 4: The data and address of Memory

14

GROUP 2

QUESTION
1. Using Easy68K to debug the error coding below. Write down the correct coding.
ORG
DC.B
DS.W

HOUSE
BLOCK
STAIR DC.W
25AC
START
ORG
MOVE.B
MOVE
MOVE.L
MOVEA.L
MOVE.W
END

1200
$57AE,$44DC,@1313,$A3
2
1400
#$1234,D0
D0,D1
$04B0,D2
#$04B6,A0
(A0),D3
START

15

GROUP 2

Figure 1:Insert the code at LAB1A.X68 and run it

Figure 2: Error in program

16

GROUP 2

Figure 3: identified the Error and run it again

Figure 4: No Error in Program

17

GROUP 2

Figure 5: After Run it

Figure 6: The data and address in Memory has shown

18

GROUP 2
2. What is the meaning of .B, .W and .L?
Answer:
B : Using Binary value
W :Using 16-bit of hexa
L : Using 32-bit of hexa

CONCLUSION
19

GROUP 2
i. . Discovery Issues
that there are problems in the course of practical training is a coding error that can
not be run the next process.
This problem is solved by identifying coding wrong and corrected.

ii. Reference Source


I took the reference source is from internet.
-http://www.slideshare.net/FrankieJones1/chapter-3-instruction-set-and-assemblylanguage-programming

iii . Practical Conclusions and Recommendations

20

You might also like