Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- assume cs: code, ds: data
- data segment
- newline db 0Ah, '$'
- msg db 100, 99 dup (0)
- sum db 00h
- string db 100, 99 dup (0)
- string1 db 100, 99 dup (0)
- data ends
- code segment
- donewline proc
- mov dx, offset newline
- mov ah, 09h
- int 21h
- ret
- donewline endp
- addbig proc
- push bp
- mov bp, sp
- mov di, offset msg
- metka2:
- inc di
- loop metka2
- mov cx, ax
- std
- mov al, 24h
- stosb
- mov si, [bp+4]
- mov bx, [bp+6]
- sum:
- mov al, byte ptr[si]
- sub al, 30h
- mov dl, byte ptr[bx]
- sub dl, 30h
- add al, dl
- add al, 30h
- stosb
- dec si
- dec bx
- loop sum
- mov ah, 09h
- mov dx, offset msg
- int 21h
- mov ah, 4ch
- int 21h
- addbig endp
- start: mov ax, data
- mov ds, ax
- mov es, ax
- mov dx, offset string
- mov bx, offset string1
- mov ah, 0Ah
- int 21h
- call donewline
- mov dx, bx
- mov ah, 0Ah
- int 21h
- call donewline
- mov si, offset string
- mov bx, offset string1
- mov ah, 00h
- mov al, byte ptr[si+1]; сколько элементов в первой строке
- mov cx, ax
- metka:
- inc si
- loop metka
- mov al, byte ptr[bx+1]
- mov cx, ax
- metka1:
- inc bx
- loop metka1
- cmp byte ptr[si+1], al
- jl greater
- jmp L1
- greater:
- mov al, byte ptr[si+1]
- jmp L1
- L1:
- mov cx, ax
- dec cx
- push si
- push bx
- call addbig
- mov ah, 4ch
- int 21h
- code ends
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement