2 program TASM forrását közlöm, az első 8 bites számot, a második 16 bites számot tud kiírni

A 8 bites:

model small
.stack

data segment
num db 255d
data ends

code segment
assume cs:code,ds:data

start:
mov ax,data
mov ds,ax
mov al,num
mov bl,0Ah
xor cx,cx
loopproc:
xor ah,ah
div bl
mov dl,ah
push dx
inc cx
cmp al,0h
jne loopproc

mov ah,02h

loopout:
pop dx
add dl,30h
int 21h
loop loopout

xor ah,ah
int 16h
mov ah,4ch
int 21h

code ends
end start



A 16 bites:

model small
.stack

data segment
num dw 1234d
data ends

code segment
assume cs:code,ds:data

start:
mov ax,data
mov ds,ax
mov ax,num
mov bx,0Ah
xor cx,cx
loopproc:
xor dx,dx
div bx
push dx
inc cx
cmp ax,0h
jne loopproc

mov ah,02h

loopout:
pop dx
add dl,30h
int 21h
loop loopout

xor ah,ah
int 16h
mov ah,4ch
int 21h

code ends
end start