code segment
org 100h
assume cs:code, ds:code
start:
mov ah, 2
mov dl, 78
int 21h
mov dl, 61
int 21h
dec ah
int 21h
sub ax, 304
xor cx, cx
mov di, ax
mov dx, di
mov si, 2
l1:
inc cx
cmp cx, dx
jne c1
cmp si, 2
jne c2
mov si, di
shl si, 1
dec ax
jmp c3
c2:
mov si, 2
neg bp
c3:
add dx, ax
c1:
mov m[bx], cx
cmp bp, 0
jl c5
add bx, si
jmp c6
c5:
sub bx, si
c6:
cmp al, ah
jne l1
mov cx, di
xor bl, bl
mov ah, 2
outstr:
push cx
mov cx, di
mov dl, 10
outel:
int 21h
mov ax, m[bx]
mov dl, 10
div dl
or ax, 12336
mov dx, ax
mov ah, 2
int 21h
mov dl, dh
int 21h
mov dl, 32
add bl, ah
loop outel
pop cx
loop outstr
ret
m dw ?
code ends
end start