Code: Select all
0231d: ac,67,52 ldzbw R52,R67 wR52 = yR67;
0236c: 17,52 incb R52 R52++;
0236e: 99,05,52 cmpb R52,5
02371: d3,02 jnc 02375 if (R52 >= 5) {
02373: 11,52 clrb R52 R52 = 0; }
02375: c4,67,52 stb R52,R67 R67 = R52;
0237b: d7,a0 jne 0231d if (R52 != 5) goto 0231d;
Ok, I think I am finally starting to get the signed/unsigned numbers, sort of, lol. Still some confusion here, I will elaborate later when I can find a good example. I get the 0x0000-0x7fff is positive and anything over that is negative? How about a 2 digit number? say 0x6f? That may not even be a thing, and I am overthinking it again.First off 6E1A is between 0x0000 & 0x7FFF so it is a positive value.
[/quote]Line 02373 sets R52 = 0, so we are starting at [0+6E1A], add the data bank prefix, = 0x16E1A.[/quote]
So if it is greater than or equal to 5 it clears R52 and sets back to zero?
[/quote]Line 0263C increments R52 by 1 on each loop.[/quote]
I think I understand this.
[/quote]Line 02371 skips Line 02373 while R52 = 0 through 4.[/quote]
This one confuses me a little, This line reads, to me, if R52 is greater than or equal to 5 it skips 02375, I was not understanding the {} on different lines until this explanation, Does that indicate that the code continues to the lines within the {} when the "if" is false? I think I am confusing myself even more, If I read this like above then the code would indicate if it is greater then or equal to 5 clear the register(or set it to 0) as per the command within the {}. If that (R52>=5) is false then perform the command on the same line?
[/quote]Line 02375 stores the current value of R52 so that it can be loaded back at Line 0231D.[/quote]
I understand this one as well.
[/quote]Line 0237B loops back to Line 0231D until R52 = 5, that is the loop stop. R52 = 0 through 4 will be processed.[/quote]
I think I read that the "!" means stop, is that correct? So I should read this line as " If R52 is equal to a 5, then stop the loop, if it is anything under 5, keep looping"?