Warning, /frameworks/syntax-highlighting/autotests/input/highlight.asm-avr is written in an unsupported language. File is not indexed.
0001 ;******************************************************************** 0002 ;* LED flasher: LED will flash with a X on/off ratio at PD6 0003 ;* 0004 ;* NOTE: delay depends in the value of X, 1 is fast, 255 is slow 0005 ;* 0006 ;* No copyright ©1998 RES® * FREEWARE * 0007 ;* 0008 ;* NOTE: Connect a low current LED with a 1k resistor in serie from 0009 ;* Vdd to pin 11 of the MCU. (Or a normal LED with a 330ohm) 0010 ;* 0011 ;* RES® can be reached by email: digitalaudio@mail.com 0012 ;* or visit the website: http://home.wanadoo.nl/electro1/avr 0013 ;* 0014 ;* Version :1.0 0015 ;* Date :12/26/98 0016 ;* Author :Rob's ElectroSoft® 0017 ;* Target MCU :AT90S1200-12PI@4MHz 0018 ;******************************************************************** 0019 0020 .include "1200def.inc" 0021 0022 rjmp RESET ;reset handle 0023 0024 0025 ;* Long delay 0026 0027 ;* Register variables 0028 0029 .def T1 = r1 0030 .def T2 = r2 0031 .def temp = r19 0032 0033 ;* Code 0034 0035 longDelay: 0036 clr T1 ;T1 used as delay 2nd count 0037 clr T2 ;T2 used as delay 3d count 0038 delay_1: 0039 dec T2 0040 brne delay_1 0041 dec T1 0042 brne delay_1 0043 dec temp ;temp must be preset as 0044 brne delay_1 ; delay master count 0045 ret 0046 0047 0048 ;* Resets the data direction register D 0049 0050 ;* Defines 0051 0052 .equ led = 6 ;LED at PD6 0053 0054 ;* Code 0055 0056 RESET: 0057 sbi DDRD, led ;connect LED to PORTD pin 6 0058 0059 0060 ;* Main program 0061 0062 ;* This part will let the LED go on and off by X 0063 0064 ;* Register variables 0065 0066 .equ X = 10 ;enter delaytime X 0067 0068 flash: 0069 sbi PORTD, led ;LED on 0070 ldi temp, X ;X sec delay 0071 rcall longDelay 0072 cbi PORTD, led ;LED off 0073 ldi temp, X ;X sec delay 0074 rcall longDelay 0075 rjmp flash ;another run 0076 0077 /* other 0078 tests */ 0079 0080 .org LARGEBOOTSTART 0081 ; the following sets up RAMPZ:Z to point to a FLASH data object, typically 0082 ; for use with ELPM. 0083 ldi ZL, low (cmdtable * 2) 0084 ldi ZH, high (cmdtable * 2) 0085 .if ((cmdtable * 2) > 65535) 0086 ldi r16, 1 0087 sts RAMPZ, r16 0088 .endif 0089 ; more code follows here 0090 cmdtable: .db "foo", 0x0 0091 .db "Hello\n" // is equivalent to: 0092 .db 'H', 'e', 'l', 'l', 'o', '\\', 'n' 0093 .db '\0', '\177', '\xff' 0094 .db "\nx\rx\ax\bx\fx\tx\vx\\x\0000\xfff\0\1" 0095 0b10_111_2 0xaf3_4 0_12 32_32 $32_3 0096 0097 .macro m 0098 ldi @0, @1 0099 .endm m r16,\ 0 0100 0101 #define TEST \ 0102 .IF val \ 0103 .DW __TIME__ \ 0104 .ELSE \ 0105 .DW 1 \ 0106 .ENDIF 0107 0108 #defi TEST