I've only skimmed a few C tutorial / reference pages at this point (including some of the links in the sticky posts), trying to find something that would explain how to change the value of a variable as the program goes along, not just incrementing or decrementing that number, but I'm not finding much beyond the need to declare the variables at the beginning of the code.
In other words, I'm not finding how to do the C equivalent of:
LDA #$4A: STA $FF
(code etc.)
LDA #$41: STA $FF
For those portions of the program that simply stow numbers in memory for later, I know I eventually want the code to look something like the below, but I do NOT know the proper C syntax to do so, so please forgive my 'intellegince'.
LET R_0FF = 0x4A
(code etc.)
LET R_0FF = 0x41
Being able to understand how one can stick new numbers in a given variable on the fly will be a massive help in rewriting some 6800 assembly into something that can potentially be loaded into an Arduino.
I'll be asking more questions soon, as the further I get into rewriting the assembly into C, I'm bumping into things like conditional branches for which I don't see clear equivalents, bit shifting, etc.
In the meantime, I want to check on the syntax of a few representative statements I've worked out (proper formatting will come later):
Disp06 = ( RM57 && 0x0F ); - there are a fair number of cases where I need to strip out certain bits.
MSG06 = ( MSG06 || 0x01 ); - likewise, certain cases where I need to turn on certain bits.
if ( Disp09 != 0x02 ) goto LB_F8D3; - is this the same as the assembly snippet below?
'&&' is a logical AND. It produces a value of TRUE or FALSE and is used mostly in arguments of conditional statements. When you're bit twiddling, you want bitwise AND: '&'.
Same distinction for OR operations: '||' verses '|'.