A slight refinement to the previous code. I eliminated the macro and made the starting address a constant. Saves a little space. Again, needs a slight modifaction to unpack the character if using a 16F. (I might get to that example later)
SteveCode:;Removed variable declaration CntMonthletters var byte MonthOut var byte MonthOffset var byte MonthString: @ da "January " @ da "February " @ da "March " @ da "April " @ da "May " @ da "June " @ da "July " @ da "August " @ da "September" @ da "October " @ da "November " @ da "December " ;Added 2 lines for new constant Month_addr CON EXT @Month_addr EQU _MonthString ;Removed the macro and the macro call '----------------------------------------------------------------------------- ' ' ' Whatever code for main program ' ' ' ' 'Start your printout here after any other code Printit: SerOut2 SO,16468,["TIME: ",HEX2 hh,":",HEX2 mm,":",HEX2 ss,10,13] Pause 500 SerOut2 SO,16468,[HEX2 day," "] 'Printout the stored Month Strings monthoffset = ((mo & %00001111) + (10 * (mo >> 4)) - 1) * 10 for CntMonthletters = 0 to 8 Readcode (Month_addr + monthoffset + CntMonthletters), monthout IF monthout = " " THEN GOTO QuitMonthPrint SerOut2 SO,16468, [monthout] next CntMonthletters QuitMonthPrint: SerOut2 SO,16468,[" 20",HEX2 yr,13] ;This should have been removed in the original!! --> End Select Pause 1000 SerOut2 SO,16468,[" momth= ",HEX2 mo,13,12]




Bookmarks