"diagonal line"

not vertically locked, just a test
also not the whole screen, just a bit
This commit is contained in:
giomba 2021-06-26 22:34:22 +02:00
parent b7004a0171
commit 29990cd93a
2 changed files with 31 additions and 4 deletions

21
main.S
View File

@ -2,9 +2,13 @@
#include "macro.h"
.data
status:
.byte 0x0
offset:
.byte 78
.text
.global main_s
@ -64,7 +68,17 @@ wait2:
.global int0_handler
int0_handler:
ldi r31, 80
push r31
in r31, IO(SREG) ; status register
push r31
lds r31, offset
dec r31
cpi r31, 1
brne 1f
ldi r31, 78
1:
sts offset, r31
loop:
dec r31
brne loop
@ -85,5 +99,8 @@ loop:
nop
cbi IO(PORTB), 4
1:
pop r31
out IO(SREG), r31
pop r31
reti
ret

14
main.c
View File

@ -4,8 +4,18 @@
void main_s(void);
void int0_handler(void);
ISR(INT0_vect) {
int0_handler();
void pippo() {
asm("nop");
asm("push r1");
int i = 0;
i = 2;
i += 1;
reti();
}
ISR(INT0_vect, ISR_NAKED) {
asm("jmp int0_handler");
}
int main() {