File: global-init.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 (26 lines) | stat: -rw-r--r-- 714 bytes parent folder | download
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

ddrb = 0x17  
portb = 0x18 
ddrd = 0x11
portd = 0x12 


.section .text    ; denotes code section
  .global __do_clear_bss  ; and setup stack pointer

  .global main
  main: 	
     LDI R16, 0xff        ; load r16 with 255    
     OUT ddrb, R16        ; make all bits of port B as output 
     OUT ddrd, R16        ; make all bits of port D as output

     LDI R16, 1           
     PUSH R16             ; push R16 content to the stack
     INC R16
     PUSH R16             ; push the incremented value
     POP R17              ; should pop the last pushed value
     POP R18              ; shoul pop the previous

     OUT portb, R17       ; display on port B
     OUT portd, R18       ; display on port D
.end