Debian Codegraph @

examples/ASM/io-direct.S

raw
1 ; program io-direct.S to demonstrate direct I/O addressing
2
3 .section .text ; denotes code section
4 .global main
5 main:
6 LDI R16, 255
7 LDI R17, 0b10101010
8 OUT 0x17, R16 ; I/O address of DDRB is 0x17
9 OUT 0x18, R17 ; PORTB is at 0x18, alternate LEDs should glow
10 .end