File: data-direct.S

package info (click to toggle)
kuttypy 2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,896 kB
  • sloc: python: 58,651; javascript: 14,686; xml: 5,767; ansic: 2,716; makefile: 453; asm: 254; sh: 48
file content (15 lines) | stat: -rw-r--r-- 450 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

ddrb = 0x17       ; I/O mapped address of register DDRB
portb = 0x18
PORTA = 0x3b      ; memory mapped address of PORTA

.section .text    ; denotes code section
.global main
main: 	
   LDI    R16, 0xff           ; load r16 with 255
   OUT ddrb, R16              ; set port B as output 

   STS PORTA, R16   ; Store R16 to the memory location PORTA
   LDS R17, PORTA    ; read it back to R17
   OUT portb, R17   ; display it on port B LEDs     
.end