Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/17/04 03:35
Read: times


 
#68661 - Decelaration of a short int
Hello

I want to delcare an unsigned short int to and call it counter, but this is the first time writing code is ams
can anyone help. I have included my code for. Thanks for the help in advance

/* used to time a one minute interval */

/* need a unsigned short int called counter to cout 1000 overflows set counter to 0 initally */


mov TMOD, #40h ; counting machine cycles
mov TH1, #38h ; counts 200 clock pulse = 200 * .5us = 1 ms for 24MHz crystal
stay: JNB TF1, stay ; stay here until timer 1 overflows
inc counter ; counter = counter + 1
cjne counter, #3E8h, clear ; conditional jump if counter ~= 1000 then clear TF1
mov counter, #00h ; counter = 1000 so reload
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


List of 5 messages in thread
TopicAuthorDate
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      

Back to Subject List