StudyDocs.ru Logo

Otchyot_SPro_Laba4.docx


Отчёт по Лабораторной работе №4По дисциплине «Системное программирование»
ВыполнилаСт.грНФ-10-1Михайлова Александра
Задание: В матрице 5х5 элементов поменять местами 3 столбец и вторую строчку.
Код программы:.model tinyextrn crlf:near, bdec:near, msg:near.code org 100hprogr: jmp begin M1 db 'primary matrix:',10,13,'$' M2 db 'changing matrix:',10,13,'$' matr db 1,2,3,4,5 db 0,0,3,0,0 db 9,8,3,7,6 db 5,4,3,2,1 db 7,8,3,6,2begin: mov dx, offset M1 call msg xor cx,cx xor bl,bl mov cx, 25 mov si, offset matr work: mov al,cs:[si] call bdec inc bl cmp bl,5 jne n call crlf xor bl,bl n: inc si loop work mov cx,5 mov di, offset matr+2 mov si, offset matr+5 change: mov al,cs:[si] xchg al,cs:[di] xchg al,cs:[si] inc si add di,5 loop change mov dx, offset M2 call msg xor cx,cx xor bl,bl mov cx, 25 mov si, offset matr work2: mov al,cs:[si] call bdec inc bl cmp bl,5 jne m call crlf xor bl,bl m: inc si loop work2 mov ah,4Ch int 21hend progr












Файл LAB4.LSTTurbo Assembler Version 3.1 06/12/11 10:41:18 Page 1lab4.asm


1 0000 .model tiny 2 extrn crlf:near, bdec:near, msg:near 3 0000 .code 4 org 100h 5 0100 progr: 6 0100 EB 3F 90 jmp begin 7 0103 70 72 69 6D 61 72 79+ M1 db 'primary matrix:',10,13,'$' 8 20 6D 61 74 72 69 78+ 9 3A 0A 0D 24 10 0115 63 68 61 6E 67 69 6E+ M2 db 'changing matrix:',10,13,'$' 11 67 20 6D 61 74 72 69+ 12 78 3A 0A 0D 24 13 0128 01 02 03 04 05 matr db 1,2,3,4,5 14 012D 00 00 03 00 00 db 0,0,3,0,0 15 0132 09 08 03 07 06 db 9,8,3,7,6 16 0137 05 04 03 02 01 db 5,4,3,2,1 17 013C 07 08 03 06 02 db 7,8,3,6,2 18 0141 begin: 19 0141 BA 0103r mov dx, offset M1 20 0144 E8 0000e call msg 21 0147 33 C9 xor cx,cx 22 0149 32 DB xor bl,bl 23 014B B9 0019 mov cx, 25 24 014E BE 0128r mov si, offset matr 25 0151 work: 26 0151 2E: 8A 04 mov al,cs:[si] 27 0154 E8 0000e call bdec 28 0157 FE C3 inc bl 29 0159 80 FB 05 cmp bl,5 30 015C 75 05 jne n 31 015E E8 0000e call crlf 32 0161 32 DB xor bl,bl 33 0163 n: 34 0163 46 inc si 35 0164 E2 EB loop work 36 0166 B9 0005 mov cx,5 37 0169 BF 012Ar mov di, offset matr+2 38 016C BE 012Dr mov si, offset matr+5 39 016F change: 40 016F 2E: 8A 04 mov al,cs:[si] 41 0172 2E: 86 05 xchg al,cs:[di] 42 0175 2E: 86 04 xchg al,cs:[si] 43 0178 46 inc si 44 0179 83 C7 05 add di,5 45 017C E2 F1 loop change 46 017E BA 0115r mov dx, offset M2 47 0181 E8 0000e call msg 48 0184 33 C9 xor cx,cx 49 0186 32 DB xor bl,bl 50 0188 B9 0019 mov cx, 25 51 018B BE 0128r mov si, offset matr 52 018E work2: 53 018E 2E: 8A 04 mov al,cs:[si] 54 0191 E8 0000e call bdec 55 0194 FE C3 inc bl 56 0196 80 FB 05 cmp bl,5 57 0199 75 05 jne m


Turbo Assembler Version 3.1 06/12/11 10:41:18 Page 2lab4.asm


58 019B E8 0000e call crlf 59 019E 32 DB xor bl,bl 60 01A0 m: 61 01A0 46 inc si 62 01A1 E2 EB loop work2 63 01A3 B4 4C mov ah,4Ch 64 01A5 CD 21 int 21h 65 end progr


Turbo Assembler Version 3.1 06/12/11 10:41:18 Page 3Symbol Table



Symbol Name Type Value
??DATE Text "06/12/11"??FILENAME Text "lab4 "??TIME Text "10:41:18"??VERSION Number 030A@32BIT Text 0@CODE Text DGROUP@CODESIZE Text 0@CPU Text 0101H@CURSEG Text _TEXT@DATA Text DGROUP@DATASIZE Text 0@FILENAME Text LAB4@INTERFACE Text 00H@MODEL Text 1@STACK Text DGROUP@WORDSIZE Text 2BDEC Near ----:---- ExternBEGIN Near DGROUP:0141CHANGE Near DGROUP:016FCRLF Near ----:---- ExternM Near DGROUP:01A0M1 Byte DGROUP:0103M2 Byte DGROUP:0115MATR Byte DGROUP:0128MSG Near ----:---- ExternN Near DGROUP:0163PROGR Near DGROUP:0100WORK Near DGROUP:0151WORK2 Near DGROUP:018E
Groups & Segments Bit Size Align Combine Class
DGROUP Group _DATA 16 0000 Word Public DATA _TEXT 16 01A7 Word Public CODE