I'll show how to output the elements that are not greater than the mean value. To output an integer you first convert the number into text.
...
idiv n ; -> AX=mean
mov dx,ax ; -> DX=mean
mov cx,n ; -> CX=count
xor si,si
Show:
mov ax, mas[si]
add si, 2
cmp ax,dx
jg Skip
pusha
; Insert here YourRoutineThatOutputsAnInteger
mov dl,32
mov ah,2
int 21h ;Output a space to separate numbers
popa
Skip:
loop Show
mov ax, 4c00h ; exit to operating system.
int 21h
...
MyRoutineThatOutputsAnInteger
mov bx,sp
mov cx,10
next:
xor dx,dx
div cx
add dl,30h
push dx
test ax,ax
jnz next
print:
pop dx
mov ah,2
int 21h
cmp sp,bx
jb print
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…