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