SHOW:
|
|
- or go back to the newest paste.
| 1 | data segment | |
| 2 | - | arr1 DB 36 dup (?) |
| 2 | + | arr1 DB 1,2,3,4,5,1,2,3 |
| 3 | - | arr2 DB 36 dup (?) |
| 3 | + | arr2 DB 8 dup (0) |
| 4 | ends | |
| 5 | ||
| 6 | stack segment | |
| 7 | dw 128 dup(0) | |
| 8 | ends | |
| 9 | ||
| 10 | code segment | |
| 11 | start: | |
| 12 | mov ax, data | |
| 13 | mov ds, ax | |
| 14 | mov es, ax | |
| 15 | ||
| 16 | mov si,0 | |
| 17 | mov di,0 | |
| 18 | mov bx,0 | |
| 19 | - | mov cx,36 |
| 19 | + | mov cx,8 |
| 20 | ||
| 21 | looper: | |
| 22 | mov di, 0 | |
| 23 | mov al, arr1[si] | |
| 24 | scan: | |
| 25 | cmp al, arr2[di] | |
| 26 | je foundscan | |
| 27 | inc di | |
| 28 | - | cmp di, 36 |
| 28 | + | cmp di, 8 |
| 29 | jne scan | |
| 30 | - | mov arr2[bx], al |
| 30 | + | mov arr2[bx], al |
| 31 | - | inc bx |
| 31 | + | inc bx |
| 32 | foundscan: | |
| 33 | inc si | |
| 34 | - | cmp si, 36 |
| 34 | + | cmp si, 8 |
| 35 | jne looper | |
| 36 | ends | |
| 37 | ||
| 38 | end start |