Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.14 KB | None | 0 0
  1. ;==========================================================================
  2. ;Name:
  3. ;Neptun code:
  4. ;Date: 19.12.2016
  5. ;
  6. ;==========================================================================
  7. Code Segment
  8. assume CS:Code, DS:Data, SS:Stack
  9.  
  10. Start:
  11.  
  12. mov ax, Code
  13. mov DS, AX
  14.  
  15. mov ax, 03h
  16. int 10h
  17.  
  18. mov ah,9
  19. mov dx, offset task1
  20. int 21h
  21.  
  22. mov dh, 2
  23. mov dl, 5
  24. xor bx, bx
  25. mov ah, 02
  26. int 10h
  27.  
  28. xor ax, ax
  29. xor bx, bx
  30. xor cx, cx
  31. xor dx, dx
  32. xor di, di
  33. xor si, si
  34.  
  35. ;Task_1:
  36. ;==========================================================================
  37. ;1. Task:
  38. ; Fill the "name" string (you can be found it at strings) with your own name, with lowercase letters
  39. ; using only english letters (eg "joe black"), and then display it in the next form:
  40. ; BLACK, Joe
  41. ; That is : SURENAME, Firstname
  42. ;==========================================================================
  43.  
  44. ;**************************************************************************
  45. ;Write here the appropriate program part, using the code found here!
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. ;so far
  54. ;**************************************************************************
  55. xor ax, ax
  56. int 16h
  57.  
  58. ;==========================================================================
  59. ;2. task:
  60. ; VGA (320x200px, 8bit)
  61. ; Draw a square standing on his vertex.
  62. ; length of sides: 64pixel
  63. ; coordinates of the upper vertex is in CX register!
  64. ;
  65. ;**************************************************************************
  66. ;VGA mode
  67. mov ax, 13h
  68. int 10h
  69. mov ax, 0a000h
  70. mov es, ax
  71.  
  72. xor ax, ax
  73. xor bx, bx
  74. xor dx, dx
  75. xor di, di
  76. xor si, si
  77.  
  78. ;start coordinates
  79. mov cl,100 ;row
  80. mov ch,100 ;column
  81.  
  82. ;**************************************************************************
  83. ;Write here the appropriate program part!
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. ;so far
  91. ;==========================================================================
  92. Var:
  93. xor ax,ax
  94. int 16h
  95.  
  96. Task_3:
  97. ;===========================================================================
  98. ; 3. task:
  99. ;
  100. ; Perform the operation founded in 'operation' string!
  101. ; The two number (0..9, single digits!), and the operation(+,-,*,/) can be any,
  102. ; the string content has to process!
  103. ;
  104. ; There is enough to display only one character as a result! The div enough to display the result,
  105. ; the residue should not!
  106. ;
  107. ; Display the operation, and the result (single digits)!
  108. ; eg: 3+2=5
  109. ; 3-2=1
  110. ; 3*2=6
  111. ; 3/2=1
  112. ;===========================================================================
  113. mov ax, 03h
  114. int 10h
  115.  
  116. mov ah,9
  117. mov dx, offset task3
  118. int 21h
  119.  
  120. mov dh, 2
  121. mov dl, 5
  122. xor bx, bx
  123. mov ah, 02
  124. int 10h
  125.  
  126. mov ah,9
  127. mov dx, offset operation
  128. int 21h
  129.  
  130.  
  131. xor ax, ax
  132. xor bx, bx
  133. xor cx, cx
  134. xor dx, dx
  135. xor di, di
  136. xor si, si
  137.  
  138.  
  139. ; --------------------------------------------------------------------------
  140. ;Write here the appropriate program part!
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. ; so far
  148. ; --------------------------------------------------------------------------
  149. ; Waiting for a keystroke
  150. xor ax, ax
  151. int 16h
  152.  
  153.  
  154. Task_4:
  155. ;------------------------------------------------------------------------
  156. ; 4. task:
  157. ;
  158. ; Hexadecimal->Decimal conversion
  159. ; Display in decimal format the number founded in "number" string. (max. value: 0FFh)!
  160. ;-------------------------------------------------------------------------
  161.  
  162. mov ax, 03h
  163. int 10h
  164.  
  165. mov dx, offset task4
  166. mov ah, 09h
  167. int 21h
  168.  
  169. mov dh, 2
  170. mov dl, 5
  171. xor bx, bx
  172. mov ah, 02
  173. int 10h
  174.  
  175. mov dx, offset number
  176. mov ah, 09h
  177. int 21h
  178.  
  179.  
  180. ;-------------------------------------------------------------------------
  181. ;Write here the appropriate program part!
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194. ; so far
  195. ; ------------------------------------------------------------------------
  196. ; Waiting for a keystroke
  197. xor ax, ax
  198. int 16h
  199.  
  200. ;===========================================================================
  201. ; 5. task:
  202. ;
  203. ; Display the sentence5 string at the 10th row!
  204. ; The string shall move from left side to right side on tbe screen,
  205. ; and back, twice.
  206. ;
  207. ;===========================================================================
  208. mov ax, 03h
  209. int 10h
  210.  
  211. mov ah,9
  212. mov dx, offset task5
  213. int 21h
  214.  
  215. xor ax, ax
  216. xor bx, bx
  217. xor cx, cx
  218. xor dx, dx
  219. xor di, di
  220. xor si, si
  221. ; --------------------------------------------------------------------------
  222. ;Write here the appropriate program part!
  223.  
  224.  
  225.  
  226. ; so far
  227.  
  228. ;**************************************************************************
  229. ; Waiting for a keystroke
  230. xor ax, ax
  231. int 16h
  232.  
  233. ;===========================================================================
  234. ; 6. task:
  235. ;
  236. ; Automatic exit
  237. ; Use the exit6 string! Fill it with '*' character per second,
  238. ; and when it reaches the end of the string, exits!
  239. ; 1 second = 18 tick!
  240. ; With the length of the string can be change the exit time!
  241. ; Sample:
  242. ; "| |$"
  243. ; "|* |$"
  244. ; "|** |$"
  245. ; "|*** |$"
  246. ; "|**** |$"
  247. ; "|***** |$"
  248. ; "|****** |$"
  249. ; "|*******|$" -> JMP End_Program
  250. ;
  251. ;===========================================================================
  252. mov ax, 03h
  253. int 10h
  254.  
  255. mov dx, offset task6
  256. mov ah,9
  257. int 21h
  258.  
  259. mov dh, 2
  260. mov dl, 5
  261. xor bx, bx
  262. mov ah, 02
  263. int 10h
  264.  
  265. mov dx, offset exit6
  266. mov ah,9
  267. int 21h
  268.  
  269. xor ax, ax
  270. xor bx, bx
  271. xor cx, cx
  272. xor dx, dx
  273. xor di, di
  274. xor si, si
  275.  
  276. ; --------------------------------------------------------------------------
  277. ;Write here the appropriate program part!
  278.  
  279.  
  280.  
  281. ; so far
  282.  
  283. ;**************************************************************************
  284. ; Waiting for a keystroke
  285. xor ax, ax
  286. int 16h
  287.  
  288. End_Program:
  289. mov ax, 3
  290. int 10h
  291.  
  292. pop ax
  293. mov ax, 4c00h
  294. int 21h
  295.  
  296. ;strings:
  297. task1 db "1. task, Name: $"
  298. nev db "studentname lowercase$"
  299.  
  300. task3 db "3. task: Operation: $"
  301. muvelet db "3+2=$"
  302.  
  303.  
  304. task4 db "4. task: Hexadecimal -> Decimal$"
  305. szam db "0A1h=$"
  306.  
  307. task5 db "5. task: Moving string: $"
  308. sentence5 db "Wow moves!"
  309.  
  310. task6 db "6. task: automatic exit: $"
  311. exit6 db "| |$"
  312.  
  313.  
  314.  
  315.  
  316.  
  317. Code Ends
  318.  
  319. Data Segment
  320.  
  321. Data Ends
  322.  
  323. Stack Segment
  324.  
  325. Stack Ends
  326. End Start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement