Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Моя курсовай МПС.docx
Скачиваний:
8
Добавлен:
19.12.2018
Размер:
335.07 Кб
Скачать

Список используемых источников

  1. Юров В.И. Assembler. Учебник для вузов. 2-е издание – СПб.: Питер, 2006. – 637 с.

  2. Зубков С.В. Assembler для DOS, Windows и Unix. 3-е издание – М.: ДМК Пресс; СПб.: Питер, 2004. – 608 с.: ил.

  3. Пирогов В.Ю. Assembler. Учебный курс. 3-е издание - М.: Нолидж, 2001. – 848 с.: ил.

  4. Павловская Т.А. Программирование на языке высокого уровня C#

Приложение а – Код основной программы

  1. .486

  2. CodeSg segment 'CODE' use16

  3. assume CS:CodeSg, DS:DataSg, SS:StackSg

  1. Begin: mov AX,DataSg

  2. mov DS,AX

  3. push ds

  4. pop es

  5. cld

  6. Call OpenUK

  7. ;

  8. lea dx,buffer

  9. mov cx,Variant

  10. dec cx

  11. cmp cx,0

  12. ;

  13. Call CreationMy

  14. ;

  15. Call NewStr

  16. ;

  17. Call CloseCadr

  18. ;

  19. Call Cursor

  20. ;

  21. Call NextStr

  22. ;

  23. Exit:

  24. mov ah,4ch

  25. int 21h

  26. ;

  27. OpenUK proc

  28. mov ah,3dh

  29. mov al,0

  30. lea dx,uk64

  31. int 21h

  32. mov handle1,ax

  33. mov bx,ax

  34. ret

  35. OpenUK endp

  36. ;

  37. CreationMy proc

  38. mov ah,3ch

  39. mov cx,0

  40. lea dx,my

  41. mov handle2,ax

  42. lea dx,buffer

  43. int 21h

  44. ret

  45. CreationMy endp

  46. ;

  47. NewStr proc

  48. m3:

  49. mov cx,16

  50. mov ah,3fh

  51. mov bx,handle1

  52. int 21h

  53. cmp ax,16

  54. jne m2

  55. mov di,dx

  56. mov cx,16

  57. mov ax,0

  58. repe scasb

  59. je m2

  60. mov bx,handle2

  61. mov cx,16

  62. mov ah,40h

  63. int 21h

  64. jmp short m3

  65. m2:

  66. ret

  67. NewStr endp

  68. ;

  69. CloseCadr proc

  70. mov bx,handle1

  71. mov ah,3eh

  72. int 21h

  73. mov ah,3ch

  74. mov cx,0

  75. lea dx,res

  76. int 21h

  77. mov handle1,ax

  78. ret

  79. CloseCadr endp

  80. ;

  81. Cursor proc

  82. xor ax,ax

  83. xor cx,cx

  84. xor dx,dx

  85. mov ah,42h

  86. mov bx,handle2

  87. int 21h

  88. ret

  89. Cursor endp

  90. ;

  91. NextStr proc

  92. pop bp

  93. FormByte:

  94. mov cx,4

  95. mov bx,handle2

  96. lea dx,buffer

  97. m5:

  98. push cx

  99. push ax

  100. mov cx,16

  101. mov ah,3fh

  102. int 21h

  103. cmp ax,16

  104. jne EndCanal

  105. pop ax

  106. bt word ptr buffer[sms1],face1

  107. rcl ah,1

  108. bt word ptr buffer[sms2],face2

  109. rcl ah,1

  110. pop cx

  111. loop m5

  112. mov buffer,ah

  113. mov ah,40h

  114. mov bx,handle1

  115. mov cx,1

  116. int 21h

  117. jmp short FormByte

  118. EndCanal:

  119. pop ax

  120. pop ax

  121. mov ah,3eh

  122. mov bx,handle1

  123. int 21h

  124. mov bx,handle2

  125. push bp

  126. int 21h

  127. ret

  128. NextStr endp

  129. ;

  130. CodeSg ends

  131. DataSg segment 'DATA' use16

  132. Variant equ 1

  133. face1 equ 2

  134. face2 equ 5

  135. sms1 equ 0

  136. sms2 equ 5

  137. UK64 db 'UK64.dat',0

  138. my db 'my.dat',0

  139. res db 'result.dat',0

  140. buffer db 16 dup(?),'$'

  141. handle1 dw ?

  142. handle2 dw ?

  143. DataSg ends

  144. StackSg segment stack 'STACK' use16

  145. db 256 dup(0)

  146. StackSg ends

  147. end Begin

Приложение b – Код программы построения графика

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.IO;

namespace WindowsFormsApplication12

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)

{

BinaryReader binReader = new BinaryReader(File.Open(openFileDialog1.FileName, FileMode.Open));

chart1.Series[0].Points.Clear();

int x = 0;

while (binReader.BaseStream.Position < binReader.BaseStream.Length)

{

byte c = binReader.ReadByte();

chart1.Series[0].Points.AddXY(x, c);

x++;

}

binReader.Close();

}

}

private void button2_Click(object sender, EventArgs e)

{

Application.Exit();

}

34