w7 = w4 + w5
If w6 = w7 Then
w6=0
EndIf
Symbol ram_locn = $50 'or some other free RAM location
Poke ram_locn, WORD w7 'preserve w7 value
w7 = w4 + w5
If w6 = w7 Then
w6=0
EndIf
Peek ram_locn, WORD w7 'restore w7 value
w6 = w4 + w5 - w6 Max 1 * w6