File: highlight.asm-avr

package info (click to toggle)
kf6-syntax-highlighting 6.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 47,568 kB
  • sloc: xml: 197,750; cpp: 12,850; python: 3,023; sh: 955; perl: 546; ruby: 488; pascal: 393; javascript: 161; php: 150; jsp: 132; lisp: 131; haskell: 124; ada: 119; ansic: 107; makefile: 96; f90: 94; ml: 85; cobol: 81; yacc: 71; csh: 62; erlang: 54; sql: 51; java: 47; objc: 37; awk: 31; asm: 30; tcl: 29; fortran: 18; cs: 10
file content (108 lines) | stat: -rw-r--r-- 2,278 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
;********************************************************************
;* LED flasher: LED will flash with a X on/off ratio at PD6
;*
;* NOTE: delay depends in the value of X, 1 is fast, 255 is slow
;*
;* No copyright ©1998 RES® * FREEWARE *
;*
;* NOTE: Connect a low current LED with a 1k resistor in serie from 
;*	 Vdd to pin 11 of the MCU. (Or a normal LED with a 330ohm)
;*									   
;* RES® can be reached by email: digitalaudio@mail.com		   
;* or visit the website: http://home.wanadoo.nl/electro1/avr
;*
;* Version           :1.0 					   
;* Date		     :12/26/98
;* Author	     :Rob's ElectroSoft®
;* Target MCU        :AT90S1200-12PI@4MHz					   
;********************************************************************

.include "1200def.inc"

	rjmp	RESET		;reset handle


;* Long delay 

;* Register variables

	.def  T1      = r1
	.def  T2      = r2
	.def  temp    = r19

;* Code
	    
longDelay:      
	clr   T1		;T1 used as delay 2nd count
	clr   T2		;T2 used as delay 3d count
delay_1:    
	dec   T2
	brne  delay_1            
	dec   T1
	brne  delay_1           
	dec   temp		;temp must be preset as 
	brne  delay_1		; delay master count
	ret                     


;* Resets the data direction register D

;* Defines

	.equ  led   = 6		;LED at PD6

;* Code

RESET:
	sbi   DDRD, led		;connect LED to PORTD pin 6
	    

;* Main program

;* This part will let the LED go on and off by X

;* Register variables

	.equ  X   =  10 	;enter delaytime X

flash: 
	sbi   PORTD, led	;LED on
	ldi   temp, X		;X sec delay           
	rcall longDelay             
	cbi   PORTD, led	;LED off            
	ldi   temp, X		;X sec delay
	rcall longDelay
	rjmp  flash		;another run

/* other 
tests */

.org LARGEBOOTSTART
; the following sets up RAMPZ:Z to point to a FLASH data object, typically
; for use with ELPM.
ldi ZL, low (cmdtable * 2)
ldi ZH, high (cmdtable * 2)
.if ((cmdtable * 2) > 65535)
ldi r16, 1
sts RAMPZ, r16
.endif
; more code follows here
cmdtable: .db "foo", 0x0
.db "Hello\n" // is equivalent to:
.db 'H', 'e', 'l', 'l', 'o', '\\', 'n'
.db '\0', '\177', '\xff'
.db "\nx\rx\ax\bx\fx\tx\vx\\x\0000\xfff\0\1"
0b10_111_2 0xaf3_4 0_12 32_32 $32_3

.macro m
ldi @0, @1
.endm m r16,\ 0

#define TEST \
.IF val \
.DW __TIME__ \
.ELSE \
.DW 1 \
.ENDIF

#defi TEST