Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multi-segment executable file template.
- data segment
- ; add your data here!
- stringa db 50 dup(?)
- stringa_nov db 50 dup(?)
- stringb db 50 dup(?)
- stringb_nov db 50 dup(?)
- transformations db 0
- isti db "isti se$"
- razlicni db "ne se isti$"
- ends
- stack segment
- dw 128 dup(0)
- ends
- code segment
- start:
- ; set segment registers:
- mov ax, data
- mov ds, ax
- mov es, ax
- ; add your code here
- lea bx, stringa
- push bx
- call citaj
- lea dx, stringa_nov
- push dx
- mov si, bx
- push si
- call transform
- pop dl
- mov dh, 0
- lea al, transformations
- mov ah, 0
- add dl
- mov al, tranformations
- lea bx, stringb
- push bx
- call citaj
- lea dx, stringb_nov
- push dx
- mov si, bx
- push si
- call transform
- pop dl
- mov dh, 0
- lea al, transformations
- mov ah, 0
- add dl
- mov al, tranformations
- call sporedi
- mov ax, 4c00h ; exit to operating system.
- int 21h
- transform proc:
- pop dx ;IP
- pop si ; stringa
- pop di ; stringa_nov
- mov bl, 0
- l1:
- lodsb
- cmp al, 96
- jg store
- add al, 32
- inc bl
- store:
- stosb
- loop l1
- push bl
- push dx
- ret
- transfrom endp
- citaj proc:
- pop dx
- pop di
- l2:
- mov ah, 1
- int 21h
- cmp al, 24h
- je prodolzi
- stosb
- loop l2
- prodolzi:
- push dx
- ret
- citaj endp
- sporedi proc:
- pop dx
- lea si, stringa_nov
- lea di, stringb_nov
- repe cmpsb
- jne else
- lea dx, isti
- mov ah, 9
- int 21h
- else:
- lea dx,neisti
- mov ah, 9
- int 21h
- push dx
- ret
- sporedi endp
- ends
- lodsb
- end start ; set entry point and stop the assembler.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement