Advertisement
Egor_Vakar

KPO lab1

Feb 17th, 2022
1,545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         org 100h
  2. Start:
  3.         mov ah, $09
  4.         mov dx, FirstString
  5.         int 21h
  6.  
  7.         mov ah,$09
  8.         mov dx,EmptyString
  9.         int 21h
  10.  
  11.         mov ah,$09
  12.         mov dx,forInputStr
  13.         int 21h
  14.  
  15.         mov ah,$09
  16.         mov dx,EmptyString
  17.         int 21h
  18.  
  19.         mov ah,$0A
  20.         mov dx,bufInput
  21.         int 21h
  22.  
  23.         mov ah,$09
  24.         mov dx,EmptyString
  25.         int 21h
  26.  
  27.         mov ah,$09
  28.         mov dx,forAnswer
  29.         int 21h
  30.  
  31.         mov ah,$09
  32.         mov dx,EmptyString
  33.         int 21h
  34.  
  35.  
  36.         mov [bufInput + 11], '$'
  37.         mov dl, [bufInput + 2]
  38.         mov al, [bufInput + 10]
  39.         mov [bufInput + 2], al
  40.         mov [bufInput + 10], dl
  41.         mov al, [bufInput + 4]
  42.         sub al, [bufInput + 6]
  43.         mov dl, [bufInput + 8]
  44.         sub dl, al
  45.         mov [bufInput + 3], dl
  46.         mov ah,$09
  47.         mov dx,bufInput + 2
  48.         int 21h
  49.  
  50.         mov ah,8
  51.         int 21h
  52.         ret
  53.  
  54.  
  55.  
  56. FirstString: db "There are operations with input string: change S9 and S1, S2 <= S7 - (S3 - S5)$"
  57.  
  58. EmptyString: db 10,13,"$"
  59.  
  60. bufInput db 10, 0, 10 dup(?)
  61.  
  62. forInputStr: db "Enter string of 9 characters:$"
  63.  
  64. forAnswer: db "Answer is:$"
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement