??? 04/17/04 04:39 Read: times |
#68663 - I almost have it Responding to: ???'s previous message |
/* used to time a one minute interval */
/* want timer 1 in 8 bit auto reload */ /* need 2 unsigned char counter1 and counter to cout 1000 overflows of timer1, inital values for counter1 and counter2 are 0 */ counter SEGMENT DATA RSEG counter ; DSEG AT 42h ; counter1: DS 1 ; counter2: DS 1 ; timingcode SEGMENT CODE CSEG AT 00h start: mov TMOD, #40h ; counting machine cycles mov TH1, #38h ; counts 200 clock pulse = 200 * .5us = 1 ms for 24MHz crystal mov counter1, #00h ; mov counter2, #00h ; setb TR1 ; start timer stay: JNB TF1, stay ; stay here until timer 1 overflows inc counter1 ; counter = counter + 1 mov R0, counter1 ; cjne R0, #00h, clear ; if counter 1 didn't overflow jump to clear inc counter2 ; counter1 over flowed inc counter2 mov R0, counter2 ; cjne R0, #03h, clear ; counter2 not 03 so jump to clear mov R0, counter1 ; cjne R0, #0E8h, clear ; counter1 not E8 so jump to clear mov counter1, #00h ; counter = 1000 so reload mov counter2, #00h ; counter is reloaded lcall inc_min () ; counter = 1000 so inc the min clear: clr TF1 ; clear the overflow flag for next time ajmp check_set () ; check the clock_set button every ms ; insert a check for trigger ajmp stay ; jump back to stay END My new question is: How do I call a function in asm when the function that I am calling is written in C? Do I need to prototype my C function, if so how? |
Topic | Author | Date |
Decelaration of a short int | 01/01/70 00:00 | |
RE: Decelaration of a short int | 01/01/70 00:00 | |
I almost have it | 01/01/70 00:00 | |
RE: Decelaration of a short int | 01/01/70 00:00 | |
To the poster or imposter:![]() | 01/01/70 00:00 |