[ d_a_l_3 @ 05.05.2007. 11:11 ] @
Pozdrav svima..... Evo kako stvari stoje......... Imam zadatak koji glasi Potrebno je ostvariti mjerenje sekundi na Z80 sustavu koji radi na frekvenciji od 4MHz Izbrojene sekunde upisati na adresu 1000H. evo primjer s satima, minutama i sekundama.... ali meni trebaju samo sekunde pa ako je netko voljen pomoći, jer ne kontam ja to baš puno... Code: CTC0 EQU 04H CTC1 EQU 05H CTC2 EQU 06H CTC3 EQU 07H ORG 0000H LD SP,5000H LD A,11H LD I,A LD IX,1000H LD (IX+0),0 LD (IX+1),0 LD (IX+2),0 CALL INIC IM 2 EI INIC: LD A,00H OUT (CTC0),A LD A,00100101B OUT (CTC0),A LD A,125 OUT (CTC0),A LD A,11010101B OUT (CTC1),A LD A,125 OUT (CTC1),A LD A,11010101B OUT (CTC2),A LD A,60 OUT (CTC2),A LD A,11010101B OUT (CTC3),A LD A,60 OUT (CTC3),A RET ORG 1100H DW 0000H DW 2000H DW 2500H DW 3000H ORG 2000H INC (IX+0) RETI ORG 2500H INC (IX+1) RETI ORG 3000H INC (IX+2) RETI END PS. Radi se preko CTC-a(Counter Timer Channels) Hvala |