. model small
. stack 100
.data
count db 0
num db 223
. code
main proc
mov ax , @data
mov ds , ax
mov cl , 16 ;divide by
mov ax , 0
mov al , num
again1:
mov dx , 0 ; puting 0 in the high part of the divided number (DX:AX)
div cx ; DX:AX/cx. ax=dx:ax/cx and dx=dx:ax%cx(modulus)
cmp dl , 9
ja kytu ; neu dx >9 thi chuyen sang ky tu (A-F)
cmp dl , 9
jna so ; neu dx < 9 thi doi sang so
tiep:
push dx
inc count
cmp ax , 0
jne again1
again2:
pop dx
mov ah , 2
int 21h
dec count
cmp count, 0
jne again2
jmp thoat
kytu:
add dl , 37h
jmp tiep
so:
add dl , 30h
jmp tiep
thoat:
mov ah , 4ch
int 21h
main endp
end main
Lm1vZGVsIHNtYWxsCi5zdGFjayAxMDAKLmRhdGEKICAgIGNvdW50IGRiIDAKICAgIG51bSBkYiAyMjMKICAgICAKLmNvZGUKICAgIG1haW4gcHJvYwogICAgICAgIG1vdiBheCwgQGRhdGEKICAgICAgICBtb3YgZHMsIGF4CiAgICAgICAgIAogICAgICAgIG1vdiBjbCwxNiAgICAgICA7ZGl2aWRlIGJ5ICAKICAgICAgICBtb3YgYXgsIDAKICAgICAgICBtb3YgYWwsIG51bSAgIAogICAgICAgIAogICAgICAgICAKICAgICAgICBhZ2FpbjE6CiAgICAgICAgICAgIG1vdiBkeCwwICAgIDsgcHV0aW5nIDAgaW4gdGhlIGhpZ2ggcGFydCBvZiB0aGUgZGl2aWRlZCBudW1iZXIgKERYOkFYKQogICAgICAgICAgICBkaXYgY3ggICAgICA7IERYOkFYL2N4LiBheD1keDpheC9jeCBhbmQgZHg9ZHg6YXglY3gobW9kdWx1cykgIAogICAgICAgICAgICAKICAgICAgICAgICAgY21wIGRsLCA5ICAgCiAgICAgICAgICAgIGphIGt5dHUgICAgIDsgbmV1IGR4ID45IHRoaSBjaHV5ZW4gc2FuZyBreSB0dSAoQS1GKQogICAgICAgICAgICBjbXAgZGwsIDkKICAgICAgICAgICAgam5hIHNvICAgICAgOyBuZXUgZHggPCA5IHRoaSBkb2kgc2FuZyBzbwogICAgICAgIHRpZXA6ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICBwdXNoIGR4CiAgICAgICAgICAgIGluYyBjb3VudAogICAgICAgICAgICBjbXAgYXgsMAogICAgICAgICAgICBqbmUgYWdhaW4xCiAgICAgICAgIAogICAgICAgIGFnYWluMjoKICAgICAgICAgICAgcG9wIGR4CiAgICAgICAgICAgIG1vdiBhaCwgMgogICAgICAgICAgICBpbnQgMjFoCiAgICAgICAgICAgIGRlYyBjb3VudAogICAgICAgICAgICBjbXAgY291bnQsIDAKICAgICAgICAgICAgam5lIGFnYWluMiAgCiAgICAgICAgCiAgICAgICAgam1wIHRob2F0CiAgICAgICAgCiAgICAgICAga3l0dToKICAgICAgICAgICAgYWRkIGRsLCAzN2gKICAgICAgICAgICAgam1wIHRpZXAgIAogICAgICAgIHNvOgogICAgICAgICAgICBhZGQgZGwsIDMwaAogICAgICAgICAgICBqbXAgdGllcAogICAgICAgIHRob2F0OiAKICAgICAgICAgICAgbW92IGFoLCA0Y2gKICAgICAgICAgICAgaW50IDIxaAogICAgIAogICAgbWFpbiBlbmRwCmVuZCBtYWlu
compilation info
prog.asm:1: error: attempt to define a local label before any non-local labels
prog.asm:1: error: parser: instruction expected
prog.asm:2: error: attempt to define a local label before any non-local labels
prog.asm:2: error: parser: instruction expected
prog.asm:3: error: attempt to define a local label before any non-local labels
prog.asm:8: error: parser: instruction expected
prog.asm:51: error: symbol `main' redefined
prog.asm:51: error: parser: instruction expected
prog.asm:52: error: parser: instruction expected
stdout