fork(2) download
  1. .model small
  2. .stack 100
  3. .data
  4. count db 0
  5. num db 223
  6.  
  7. .code
  8. main proc
  9. mov ax, @data
  10. mov ds, ax
  11.  
  12. mov cl,16 ;divide by
  13. mov ax, 0
  14. mov al, num
  15.  
  16.  
  17. again1:
  18. mov dx,0 ; puting 0 in the high part of the divided number (DX:AX)
  19. div cx ; DX:AX/cx. ax=dx:ax/cx and dx=dx:ax%cx(modulus)
  20.  
  21. cmp dl, 9
  22. ja kytu ; neu dx >9 thi chuyen sang ky tu (A-F)
  23. cmp dl, 9
  24. jna so ; neu dx < 9 thi doi sang so
  25. tiep:
  26. push dx
  27. inc count
  28. cmp ax,0
  29. jne again1
  30.  
  31. again2:
  32. pop dx
  33. mov ah, 2
  34. int 21h
  35. dec count
  36. cmp count, 0
  37. jne again2
  38.  
  39. jmp thoat
  40.  
  41. kytu:
  42. add dl, 37h
  43. jmp tiep
  44. so:
  45. add dl, 30h
  46. jmp tiep
  47. thoat:
  48. mov ah, 4ch
  49. int 21h
  50.  
  51. main endp
  52. end main
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
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
Standard output is empty