Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 13th, 2013  |  syntax: ASM (NASM)  |  size: 0.57 KB  |  views: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. TEKSTY SEGMENT
  2. T1 DB "Podaj b, a jest rowne 15",0Ah,0Dh,"$"
  3. T2 DB 0Ah,0Dh,"Wynik to: $"
  4. TEKSTY ENDS
  5. PROGRAM SEGMENT
  6. ASSUME CS:PROGRAM,DS:TEKSTY
  7. START:
  8. mov AX,TEKSTY
  9. mov DS,AX
  10. mov DX,OFFSET T1
  11. mov AH,09h
  12. int 21h
  13. ;wypisanie T1
  14.  
  15. mov AH,01h
  16. int 21h
  17. ;pobranie b
  18.  
  19. mov bh,al ;do bh dajemy sobie b
  20. mov ax,15d ;do ax dajemy 15
  21. sub bh,30h
  22. div bh ; dzielimy przez bh
  23. mov bh,al ;w al jest wynik z dzielenia, reszta w ah
  24.  
  25.  
  26.  
  27. mov DX,OFFSET T2
  28. mov AH,09h
  29. int 21h
  30. ;wypisanie T2
  31.  
  32. mov dl,bh
  33. add dl,30h
  34. mov ah,02h
  35. int 21h
  36.  
  37. mov ax,4C00h
  38. int 21h
  39. PROGRAM ENDS
  40. END START