1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

set DST in 87C51

Discussion in 'Assembly Language Programming (ALP) Forum' started by sundy58, Oct 31, 2018.

  1. sundy58

    sundy58 New Member

    Joined:
    Oct 30, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Occupation:
    electronics technician
    Location:
    Donna, TX
    Home Page:
    Thanks for having a forum for assembly language and hello.

    I manufacture synchronized clock systems. The previous owner did all the firmware for our products. I do not code so I hire out my firmware/software development. I have a master clock that is not setting DST (daylight saving time) consistently. My Chipmaster 3000 computer has finally died and before I pay someone to burn a bunch of chips I would like to get my DST issues worked out. The code is written for a 87C51FB and he used the ASM51 assembler, I mentioned the burner, I'm not sure what other info a person might need.

    I think this is the section of firmware that sets DST. I would appreciate feedback on the code, thanks.

    ;DSTWT: MOV DAYS,#0 ; DST DATE SET ROUTINE
    ; MOV IND1,#01100000B ; BEGIN, MONTH
    ; MOV SCTCH1,#1
    ; MOV IND2,#0
    ; MOV DHRS,#0FFH
    ; MOV DFLAG,#00000001B
    ; MOV SCTCH2,#0FFH
    ; MOV MINS,#0FFH
    ; MOV SCTCH3,#0FFH
    ; MOV SCTCH4,#0FFH
    ; MOV SCTCH5,#0FFH
    ; CALL BTNCLR
    ;DSTLUP: CALL BTNCK
    ; JB BTN1.5,DSTLP1 ; CANCEL
    ; JB BTN2.0,DSET ; AHEAD
    ; JB BTN2.1,DSET ; BACK
    ; JB BTN2.3,DSTREV ; REVIEW
    ; JB BTN2.2,DSTNXT ; SELECT
    ; JMP DSTLUP
    ;DSTLP1: JMP FINISH
    ;;
    ;DSTNXT: CALL BMD
    ; JMP DSTLUP
    ;DSET: CALL HT1
    ; MOV DPTR,#DST
    ; MOV A,SCTCH2
    ; MOVX @DPTR,A
    ; INC DPTR
    ; MOV A,SCTCH3
    ; MOVX @DPTR,A
    ; INC DPTR
    ; MOV A,SCTCH4
    ; MOVX @DPTR,A
    ; INC DPTR
    ; MOV A,SCTCH5
    ; MOVX @DPTR,A
    ; JMP DSTLUP
    ;DSTREV: MOV IND2,#00001000B ; REVIEW
    ; MOV IND1,#01110000B ; BEGIN, MONTH, DATE
    ; MOV DPTR,#DST
    ; MOVX A,@DPTR
    ; MOV DHRS,A
    ; INC DPTR
    ; MOVX A,@DPTR
    ; MOV MINS,A
    ;RVDST1: CALL BTNCLR
    ;DSRVLP: CALL BTNCK
    ; JB BTN1.5,DSTCNC ; CANCEL
    ; JB BTN2.3,DSTWT ; REVIEW
    ; JNB BTN2.2,DSRVLP ; SELECT
    ; MOV A,IND1
    ; ANL A,#10000000B ; CHECK FOR END
    ; JNZ DSTREV
    ; MOV IND1,#10110000B ; END, MONTH, DATE
    ;; MOV IND2,#00001000B ; REVIEW
    ; MOV DPTR,#DST+2
    ; MOVX A,@DPTR
    ; MOV DHRS,A
    ; INC DPTR
    ; MOVX A,@DPTR
    ; MOV MINS,A
    ; JMP RVDST1
    ;DSTCNC: MOV B,4H
    ; MOV DPTR,#DST
    ;RVDST2: MOV A,#0FFH
    ; MOVX @DPTR,A
    ; INC DPTR
    ; MOV A,B
    ; DEC A
    ; MOV B,A
    ; JNZ RVDST2
    ; JMP DSTREV
     

Share This Page