Skip to content

Commit 7136f48

Browse files
Removed empty lines in code example
1 parent 25a1e48 commit 7136f48

1 file changed

Lines changed: 11 additions & 22 deletions

File tree

examples/prism-asmatmel.html

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ <h2>Labels</h2>
55
<pre><code>label1: ; a label</code></pre>
66

77
<h2>Opcodes</h2>
8-
<pre><code>
9-
LD
8+
<pre><code>LD
109
OUT
1110

1211
; lowercase
@@ -15,39 +14,31 @@ <h2>Opcodes</h2>
1514
</code></pre>
1615

1716
<h2>Assembler directives</h2>
18-
<pre><code>
19-
.segment CODE
17+
<pre><code>.segment CODE
2018
.word $07d3
2119
</code></pre>
2220

2321
<h2>Registers</h2>
24-
<pre><code>
25-
LD A ; "A"
22+
<pre><code>LD A ; "A"
2623
LDA label1,x ; "x"
2724
</code></pre>
2825

2926
<h2>Strings</h2>
30-
<pre><code>
31-
.include "header.asm"
27+
<pre><code>.include "header.asm"
3228
</code></pre>
3329

3430
<h2>Numbers</h2>
35-
<pre><code>
36-
ldi r24,#127
31+
<pre><code>ldi r24,#127
3732
ldi r24,$80f0
3833
ldi r24,#%01011000
3934
</code></pre>
4035

4136
<h2>Constants</h2>
42-
<pre><code>
43-
ldi r16, (0&lt;&lt;PB5)|(1&lt;&lt;PB4)|(1&lt;&lt;PB3)|(1&lt;&lt;PB2)|(1&lt;&lt;PB1)|(1&lt;&lt;PB0)
44-
</code></pre>
37+
<pre><code>ldi r16, (0&lt;&lt;PB5)|(1&lt;&lt;PB4)|(1&lt;&lt;PB3)|(1&lt;&lt;PB2)|(1&lt;&lt;PB1)|(1&lt;&lt;PB0)</code></pre>
4538

4639
<h2>Example program to light up LEDs</h2>
4740
<h3>Attach an LED (through a 220 ohm resistor) to any of the pins 0-12</h3>
48-
<pre><code>
49-
;
50-
; Pin Constant Values (Tested on Arduino UNO)
41+
<pre><code>; Pin Constant Values (Tested on Arduino UNO)
5142
; PD0 - 0
5243
; PD1 - 1
5344
; PD2 - 2
@@ -67,23 +58,21 @@ <h3>Attach an LED (through a 220 ohm resistor) to any of the pins 0-12</h3>
6758
start:
6859

6960
; Set pins 0-7 to high
70-
ldi r17, (1&lt;&lt;PD7)|(1&lt;&lt;PD6)|(1&lt;&lt;PD5)|(1&lt;&lt;PD4)|(1&lt;&lt;PD3)|(1&lt;&lt;PD2)|(1&lt;&lt;PD1)|(1&lt;&lt;PD0)
61+
ldi r17, (1&lt;&lt;PD7)|(1&lt;&lt;PD6)|(1&lt;&lt;PD5)|(1&lt;&lt;PD4)|(1&lt;&lt;PD3)|(1&lt;&lt;PD2)|(1&lt;&lt;PD1)|(1&lt;&lt;PD0)
7162
out PORTD, r17
7263

7364
; Set pins 8-13 to high
74-
ldi r16, (1&lt;&lt;PB5)|(1&lt;&lt;PB4)|(1&lt;&lt;PB3)|(1&lt;&lt;PB2)|(1&lt;&lt;PB1)|(1&lt;&lt;PB0)
65+
ldi r16, (1&lt;&lt;PB5)|(1&lt;&lt;PB4)|(1&lt;&lt;PB3)|(1&lt;&lt;PB2)|(1&lt;&lt;PB1)|(1&lt;&lt;PB0)
7566
out PORTB, r16
7667

7768
; Set pins 0-7 to output mode
78-
ldi r18, (1&lt;&lt;DDD7)|(1&lt;&lt;DDD6)|(1&lt;&lt;DDD5)|(1&lt;&lt;DDD4)|(1&lt;&lt;DDD3)|(1&lt;&lt;DDD2)|(1&lt;&lt;DDD1)|(1&lt;&lt;DDD0)
69+
ldi r18, (1&lt;&lt;DDD7)|(1&lt;&lt;DDD6)|(1&lt;&lt;DDD5)|(1&lt;&lt;DDD4)|(1&lt;&lt;DDD3)|(1&lt;&lt;DDD2)|(1&lt;&lt;DDD1)|(1&lt;&lt;DDD0)
7970
out DDRD, r18
8071

8172
; Set pins 8-13 to output mode
82-
ldi r19, (1&lt;&lt;DDB5)|(1&lt;&lt;DDB4)|(1&lt;&lt;DDB3)|(1&lt;&lt;DDB2)|(1&lt;&lt;DDB1)|(1&lt;&lt;DDB0)
73+
ldi r19, (1&lt;&lt;DDB5)|(1&lt;&lt;DDB4)|(1&lt;&lt;DDB3)|(1&lt;&lt;DDB2)|(1&lt;&lt;DDB1)|(1&lt;&lt;DDB0)
8374
out DDRB, r19
8475

8576
loop:
8677
rjmp loop ; loop forever
87-
88-
8978
</code></pre>

0 commit comments

Comments
 (0)