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!
- pkey db "press any key...$"
- niza db 99d
- element db 2d
- vnesen db ?
- ends
- stack segment
- dw 128 dup(0)
- ends
- code segment
- start:
- ; set segment registers:
- mov ax, data
- mov ds, ax
- mov es, ax
- mov bx, offset niza
- mov cl, 0d
- mov ah, 01h
- int 21h
- sub al,'0'
- mov bl, 10d
- mul bl
- mov vnesen, al
- mov ah, 01h
- int 21h
- sub al, '0'
- add vnesen, al
- polnenje:
- mov dl, 2d
- mov al, cl
- mul dl
- add al, element
- mov element, al
- ;mov dl, al
- ;mov ah,02h
- ;int 21h
- inc bx
- inc cl
- cmp cl, vnesen
- je izdvoj
- jne polnenje
- izdvoj:
- mov al, element
- mov bl, 10d
- div bl
- mov dl, ah
- add dl, 48d
- mov ah, 02h
- int 21h
- mov ax, 4c00h ; exit to operating system.
- int 21h
- ends
- end start ; set entry point and stop the assembler.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement