Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- NL_ equ 0dh, 0ah
- start:
- mov ah, 9 ;output - helloStr
- mov dx, helloStr_
- int 21h
- mov ah, 0ah ;input - string
- mov dx, buffStr_
- int 21h
- mov ah, 2 ;output - new line
- mov dx, 0d0ah
- int 21h
- cld ;direction - forward (df = 0)
- mov si, buffStr_ ;SOURCE address...
- add si, 12 ;first two bytes MAX_LEN and LEN + tenth symbol = +12
- mov di, destStr_ ;DESTINATION address
- mov cx, 6 ;10 11 12 13 14 15 - 6 symbols
- rep movsb ;repeat movsb (movs byte), until cx = 0
- mov ah, 9 ;output - resultStr
- mov dx, resultStr_
- int 21h
- mov dx, destStr_ ;output - copied string
- int 21h
- mov dx, byeStr_ ;output - byeStr
- int 21h
- mov ah, 7 ;wait for input
- int 21h
- ret
- helloStr_ db "This program transfers bytes 10 to 15", NL_, "Input string with length of 16:", NL_ , "$"
- buffStr_ db 17, 0, 17 dup (?)
- destStr_ db "******$"
- resultStr_ db "Result string:", NL_, "$"
- byeStr_ db NL_, "The program has now terminated.$"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement