This is how the processor reacts, interesting never been in a similar situation, can you give the details.
Condition
Flags
E Z V C N
0 * S 0 *
E Always cleared.
Z Set if result equals zero. Cleared otherwise.
V Set if an arithmetic overflow occurred, i.e. if the divisor (op1)
was zero (the result in MDH and MDL is not valid in this case).
Cleared otherwise.
C Always cleared.
N Set if the most significant bit of the result is set. Cleared
otherwise.
Well, I'm trying to achieve phlsnh = 0. One way is to set UBHS = 0, but that would also kill precat sensor heater voltage thus disabling both sensors completely
Just found out this today, never thought that one map can be shared between two functions, but looks like UBHS is. So, the other way to set phlsnh = 0 is to somehow circumvent it in the UB_KORR3 subfunction... OR if possible to change ASM code to use constant zero instead of UBHS map... Hm... that might be interesting solution...
seg003:54D1A sub_854D1A:
seg003:54D1A mov [-r0], r9
seg003:54D1C mov [-r0], r8
seg003:54D1E mov [-r0], r7
seg003:54D20 mov [-r0], r6
seg003:54D22 sub r0, #4
seg003:54D24 jnb word_FD9A.1, loc_854D3A
seg003:54D28 movb rl4, ub ; ub
seg003:54D2C extp #206h, #1
seg003:54D30 cmpb rl4, UBHS ; UBHS
seg003:54D34 jmpr cc_UGT, loc_854D3A
seg003:54D36 bset USR0
seg003:54D38 jmpr cc_UC, loc_854D3C
Could I just do something like this:
seg003:54D30 cmpb rl4, #0 ; set to #0