org 100h
.data
dt1 dw 500 dup(0)
.code
mov ax,@data
mov ds,ax
mov si, offset dt1
mov bx,1000
mov cx,500
label:
mov [si],bx
add bx,0002
inc si
inc si
loop label
hlt
note: see in memory in two byte CE and 06 equal 1998 , so it down 1996 see cc,07
another way for find even number from 1000 to 1500:
org 100h
.data
dt1 db 250 dup(0)
.code
mov ax,@data
mov ds,ax
mov si,offset dt1
mov cx,1000
mov bx,02
new:
mov [si],cx
add cx,bx
add si,bx
cmp cx,1500
jle new
ret
0 التعليقات:
إرسال تعليق