X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Fatmel.git;a=blobdiff_plain;f=beginners%2Fseason_junior.asm;h=9171e7c57128f3289017444e242ce0789a0f557b;hp=e6a46067d459aaf6c6aa0bd249c0921370a2f84a;hb=322f236d2088f0ffc8335fa10fd52a7cc2317519;hpb=d33a33e018bbcaa09907be8fa03b965fe411a974 diff --git a/beginners/season_junior.asm b/beginners/season_junior.asm index e6a4606..9171e7c 100644 --- a/beginners/season_junior.asm +++ b/beginners/season_junior.asm @@ -28,14 +28,12 @@ ; 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) +.equ etu = 625 +.equ etu_h = 312 +.equ baudrate = 8 ; UBRR value for 57600 bits/s (8mhz clock) ; sizes -.define uart_data_len 4 +.equ uart_data_len = 4 ; names for registers .def tmp = r16 @@ -51,27 +49,31 @@ .def mode = r26 .def counter_l_tmp = r27 .def counter_h_tmp = r28 -.def address_h = r31 -.def address_l = r30 .def one = r1 .def zero = r0 ; state -.define LOW (1<<0) -.define LOW_F 1 -.define HIGH (1<<1) -.define HIGH_F 2 +.equ LOW = (1<<0) +.equ LOW_F = 1 +.equ HIGH = (1<<1) +.equ HIGH_F = 2 ; mode -.define STUPID (1<<0) ; forward cam <-> card communication -.define STUPID_F 1 -.define COOL (1<<1) ; send time (clocks) & state via uart -.define COOL_F 2 -.define ELITE (1<<2) ; create bytes, maybe even whole command arrays -.define ELITE_F 3 -.define GODLIKE (1<<3) ; filter and mask for commands to card - send rejected via uart only -.define GODLIKE_F 4 -.define INCREDIBLE_HACK (1<<4) ; destroy all your hardware -.define INCREDIBLE_HACK_F 5 +.equ STUPID = (1<<0) ; forward cam <-> card communication +.equ STUPID_F = 1 +.equ COOL = (1<<1) ; send time (clocks) & state via uart +.equ COOL_F = 2 +.equ ELITE = (1<<2) ; create bytes, maybe even whole command arrays +.equ ELITE_F = 3 +.equ GODLIKE = (1<<3) ; filter and mask for commands to card - send rejected via uart only +.equ GODLIKE_F = 4 +.equ INCREDIBLE_HACK = (1<<4) ; destroy all your hardware +.equ INCREDIBLE_HACK_F = 5 +; leds +.equ LED_CARD = PB0 +.equ LED_CAM = PB1 +.equ LED_FWD_TO_CAM = PB2 +.equ LED_FWD_TO_CARD = PB3 +.equ LED_OVERFLOW = PB4 ; but there is only stupid and cool mode right now %) @@ -131,11 +133,11 @@ cbi PORTD,PD4 ldi tmp,low(RAMEND) out SPL,tmp -; enable interrupts int0,int1 +; enable interrupts int0,int1,sleep ldi tmp,((1<