m820241220004int.asm


;; (C) David Vajda
;; 2024-12-20
;; Extern Interrupts PORTD and LED count PORTB

.include "m8def.inc"

.org 0x000
rjmp RESET
.org INT0addr
rjmp INT0ISRaddr
.org INT1addr
rjmp INT1ISRaddr

RESET:
ldi r16, HIGH (RAMEND)
out SPH, r16
ldi r16, LOW (RAMEND)
out SPL, r16

ldi r16, 0x00
out DDRD, r16
ldi r16, 0xff
out DDRB, r16

ldi r16, (1 << INT1) | (1 << INT0)
out GICR, r16
ldi r16, (1 << ISC11) | (1 << ISC10) | (1 << ISC01) | (1 << ISC00)
out MCUCR, r16

sei

end: rjmp end

INT0ISRaddr:
inc r16
out PORTB, r16
reti

INT1ISRaddr:
dec r16
out PORTB, r16
reti

Und hier mit sieben segment