dseg segment
tab db '0123456789ABCDEF'
str db 4 dup(?),'$'
dseg ends
cseg segment
assume cs:cseg,ds:dseg
begin: mov ax,dseg
mov ds,ax
mov ax,1
mov bx,2
mov cx,99
next: add ax,bx
inc bx
loop next
call disp
mov ah,4ch
int 21h
disp proc
lea si,str
mov cl,4
mov di,4
abc: rol ax,cl
mov dx,ax
and ax,0fh
lea bx,tab
xlat
mov [si],al
inc si
mov ax,dx
dec di
jnz abc
lea dx,str
mov ah,9
int 21h
ret
disp endp
cseg ends
end begin
MOV R0,#0
MOV R1,#1
LOOP
ADD R0,R0,R1
ADD R1,R1,#1
CMP R1,#101
BNE LOOP
END
MOV R0,#0
MOV R1,#1
LOOP
ADD R0,R0,R1
ADD R1,R1,#1
CMP R1,#101
BNE LOOP
END