Міністерство Освіти І НАУКИ України
Національний університет "Львівська політехніка"
Кафедра САПР
ЗВІТ
ДО ЛАБОРАТОРНОЇ РОБОТИ № 1
На тему: «Засоби компіляції, лінкування і налагодження програм в СР/М для мікропроцесора Intel 8080 (КР580ВМ80А)»
З дисципліни : «Архітектура комп’ютерів»
Виконав:
Студент групи КН
ЛЬВІВ – 2009
Тема роботи: Засоби компіляції, лінкування і налагодження програм в СР/М для мікропроцесора Intel 8080 (КР580ВМ80А).
Мета роботи: Вивчити засоби компіляції, лінкування і налагоджування програм за допомогою компілятора СР/М для мікропроцесора Intel 8080 (КР580ВМ80А).
ТЕОРЕТИЧНІ ВІДОМОСТІ
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
ЛАБОРАТОРНЕ ЗАВДАННЯ:
Ознайомитися на прикладі використання заданої програми ( день народження + місяць народження студента) з внутрішніми командами СР/М, а також із засобами динамічного від лагодження програм. Навчитися працювати з компілятором СР/М.
Для вивчення відлагодження програм у CP/M була використана наступна програма:
ORG 100h
MVI A,24
MVI B,2
ADD B
HLT
Результати виконання програми:
80MATE (tm) CP/M-80 Emulator 1.2
Copyright (c) 1984 Vertex Systems Inc.
SN #007#
60K TPA
D:[cpm] dir
D| 8080LIST TXT | C EXE | CPM-DDTR TXT | CPM-KOMR TXT
D| D C+OM | L COM | LAB_1 ASM | LAB_1 HEX
D| LAB_1 PRN | LAB_1 SYM | M COM
D:[cpm] dir *.asm
D| LAB_1 ASM
D:[cpm] dir lab_1.*
D| LAB_1 ASM | LAB_1 HEX | LAB_1 PRN | LAB_1 SYM
D:[cpm] dir lab_1.asm
D| LAB_1 ASM
D:[cpm] type lab_1.asm
org 100h
mvi a,24
mvi b,2
add b
hlt
D:[cpm] dir
D| 8080LIST TXT | C EXE | CPM-DDTR TXT | CPM-KOMR TXT
D| D COM | L COM | LAB_1 HEX | LAB_1 PRN
D| LAB_1 SYM | LAB_1 TXT | M COM
D:[cpm] ren lab_1.txt=lab_1.asm
D:[cpm] dir
D| 8080LIST TXT | C EXE | CPM-DDTR TXT | CPM-KOMR TXT
D| D COM | L COM | LAB_1 HEX | LAB_1 PRN
D| LAB_1 SYM | LAB_1 TXT | M COM
D:[cpm] ren lab_1.asm=lab_1.txt
D:[cpm] save 1 pam.txt
D:[cpm] type pam.txt
D:[cpm] m lab_1.asm
CP/M MACRO ASSEM 2.0
0106
000H USE FACTOR
END OF ASSEMBLY
D:[cpm] l lab_1.prn
FIRST ADDRESS 0100
LAST ADDRESS 0105
BYTES READ 0006
RECORDS WRITTEN 01
D:[cpm] d lab_1.com
DDT VERS 1.0
NEXT PC
0180 0100
-g
*Execution halted
D:[cpm] era pam.txt
D:[cpm] dir
D| 8080LIST TXT | C EXE | CPM-DDTR TXT | CPM-KOMR TXT
D| D COM | L COM | LAB_1 ASM | LAB_1 COM
D| LAB_1 HEX | LAB_1 PRN | LAB_1 SYM | M COM
D:[cpm] d lab_1.com
DDT VERS 1.0
NEXT PC
0180 0100
-d
0100 3E 18 06 02 80 76 00 00 00 00 00 00 00 00 00 00 >....v..........
0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0180 1A 84 12 13 C3 69 01 D1 2E 00 E9 0E 10 CD 05 00 .....i..........
0190 32 5F 1E C9 21 66 1E 70 2B 71 2A 65 1E EB 0E 11 2_..!f.p+q*e....
01A0 CD 05 00 32 5F 1E C9 11 00 00 0E 12 CD 05 00 32 ...2_..........2
01B0 5F 1E C9 21 68 1E 70 2B 71 2A 67 1E EB 0E 13 CD _..!h.p+q*g.....
-d
0100 3E 18 06 02 80 76 00 00 00 00 00 00 00 00 00 00 >....v..........
0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0180 1A 84 12 13 C3 69 01 D1 2E 00 E9 0E 10 CD 05 00 .....i..........
0190 32 5F 1E C9 21 66 1E 70 2B 71 2A 65 1E EB 0E 11 2_..!f.p+q*e....
01A0 CD 05 00 32 5F 1E C9 11 00 00 0E 12 CD 05 00 32 ...2_..........2
01B0 5F 1E C9 21 68 1E 70 2B 71 2A 67 1E EB 0E 13 CD _..!h.p+q*g.....
-d100,1b0
0100 3E 18 06 02 80 76 00 00 00 00 00 00 00 00 00 00 >....v..........
0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0180 1A 84 12 13 C3 69 01 D1 2E 00 E9 0E 10 CD 05 00 .....i..........
0190 32 5F 1E C9 21 66 1E 70 2B 71 2A 65 1E EB 0E 11 2_..!f.p+q*e....
01A0 CD 05 00 32 5F 1E C9 11 00 00 0E 12 CD 05 00 32 ...2_..........2
01B0 5F _
-d100,1b0
0100 3E 18 06 02 80 76 00 00 00 00 00 00 00 00 00 00 >....v..........
0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0180 1A 84 12 13 C3 69 01 D1 2E 00 E9 0E 10 CD 05 00 .....i..........
0190 32 5F 1E C9 21 66 1E 70 2B 71 2A 65 1E EB 0E 11 2_..!f.p+q*e....
01A0 CD 05 00 32 5F 1E C9 11 00 00 0E 12 CD 05 00 32 ...2_..........2
01B0 5F _
-f100,105,f
-d100
0100 0F 0F 0F 0F 0F 0F 00 00 00 00 00 00 00 00 00 00 ................
0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0180 1A 84 12 13 C3 69 01 D1 2E 00 E9 0E 10 CD 05 00 .....i..........
0190 32 5F 1E C9 21 66 1E 70 2B 71 2A 65 1E EB 0E 11 2_..!f.p+q*e....
01A0 CD 05 00 32 5F 1E C9 11 00 00 0E 12 CD 05 00 32 ...2_..........2
01B0 5F 1E C9 21 68 1E 70 2B 71 2A 67 1E EB 0E 13 CD _..!h.p+q*g.....
-ilab_1.com
-r
NEXT PC
0180 0100
-100
-d100
0100 3E 18 06 02 80 76 00 00 00 00 00 00 00 00 00 00 >....v..........
0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0180 1A 84 12 13 C3 69 01 D1 2E 00 E9 0E 10 CD 05 00 .....i..........
0190 32 5F 1E C9 21 66 1E 70 2B 71 2A 65 1E EB 0E 11 2_..!f.p+q*e....
01A0 CD 05 00 32 5F 1E C9 11 00 00 0E 12 CD 05 00 32 ...2_..........2
01B0 5F 1E C9 21 68 1E 70 2B 71 2A 67 1E EB 0E 13 CD _..!h.p+q*g.....
-l
0100 MVI A,18
0102 MVI B,02
0104 ADD B
0105 HLT
0106 NOP
0107 NOP
0108 NOP
0109 NOP
010A NOP
010B NOP
010C NOP
-l100,105
0100 MVI A,18
0102 MVI B,02
0104 ADD B
0105 HLT
0106
-s101
0101 18
0102 06
0103 02 .
-d100
0100 3E 18 06 02 80 76 00 00 00 00 00 00 00 00 00 00 >....v..........
0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0180 1A 84 12 13 C3 69 01 D1 2E 00 E9 0E 10 CD 05 00 .....i..........
0190 32 5F 1E C9 21 66 1E 70 2B 71 2A 65 1E EB 0E 11 2_..!f.p+q*e....
01A0 CD 05 00 32 5F 1E C9 11 00 00 0E 12 CD 05 00 32 ...2_..........2
01B0 5F 1E C9 21 68 1E 70 2B 71 2A 67 1E EB 0E 13 CD _..!h.p+q*g.....
-a100
0100
-d100
0100 3E 18 06 02 80 76 00 00 00 00 00 00 00 00 00 00 >....v..........
0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0180 1A 84 12 13 C3 69 01 D1 2E 00 E9 0E 10 CD 05 00 .....i..........
0190 32 5F 1E C9 21 66 1E 70 2B 71 2A 65 1E EB 0E 11 2_..!f.p+q*e....
01A0 CD 05 00 32 5F 1E C9 11 00 00 0E 12 CD 05 00 32 ...2_..........2
01B0 5F 1E C9 21 68 1E 70 2B 71 2A 67 1E EB 0E 13 CD _..!h.p+q*g.....
-m100,106,115
-d100
0100 3E 18 06 02 80 76 00 00 00 00 00 00 00 00 00 00 >....v..........
0110 00 00 00 00 00 3E 18 06 02 80 76 00 00 00 00 00 .....>....v.....
0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0180 1A 84 12 13 C3 69 01 D1 2E 00 E9 0E 10 CD 05 00 .....i..........
0190 32 5F 1E C9 21 66 1E 70 2B 71 2A 65 1E EB 0E 11 2_..!f.p+q*e....
01A0 CD 05 00 32 5F 1E C9 11 00 00 0E 12 CD 05 00 32 ...2_..........2
01B0 5F 1E C9 21 68 1E 70 2B 71 2A 67 1E EB 0E 13 CD _..!h.p+q*g.....
-r
NEXT PC
0180 0100
-l100
0100 MVI A,18
0102 MVI B,02
0104 ADD B
0105 HLT
0106 NOP
0107 NOP
0108 NOP
0109 NOP
010A NOP
010B NOP
010C NOP
-u5
C0Z0M0E0I0 A=00 B=0000 D=0000 H=0000 S=0100 P=0100 MVI A,18
*Execution halted
D:[cpm] d lab_1.com
DDT VERS 1.0
NEXT PC
0180 0100
-u
C0Z0M0E0I0 A=00 B=0000 D=0000 H=0000 S=0100 P=0100 MVI A,18*0102
-u
C0Z0M0E0I0 A=18 B=0000 D=0000 H=0000 S=0100 P=0102 MVI B,02*0104
-u
C0Z0M0E0I0 A=18 B=0200 D=0000 H=0000 S=0100 P=0104 ADD B*0105
-u
C0Z0M0E0I0 A=1A B=0200 D=0000 H=0000 S=0100 P=0105 HLT
*Execution halted
D:[cpm] d lab_1.com
DDT VERS 1.0
NEXT PC
0180 0100
-x
C0Z0M0E0I0 A=00 B=0000 D=0000 H=0000 S=0100 P=0100 MVI A,18
-t3
C0Z0M0E0I0 A=00 B=0000 D=0000 H=0000 S=0100 P=0100 MVI A,18
C0Z0M0E0I0 A=18 B=0000 D=0000 H=0000 S=0100 P=0102 MVI B,02
C0Z0M0E0I0 A=18 B=0200 D=0000 H=0000 S=0100 P=0104 ADD B*0105
-xa
A=1A xb
-xa
A=1A
-xb
B=0200
-t
C0Z0M0E0I0 A=1A B=0200 D=0000 H=0000 S=0100 P=0105 HLT
*Execution halted
D:[cpm] d lab_1.com
DDT VERS 1.0
NEXT PC
0180 0100
-t4
C0Z0M0E0I0 A=00 B=0000 D=0000 H=0000 S=0100 P=0100 MVI A,18
C0Z0M0E0I0 A=18 B=0000 D=0000 H=0000 S=0100 P=0102 MVI B,02
C0Z0M0E0I0 A=18 B=0200 D=0000 H=0000 S=0100 P=0104 ADD B
C0Z0M0E0I0 A=1A B=0200 D=0000 H=0000 S=0100 P=0105 HLT
*Execution halted
D:[cpm] d lab_1.com
DDT VERS 1.0
NEXT PC
0180 0100
-g
*Execution halted
D:[cpm] d lab_1.com
DDT VERS 1.0
NEXT PC
0180 0100
-g102,105
*0105
-x
C0Z0M0E0I0 A=02 B=0200 D=0000 H=0000 S=0100 P=0105 HLT
PRN ФАЙЛ:
0100 ORG 100H
0100 3E18 MVI A,24 ; заносимо в акумулятор число 24
0102 0602 MVI B,2 ; заносимо в регістр В число 2
0104 80 ADD B ; додаємо вміст регістра В до акумулятора, результат заносимо в акумулятор
0105 76 HLT
ВИСНОВОК:
Під час виконання лабораторної роботи я ознайомився із засобами компіляції, лінкування і відлагоджування програм за допомогою компілятора CP/M. Я вивчив основні команди емулятора CP/M та навчився працювати з відлагоджувачем. Мною була написана, скомпільована та відлагоджена програма, яка обчислює суму двох чисел. Крім цього я вивчив регістри та навчився їх застосовувати при створенні програми.