fork download
  1.  
  2. .include "m168Pdef.inc"
  3.  
  4.  
  5. .org 0
  6. jmp start
  7. .org INT_VECTORS_SIZE
  8.  
  9. start:
  10. ldi r16, low(RAMEND)
  11. out SPL, r16
  12. ldi r16, high(RAMEND)
  13. out SPH, r16
  14. ;Diod off
  15. in r16, DDRB
  16. ori r16, (1<<PB5)
  17. out DDRB, r16
  18. in r16,PORTB
  19. andi r16, ~(1<<PB5)
  20. out PORTB, r16
  21. ;Delay
  22. ldi r18, 5
  23. ldi r19, 15
  24. ldi r20, 242
  25. L1: dec r20
  26. brne L1
  27. dec r19
  28. wdr
  29. brne L1
  30. wdr
  31. dec r18
  32. brne L1
  33.  
  34.  
  35. ;---------------------------------------
  36. ; load the Z-pointer with 0x0000
  37. ; Fuse Low byte (FLB)
  38. ;-------------------------------------
  39. ; load the Z-pointer with 0x0001
  40. ; To read the Lock bits
  41. ;---------------------------------------
  42. ; load 0x0002 in the Z-pointer
  43. ; Extended Fuse byte (EFB)
  44. ;---------------------------------------
  45. ; load 0x0003 in the Z-pointer
  46. ; Fuse High byte (FHB)
  47. ;---------------------------------------
  48. clr zl
  49. clr zh
  50. clr r17
  51. clr r18
  52. ldi r19, (1<<BLBSET)|(1<<SELFPRGEN)
  53. loop_read_fuse:
  54. ; It is recommended that the user checks the status bit (EEPE) in the EECR
  55. ; Register and verifies that the bit is cleared before writing to the SPMCSR Register.
  56. wait_EEPE:
  57. sbic EECR,EEPE
  58. rjmp wait_EEPE
  59. sts SPMCSR, r19
  60. lpm r24, z
  61. call EEPROM_write
  62. inc zl
  63. inc r17
  64. cpi r17,4
  65. brne loop_read_fuse
  66.  
  67. ;Diod on
  68. in r16,PORTB
  69. ori r16, (1<<PB5)
  70. out PORTB, r16
  71.  
  72. loop:
  73. wdr
  74. jmp loop
  75.  
  76.  
  77. EEPROM_write:
  78. ; Wait for completion of previous write
  79. sbic EECR,EEPE
  80. rjmp EEPROM_write
  81. ; Set up address (r18:r17) in address register
  82. out EEARH, r18
  83. out EEARL, r17
  84. ; Write data (r16) to Data Register
  85. out EEDR,r24
  86. ; Write logical one to EEMPE
  87. sbi EECR,EEMPE
  88. ; Start eeprom write by setting EEPE
  89. sbi EECR,EEPE
  90. ret
  91.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.s: Assembler messages:
prog.s:2: Error: can't open m168Pdef.inc for reading: No such file or directory
prog.s:7: Warning: symbol "INT_VECTORS_SIZE" undefined; zero assumed
prog.s:10: Error: no such instruction: `ldi r16,low(RAMEND)'
prog.s:11: Error: too many memory references for `out'
prog.s:12: Error: no such instruction: `ldi r16,high(RAMEND)'
prog.s:13: Error: too many memory references for `out'
prog.s:14: Error: no such instruction: `diod off'
prog.s:15: Error: too many memory references for `in'
prog.s:16: Error: no such instruction: `ori r16,(1<<PB5)'
prog.s:17: Error: too many memory references for `out'
prog.s:18: Error: too many memory references for `in'
prog.s:19: Error: no such instruction: `andi r16,~(1<<PB5)'
prog.s:20: Error: too many memory references for `out'
prog.s:21: Error: no such instruction: `delay'
prog.s:22: Error: no such instruction: `ldi r18,5'
prog.s:23: Error: no such instruction: `ldi r19,15'
prog.s:24: Error: no such instruction: `ldi r20,242'
prog.s:25: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
prog.s:26: Error: no such instruction: `brne L1'
prog.s:27: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
prog.s:28: Error: no such instruction: `wdr'
prog.s:29: Error: no such instruction: `brne L1'
prog.s:30: Error: no such instruction: `wdr'
prog.s:31: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
prog.s:32: Error: no such instruction: `brne L1'
prog.s:35: Error: junk at end of line, first unrecognized character is `-'
prog.s:36: Error: no such instruction: `load the Z-pointer with 0x0000'
prog.s:37: Error: no such instruction: `fuse Low byte (FLB)'
prog.s:38: Error: junk at end of line, first unrecognized character is `-'
prog.s:39: Error: no such instruction: `load the Z-pointer with 0x0001'
prog.s:40: Error: no such instruction: `to read the Lock bits'
prog.s:41: Error: junk at end of line, first unrecognized character is `-'
prog.s:42: Error: no such instruction: `load 0x0002 in the Z-pointer'
prog.s:43: Error: no such instruction: `extended Fuse byte (EFB)'
prog.s:44: Error: junk at end of line, first unrecognized character is `-'
prog.s:45: Error: no such instruction: `load 0x0003 in the Z-pointer'
prog.s:46: Error: no such instruction: `fuse High byte (FHB)'
prog.s:47: Error: junk at end of line, first unrecognized character is `-'
prog.s:48: Error: operand size mismatch for `clr'
prog.s:49: Error: operand size mismatch for `clr'
prog.s:50: Error: operand size mismatch for `clr'
prog.s:51: Error: operand size mismatch for `clr'
prog.s:52: Error: no such instruction: `ldi r19,(1<<BLBSET)|(1<<SELFPRGEN)'
prog.s:54: Error: no such instruction: `it is recommended that the user checks the status bit (EEPE)in the EECR'
prog.s:55: Error: no such instruction: `register and verifies that the bit is cleared before writing to the SPMCSR Register.'
prog.s:57: Error: no such instruction: `sbic EECR,EEPE'
prog.s:58: Error: no such instruction: `rjmp wait_EEPE'
prog.s:59: Error: no such instruction: `sts SPMCSR,r19'
prog.s:60: Error: no such instruction: `lpm r24,z'
prog.s:62: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
prog.s:63: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
prog.s:64: Error: no such instruction: `cpi r17,4'
prog.s:65: Error: no such instruction: `brne loop_read_fuse'
prog.s:67: Error: no such instruction: `diod on'
prog.s:68: Error: too many memory references for `in'
prog.s:69: Error: no such instruction: `ori r16,(1<<PB5)'
prog.s:70: Error: too many memory references for `out'
prog.s:73: Error: no such instruction: `wdr'
prog.s:78: Error: no such instruction: `for completion of previous write'
prog.s:79: Error: no such instruction: `sbic EECR,EEPE'
prog.s:80: Error: no such instruction: `rjmp EEPROM_write'
prog.s:81: Error: no such instruction: `set up address (r18:r17)in address register'
prog.s:82: Error: too many memory references for `out'
prog.s:83: Error: too many memory references for `out'
prog.s:84: Error: no such instruction: `write data (r16)to Data Register'
prog.s:85: Error: too many memory references for `out'
prog.s:86: Error: no such instruction: `write logical one to EEMPE'
prog.s:87: Error: no such instruction: `sbi EECR,EEMPE'
prog.s:88: Error: no such instruction: `start eeprom write by setting EEPE'
prog.s:89: Error: no such instruction: `sbi EECR,EEPE'
prog.s:7: Error: attempt to move .org backwards
stdout
Standard output is empty