Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multi-segment executable file template.
- data segment
- ; add your data here!
- arr1 DB 1,2,2,4,1,6,6,6
- arr2 DB 8 dup (0)
- ends
- stack segment
- dw 128 dup(0)
- ends
- code segment
- start:
- ; set segment registers:
- mov ax, data
- mov ds, ax
- mov es, ax
- mov si,0
- mov bx,0
- mov cx,7
- first:
- mov al,arr1[bx]
- jmp before_check:
- a1:
- mov arr2[si],al
- inc si
- inc bx
- cmp bx, 8
- jne first
- jmp finish
- before_check:
- mov di,0
- check:
- mov dl,arr2[di]
- cmp al,dl
- jz a2
- inc di
- cmp di,7
- jz a1
- jmp check
- a2:
- inc bx
- cmp bx,8
- je finish
- jmp first
- finish: nop
- ends
- end start ; set entry point and stop the assembler.
Advertisement
Add Comment
Please, Sign In to add comment