I can't wrap my head around this problem. I want to print all numbers from 0 - 255 divisible by user input ( 1 - 9), yet the way I'm trying to do it I would need more registers, because currently the registers would be overwritten.
Is there any easier / simpler way of doing this?
org 100h
section .text
mov ah,1
int 21h
sub al,'0'
mov bl,al
mov cx,255
@LOOP:
mov ax,cx
mov ah,0
xor dx, dx
div bx
cmp dx, 0
je ;redirect to printing loop
loop @LOOP
;PRINTING LOOP
mov bx,10
xor cx,cx
@a: xor dx,dx
div bx
push dx
inc cx
test ax,ax
jnz @a
@b: pop dx
add dl,"0"
mov ah,02h
int 21h
loop @b
;PRINTING LOOP