Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. *-----------------------------------------------------------
  2. * Title : my 2nd program
  3. * Written by : GW
  4. * Date : 21/05/2015
  5. * Description: mój pierwszy program wypisujący liczby od 1 do 100
  6. *-----------------------------------------------------------
  7. ORG $1000
  8. START: ; first instruction of program
  9.  
  10. * Put program code here
  11. move.l #1,d3
  12. move.b #1,d2
  13. PETLA:
  14. add.b d3,d4
  15. bsr.w printnumber
  16. bsr.w printchar
  17. addi.b #1,d3
  18. * bsr newLine
  19. cmp.b #10+1,d3
  20. bne.s PETLA
  21.  
  22. bsr.w printequalsign
  23.  
  24. move.b d4,d1
  25. move.b #20,d0
  26. trap #15
  27.  
  28. SIMHALT
  29.  
  30. printnumber:
  31. move.b d3,d1
  32. move.b #20,d0
  33. trap #15
  34. rts
  35.  
  36. printchar:
  37. move.b plus,d1
  38. move.b #6,d0
  39. trap #15
  40. rts
  41.  
  42. printequalsign:
  43. move.b rowne,d1
  44. move.b #6,d0
  45. trap #15
  46. rts
  47.  
  48. newLine:
  49. movem.l d0/a1,-(a7); push d0 & a1
  50. move #14,d0 ; task number into D0
  51. lea crlf,a1 ; address of string
  52. trap #15 ; display return, linefeed
  53. movem.l (a7)+,d0/a1; restore d0 & a1
  54. rts ; return
  55.  
  56. * SIMHALT ; halt simulator
  57.  
  58.  
  59.  
  60. * Put variables and constants here
  61. crlf dc.b $d,$a,0 carriage return & line feed, null
  62. plus dc.b '+'
  63. rowne dc.b '='
  64. END START ; last line of source
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement