journal of all scince V.1. NO.1 | Page 31
n dw 65535
x dw?
seg1 ends
seg2 segment
Assume CS:seg2, DS:seg1
L: MOV ax,seg1
Mov ds,ax
MOV CX,0
MOV BX,10
mov ax,n
Q: Mov dx,0
DIV BX
inc CX
CMP ax,0
JNE Q
Mov x,cx
mov ah,4ch
int 21H
seg2 ends
end L
n . 1 % C% Q
:V `
Seg1 Segment
n dw 1000
s dw ?
Seg1 ends
Seg2 Segment
Assume CS : Seg2 , DS:Seg1
L:MOV ax, Seg1
MOV DS, ax
MOV ax,0
MOV bx , n
b:Cmp bx,0
Je L1
add ax,bx
dec bx( 3% = 6" )
jmp b
L1: mov s,ax
MOV AH, 4 CH
Int 21H
Seg2 ends
End L
F@
(" & ("# 3<&D : C,Q 01/
^F. J @
J % [ ] * EC %
.8
. 8
*_ 2 > n) . _
_ 0 ... n-1 o
_H
%^B ram
_ RAM
8_
+ C
_
?% 8
+U%
S 8. I %
% =_ [_ 5
.8
8
W
@:
n7- % %
& ("# -1-5
W
M..
n7"
%
? @A5
* V* / J^F. '("# •
.
W
% .(RAM