fork(3) download
  1. LCD EQU P1
  2. E EQU p2.5 ;Strobe indicaç?o de nova leitura ou escrita, pino tem de ser pulsado para o lcd ;executar
  3. RW EQU p2.6 ; selector escrita leitura dados se 0 micro escreve lcd se 1 o micro lê do lcd
  4. RS EQU p2.7 ; se for 1 entrada dados, 0 instruç?es/comandos
  5. ;após ligar o lcd esperar 30ms
  6. ;KS0070B REF DISPLAY 2 LINHAS
  7. ;code rectified 23-12-2013
  8. org 00h ; begin address 00
  9. ljmp MAIN
  10. org 03h ; interrupt int0
  11. ljmp btnL
  12. org 13h ; interrupt int1
  13. ljmp btnR
  14.  
  15. MAIN:
  16. MOV IE, #10000101B; act interrupt 8bits=(EA - -ES ET1 EX1 ET0 EX0)
  17. MOV TMOD, #00000001B; modo 1 conta ate 65536
  18. LCALL TIM_30MS; Comentar ou n?o para usar simulador
  19. CLR E
  20. CLR RS; modo de comandos RS = 0
  21. CLR RW; rw=0 escrita do uC para o LCD
  22.  
  23. FUNC:
  24. MOV LCD, #00111000B; duas linhas matriz 5x7
  25. LCALL ENVIA_LCD; jA TENHO A ESPERA NO ENVIA
  26.  
  27. LIGAR:
  28. MOV LCD, #00001111b; DEFINIÇAO CURSOR, BLINK E SWITHC ON
  29. LCALL ENVIA_LCD
  30. LIMPA:
  31. MOV LCD, #00000001B; CLEAR LCD
  32. LCALL ENVIA_LCD
  33. ;LCALL TIM_1_53MS
  34.  
  35. MODO_DADOS:
  36. MOV LCD, #00000011B; DEFINE INC OU DEC NO SENTIDO DO CHAR
  37. LCALL ENVIA_LCD
  38.  
  39. LINHA0:
  40. clr RS
  41. MOV LCD, #10000000B; 1 COMANDO DE ESCRITA, 2º BIT LINHA(0, 1); 6º BITS COLUNAS
  42. LCALL ENVIA_LCD
  43. SETB RS ; MODO LETRAS
  44. MOV LCD, #'T'
  45. LCALL ENVIA_LCD
  46. MOV LCD, #'E'
  47. LCALL ENVIA_LCD
  48. MOV LCD, #'S'
  49. LCALL ENVIA_LCD
  50. MOV LCD, #'T'
  51. LCALL ENVIA_LCD
  52. MOV LCD, #'-'
  53. LCALL ENVIA_LCD
  54. mov dptr,#frase1
  55. LCALL ESCREVE_FRASE
  56. CLR rs
  57. MOV LCD,#11000000B; LINHA DE BAIXAO 4ª MATR
  58. LCALL ENVIA_LCD
  59. setb rs
  60. mov dptr,#frase2
  61. LCALL ESCREVE_FRASE
  62. CLR RS
  63. sjmp main
  64. ENVIA_LCD:
  65. SETB E ; pino enable de escrita no LCD(uso o tempo de espera e limpo)
  66. ; LCALL tim_39us
  67. ; CLR E
  68. ; LCALL tim_39us
  69. LCALL tim_1_53ms
  70. CLR E
  71. LCALL tim_1_53ms
  72. RET
  73.  
  74. TIM_30MS:
  75. MoV TL0, #LOW(65536-65000); 30000 Contagem de 1.085069us
  76. MOV TH0, #HIGH(65536-65000);
  77. setb TR0
  78. clr TF0 ; linha flag de overflow do timer
  79. JNB TF0,$ ; espera fim de contagem
  80. CLR TR0
  81. RET
  82.  
  83. TIM_39US:
  84. MoV TL0, #LOW(65536-39); 30000 Contagem de 1.085069us
  85. MOV TH0, #HIGH(65536-39);
  86. setb TR0
  87. clr TF0 ; linha flag de overflow do timer
  88. JNB TF0,$ ; espera fim de contagem
  89. CLR TR0
  90. RET
  91. TIM_1_53MS:
  92. MoV TL0, #LOW(65536-1530); 30000 Contagem de 1.085069us
  93. MOV TH0, #HIGH(65536-1530);
  94. setb TR0
  95. clr TF0 ; linha flag de overflow do timer
  96. JNB TF0, $ ; espera fim de contagem
  97. CLR TR0
  98. RET
  99. TIM_1SEC:
  100. MoV TL0, #LOW(65536-65530); 5Sec (4607) Contagem de 1.085069us
  101. MOV TH0, #HIGH(65536-65530);
  102. setb TR0
  103. clr TF0 ; linha flag de overflow do timer
  104. JNB TF0, $ ; espera fim de contagem
  105. CLR TR0
  106. RET
  107.  
  108. ESCREVE_FRASE:
  109. SETB RS; MODO LETRAS
  110. MOV A, #0h
  111. MOVC A, @A+DPTR
  112. MOV R7, A; NUMERO DE CHARS
  113.  
  114. OUTRA_LETRA:
  115. LCALL TIM_1SEC
  116. INC DPTR
  117. MOV A, #0h
  118. MOVC A, @A+DPTR
  119. MOV LCD, A
  120. LCALL ENVIA_LCD
  121. DJNZ R7, OUTRA_LETRA
  122. RET
  123.  
  124. BTNL:
  125. clr ie0
  126. clr RS
  127. MOV LCD, #10000000B; 1 COMANDO DE ESCRITA, 2º BIT LINHA(0, 1); 6º BITS COLUNAS
  128. LCALL ENVIA_LCD
  129. setb rs
  130. mov dptr,#frase3
  131. LCALL ESCREVE_FRASE
  132. CLR RS
  133. RETI
  134. BTNR:
  135. clr ie1
  136. CLR rs
  137. MOV LCD,#11000000B; LINHA DE BAIXAO 4ª MATR
  138. LCALL ENVIA_LCD
  139. setb rs
  140. mov dptr,#frase4
  141. LCALL ESCREVE_FRASE
  142. CLR RS
  143. RETI
  144. FRASE1:
  145. DB 24, 'Jose Luis Silva Monteiro'
  146. FRASE2:
  147. DB 9, 'GAME OVER'
  148. FRASE3:
  149. DB 12, 'Interrupt 0'
  150. FRASE4:
  151. DB 12, 'Interrupt 1'
  152. END
  153.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.s: Assembler messages:
prog.s:1: Error: no such instruction: `lcd EQU P1'
prog.s:2: Error: no such instruction: `e EQU p2.5'
prog.s:2: Error: no such instruction: `strobe indicaç?o de nova leitura ou escrita,pino tem de ser pulsado para o lcd'
prog.s:2: Error: no such instruction: `executar'
prog.s:3: Error: no such instruction: `rw EQU p2.6'
prog.s:3: Error: no such instruction: `selector escrita leitura dados se 0 micro escreve lcd se 1 o micro lê do lcd'
prog.s:4: Error: no such instruction: `rs EQU p2.7'
prog.s:4: Error: no such instruction: `se for 1 entrada dados,0 instruç?es/comandos'
prog.s:5: Error: invalid character (0xc3) in mnemonic
prog.s:6: Error: no such instruction: `ks0070b REF DISPLAY 2 LINHAS'
prog.s:7: Error: no such instruction: `code rectified 23-12-2013'
prog.s:8: Error: no such instruction: `org 00h'
prog.s:8: Error: no such instruction: `begin address 00'
prog.s:9: Warning: indirect ljmp without `*'
prog.s:10: Error: no such instruction: `org 03h'
prog.s:10: Error: no such instruction: `interrupt int0'
prog.s:11: Warning: indirect ljmp without `*'
prog.s:12: Error: no such instruction: `org 13h'
prog.s:12: Error: no such instruction: `interrupt int1'
prog.s:13: Warning: indirect ljmp without `*'
prog.s:16: Error: expecting operand after ','; got nothing
prog.s:17: Error: expecting operand after ','; got nothing
prog.s:18: Warning: indirect lcall without `*'
prog.s:18: Error: no such instruction: `comentar ou n?o para usar simulador'
prog.s:19: Error: operand size mismatch for `clr'
prog.s:20: Error: operand size mismatch for `clr'
prog.s:20: Error: no such instruction: `modo de comandos RS=0'
prog.s:21: Error: operand size mismatch for `clr'
prog.s:21: Error: junk at end of line, first unrecognized character is `e'
prog.s:24: Error: expecting operand after ','; got nothing
prog.s:25: Warning: indirect lcall without `*'
prog.s:25: Error: junk `A ESPERA NO ENVIA' after expression
prog.s:28: Error: expecting operand after ','; got nothing
prog.s:29: Warning: indirect lcall without `*'
prog.s:31: Error: expecting operand after ','; got nothing
prog.s:32: Warning: indirect lcall without `*'
prog.s:33: Warning: indirect lcall without `*'
prog.s:36: Error: expecting operand after ','; got nothing
prog.s:37: Warning: indirect lcall without `*'
prog.s:40: Error: operand size mismatch for `clr'
prog.s:41: Error: expecting operand after ','; got nothing
prog.s:42: Warning: indirect lcall without `*'
prog.s:43: Error: no such instruction: `modo LETRAS'
prog.s:44: Error: expecting operand after ','; got nothing
prog.s:45: Warning: indirect lcall without `*'
prog.s:46: Error: expecting operand after ','; got nothing
prog.s:47: Warning: indirect lcall without `*'
prog.s:48: Error: expecting operand after ','; got nothing
prog.s:49: Warning: indirect lcall without `*'
prog.s:50: Error: expecting operand after ','; got nothing
prog.s:51: Warning: indirect lcall without `*'
prog.s:52: Error: expecting operand after ','; got nothing
prog.s:53: Warning: indirect lcall without `*'
prog.s:54: Error: expecting operand after ','; got nothing
prog.s:55: Warning: indirect lcall without `*'
prog.s:56: Error: operand size mismatch for `clr'
prog.s:57: Error: expecting operand after ','; got nothing
prog.s:58: Warning: indirect lcall without `*'
prog.s:60: Error: expecting operand after ','; got nothing
prog.s:61: Warning: indirect lcall without `*'
prog.s:62: Error: operand size mismatch for `clr'
prog.s:63: Error: no such instruction: `sjmp main'
prog.s:65: Error: no such instruction: `pino enable de escrita no LCD(uso o tempo de espera e limpo)'
prog.s:66: Warning: indirect lcall without `*'
prog.s:67: Error: operand size mismatch for `clr'
prog.s:68: Warning: indirect lcall without `*'
prog.s:69: Warning: indirect lcall without `*'
prog.s:70: Error: operand size mismatch for `clr'
prog.s:71: Warning: indirect lcall without `*'
prog.s:75: Error: expecting operand after ','; got nothing
prog.s:76: Error: expecting operand after ','; got nothing
prog.s:78: Error: operand size mismatch for `clr'
prog.s:78: Error: no such instruction: `linha flag de overflow do timer'
prog.s:79: Error: missing or invalid immediate expression `'
prog.s:79: Error: no such instruction: `espera fim de contagem'
prog.s:80: Error: operand size mismatch for `clr'
prog.s:84: Error: expecting operand after ','; got nothing
prog.s:85: Error: expecting operand after ','; got nothing
prog.s:87: Error: operand size mismatch for `clr'
prog.s:87: Error: no such instruction: `linha flag de overflow do timer'
prog.s:88: Error: missing or invalid immediate expression `'
prog.s:88: Error: no such instruction: `espera fim de contagem'
prog.s:89: Error: operand size mismatch for `clr'
prog.s:92: Error: expecting operand after ','; got nothing
prog.s:93: Error: expecting operand after ','; got nothing
prog.s:95: Error: operand size mismatch for `clr'
prog.s:95: Error: no such instruction: `linha flag de overflow do timer'
prog.s:96: Error: missing or invalid immediate expression `'
prog.s:96: Error: no such instruction: `espera fim de contagem'
prog.s:97: Error: operand size mismatch for `clr'
prog.s:100: Error: expecting operand after ','; got nothing
prog.s:101: Error: expecting operand after ','; got nothing
prog.s:103: Error: operand size mismatch for `clr'
prog.s:103: Error: no such instruction: `linha flag de overflow do timer'
prog.s:104: Error: missing or invalid immediate expression `'
prog.s:104: Error: no such instruction: `espera fim de contagem'
prog.s:105: Error: operand size mismatch for `clr'
prog.s:109: Error: no such instruction: `modo LETRAS'
prog.s:110: Error: expecting operand after ','; got nothing
prog.s:111: Error: no such instruction: `movc A,@A+DPTR'
prog.s:112: Error: too many memory references for `mov'
prog.s:112: Error: no such instruction: `numero DE CHARS'
prog.s:115: Warning: indirect lcall without `*'
prog.s:116: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
prog.s:117: Error: expecting operand after ','; got nothing
prog.s:118: Error: no such instruction: `movc A,@A+DPTR'
prog.s:119: Error: too many memory references for `mov'
prog.s:120: Warning: indirect lcall without `*'
prog.s:121: Error: no such instruction: `djnz R7,OUTRA_LETRA'
prog.s:125: Error: operand size mismatch for `clr'
prog.s:126: Error: operand size mismatch for `clr'
prog.s:127: Error: expecting operand after ','; got nothing
prog.s:128: Warning: indirect lcall without `*'
prog.s:130: Error: expecting operand after ','; got nothing
prog.s:131: Warning: indirect lcall without `*'
prog.s:132: Error: operand size mismatch for `clr'
prog.s:133: Error: no such instruction: `reti'
prog.s:135: Error: operand size mismatch for `clr'
prog.s:136: Error: operand size mismatch for `clr'
prog.s:137: Error: expecting operand after ','; got nothing
prog.s:138: Warning: indirect lcall without `*'
prog.s:140: Error: expecting operand after ','; got nothing
prog.s:141: Warning: indirect lcall without `*'
prog.s:142: Error: operand size mismatch for `clr'
prog.s:143: Error: no such instruction: `reti'
prog.s:145: Error: no such instruction: `db 24,74ose Luis Silva Monteiro10FRASE2:'
prog.s:146: Error: no such instruction: `db 9,71AME OVER10FRASE3:'
prog.s:147: Error: no such instruction: `db 12,73nterrupt 010FRASE4:'
prog.s:148: Error: no such instruction: `db 12,73nterrupt 110END'
stdout
Standard output is empty