Professional Documents
Culture Documents
Equipment:
1. Computer
2. Easy68K software
3. Calculator
4. Flash drive
Theory:
LAB1.L68K
LAB1.S68
(S-record file)
Sim68K(listing file)
(simulato
r)
program
execution
OPCODE
OPERANDS
; COMMENTS
Mandatory
Optional
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
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
Figure 2: LAB1A.X68
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.
ERROR
MESSAGE
Figure
3: Error in
program
LAB1A.X68 (PROGRAM)
Machine code
(understand
by computer)
Figure 5: Sim68K
LEN
Example
EQU 100
ORG $0800
DC[.size]
DS[.size]
VAR
DC.B 2,18
TAB
DS.B 10
LEN
TABLE1
TABLE2
VAR
ORG
EQU
DC.B
DS.B
DC.W
$0900
$0902
$23,$17,$F2,$A3
6
$43AF
3. Click View > Memory. Go to address $0900 and analyze the content inside memory. Put your
analysis into Table 3 below.
Address
Data (Hex)
$0900
23
$0902
F2
$0904
FF
$0906
FF
$0908
FF
$090A
43
$090C
FF
Question:
Answer all questions below.
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
Data 43 into Address 90A
Data FF into Address 90C
1. Using Easy68K to debug the error coding below. Write down the correct coding.
HOUSE
BLOCK
STAIR
START
ORG
DC.B
DS.W
DC.W
ORG
1200
$57AE,$44DC,@1313,$A3
2
25AC
1400
Answer :
#$1234,D0
D0,D1
$04B0,D2
#$04B6,A0
(A0),D3
START