Assembly help!!!

Status
Not open for further replies.

ttbuddy

New Member
Guys, I really really need your help to get me out of my problems which I'd been suffered for months. Please if possible, spend a lil' of your time, it may helps a people like me who's almost exhausted.

I am gonna implement a code using the algorithm below:

Code:
1.Multiply 16 bits binary number of AmpHour and Volts
2.Convert to human readable characters on hyper terminal
3.Transmit this value serially via software UART .
To be honest, I am referring to this project from bhabott and permitted by the author.
The complete code is here

I need to add the algorithm above to this existing code. Until now, I'd tried this:
Code:
;16 bit register 'a'
   WORD        aa
;16 bit register 'b'
   WORD        bb
   WORD        energy
multiply:
mov16       AmpHour,aa
mov16       Volts,bb
call mult16                        ;multiply AmpHour with Volts
skpc                               ; remainder > 0.5 ?
goto        store_energy           ;store as energy
inc16       dd+2                   ;yes, round up
call print_Char
store_energy:
mov16       dd+2,energy
where mov16 and inc16 declared as:
Code:
;               16 bit macros (Big-Endian)
;
mov16    MACRO    src,dst
    movf    src,w
    movwf    dst
    movf    src+1,w
    movwf    dst+1
    ENDM
inc16    MACRO    dst
    incf    dst+1
    skpnz
    incf    dst
    ENDM
Please, I really need your help. This is a forum. Thanks.....
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…