Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format MZ
- entry text:main
- stack stk:256
- segment stk use16 ;stack
- db 256 dup(?)
- segment data_16 use16
- example: ;data
- db 'TOMek',24h,'$'
- db 0dh,0ah,'$'
- segment text use16
- main:
- mov ax,data_16
- mov ds,ax
- mov ax,stk
- mov ss,ax
- mov sp,256
- mov si,example
- mov cl,5 ;Okreslenie ilosci liter
- mov dh,5Ah
- mov ch,25 ;25 liter w alfabecie
- jmp change
- savestate: mov byte[ds:si], AL ;Zapisanie wartosci do pamieci
- inc si
- dec cl
- jnz change
- jmp finish
- change: mov AL,byte[ds:si]
- decide: ;Rozpoznanie wielkosci litery
- cmp al,dh
- jle lower
- dec ch
- jnz decide
- jmp higher
- lower: ;Dodanie 20h powodujace zmiane wielkosci
- mov dh,5Ah
- mov ch,25
- add al,20h
- jmp savestate
- higher: ;Odjecie 20h
- mov dh,5Ah
- mov ch,25
- sub al,20h
- jmp savestate
- finish:
- mov bx,0
- mov ah,9
- mov dx,example ;Wyswietlanie
- int 21h
- mov ah,1
- int 21h
- mov ax,4c00h ;zakonczenie programu
- int 21h
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement