Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: ASM (NASM)  |  size: 1.35 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $nomod51
  2. ;KA 4 2BKI 2/2
  3.  
  4. sjmp start
  5.  
  6. cseg at 0x03
  7. ljmp int_0
  8. cseg at 0x0B
  9. ljmp timer_0
  10. cseg at 0x13
  11. ljmp int_1
  12.  
  13. start:
  14. setb EA
  15. setb EX0
  16. setb EX1
  17. setb IT0
  18. setb IT1
  19. setb ET0
  20. setb TR0
  21.  
  22. call init
  23. call display
  24. call dis_on1
  25. call clear
  26.  
  27. mov tmod,#0x02
  28. mov TL0,#6
  29. mov TH0,#6
  30.  
  31. ; DIE MÜSSEN INITIALISIERT WERDEN!!!
  32.  
  33. sekunde equ 0x60
  34. hundert equ 0x61
  35. z1      equ 0x62
  36. z2      equ 0x63
  37.  
  38. ; heißt:
  39.  
  40. mov sekunde,#0
  41. mov hundert,#0
  42. mov z1,#100
  43. mov z2,#40
  44.  
  45. ; michi, michi.... ^^
  46.  
  47. ;Name:
  48. mov r0,#0x40
  49. call pos
  50. mov DPTR,#Name_1
  51. call lcdsend
  52.  
  53. ;Start mit Gelb
  54. call home
  55. mov DPTR,#start_gelb
  56. call lcdsend
  57.  
  58. mov p1,#85
  59.  
  60. sjmp $
  61.  
  62. int_0:
  63. setb TR0
  64. call home
  65. mov DPTR,#stopp_gruen
  66. call lcdsend
  67. mov p1,#34
  68. reti
  69.  
  70. int_1:
  71. clr TR0
  72. mov p1,#136
  73. call clear
  74. mov DPTR,#Zeit
  75. call lcdsend
  76. mov A,sekunde
  77. call ausgabe1
  78. call ausgabe2
  79. mov r6,A
  80. call zeichen
  81. reti
  82.  
  83. timer_0:
  84. DJNZ z1,M_Reti
  85. mov z1,#100
  86. DJNZ z2,M_Reti
  87. mov z2,#40
  88. INC sekunde
  89.  
  90. M_Reti:
  91. Reti
  92.  
  93. ausgabe1:
  94. ADD A,#0x30
  95. mov R6,A
  96. call zeichen
  97. ret
  98.  
  99. ausgabe2:
  100. mov B,#10
  101. div AB
  102. call ausgabe1
  103. mov A,B
  104. call ausgabe1
  105. ret
  106.  
  107. ausgabe3:
  108. mov b,#100
  109. div ab
  110. call ausgabe1
  111. mov a,b
  112. call ausgabe2
  113. ret
  114.  
  115. Name_1: db "Michael Gold",0
  116. start_gelb: db "Start mit Gelb",0
  117. stopp_gruen: db "Stopp mit Gruen",0
  118. Zeit: db "Zeit:",0
  119.  
  120. $include(LCD_ups.inc)
  121. $include(t89c51cc01.inc)
  122.  
  123. END