Its "02 June 2006" !


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    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)

    Code:
    ;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]
    Steve
    Last edited by SteveB; - 4th October 2006 at 04:22.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts