Shop OBEX P1 Docs P2 Docs Learn Events
Multi byte addition — Parallax Forums

Multi byte addition

dbjdbj Posts: 75
edited 2006-12-24 18:27 in General Discussion
I don't understand why the ones dont carry over·when the clock counts up it·goes from 01-02-03-04-05-06-07-08-09-00-01 ect·, Trying to understand Multi byte addition, Can any one help, David

Post Edited (dbj) : 12/24/2006 4:40:24 PM GMT

Comments

  • JonnyMacJonnyMac Posts: 9,443
    edited 2006-12-24 18:27
    I'm wondering if you're having a problem with you BCD2DEC function; SX/B expects the return value to be in __PARAM1 but you're putting it into W. If you look at the compiled listing (use Ctrl+L) you can see this.

    This line:

    work = BCD2DEC time (Hrs)
    



    compiles to:

    MOV FSR,#time+Hrs              ;    work = BCD2DEC time (Hrs)
    MOV __PARAM1,IND              
    BANK $00                      
    CALL @__BCD2DEC               
    MOV work,__PARAM1
    

    Post Edited (JonnyMac) : 12/24/2006 6:31:46 PM GMT
Sign In or Register to comment.