From: hackbard Date: Thu, 22 Jan 2004 01:00:56 +0000 (+0000) Subject: revised init, main + definitions X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=065354af55b9bb4593071eb3717ef508bd80f516;p=my-code%2Fatmel.git revised init, main + definitions --- diff --git a/beginners/season_junior.asm b/beginners/season_junior.asm index 8380e92..78c7962 100644 --- a/beginners/season_junior.asm +++ b/beginners/season_junior.asm @@ -33,6 +33,33 @@ ; ; buffer/parse whole strings and decide whether to send to card or not. +; some defines +; ------------ + +; baudrate = clock freq / etu +; std smartcard etu: 372 +; other smartcards: 625 +.define clock 8000000 +.define clk_h 4000000 +.define etu 625 +.define etu_h 312 +.define baudrate 5 ; UBRR value for 76800 bits/s (8mhz clock) + +; names for registers +.define tmp r16 +.define bitcount r17 +.define tmp1 r18 +.define tmp2 r19 +.define byte r20 +.define overflow_counter r21 +.define one r1 +.define zero r0 + + +; +; programm code +; ------------- + ; ; interrupt vectors: ; @@ -74,43 +101,41 @@ reti ; init routine ; -MAIN: -rjmp MAIN - INIT: ; set stackpointer -ldi r16,low(RAMEND) -out SPL,r16 +ldi tmp,low(RAMEND) +out SPL,tmp ; enable interrupts int0,int1 -ldi r16,((1<