Bug in Increment Word Instruction

There is a bug in the Increment Word Function, with MeccCompiler II and AWOS (MOtorVator OS) version 2.23

The bug incorrectly increments from 0xFFH, and adds 257 rather than 1.

So 00FFH (255) increments to 0200h (512) rather than 0100h (256). Similarly for 01FFH, 02FFH etc.

You can correct this in your code by using the following code:

Increment stepcount ; increment Word Value
WordLow = LowByte(stepcount) ; check the lower byte
If WordLow = 0 Then ; if this has just gone to 0
stepcount = stepcount - 256
End If