This appears to be for a PIC18F microcontroller. Yes? See http://technology.niagarac.on.ca/staff/mboldin/18F_Instruction_Set/
The PIC is very old and might have trouble supporting C. Are you trying to rewrite in C for the PIC or to convert to another architecture? Does PIC have a credible C compiler and tool chain?
For basic asm, the symbols on the left are "labels", just like in C.
The PIC has a number of instructions that are "test condition and skip next instruction if true".
For example, the first loop that has the label "LOW0". In C, this would look like:
LOW0:
if (INPUT0 != 0)
goto LOW0;
Cleaning this up:
while (INPUT0 != 0);
But, there are a number of undefined symbols: INPUT0, TMR0, COUNTER. The INPUT0 appears to be a memory mapped I/O port, as does TMR0. COUNTER looks like an ordinary global, but you've got to figure out which is which.
There are some calls to other subroutines that aren't defined. Are they in assembly or are they C? If assembly, is the calling convention for arguments the same?
If everything else has already been ported to C, and this is just a straggler, recoding it is trivial. If I had more of those above questions answered, I could have recoded the whole thing in less time than it took me to write this post.
If your project is moving off the PIC arch, it makes sense. What's the motivation [and context]?
UPDATE:
I've downloaded your full file and analyzed it. Caveat: Although I've been doing C for 30+ years and assembler for 40+, I'm a PIC18F newbie, but I've been able to draw on the experience.
The PIC is an 8 bit microcontroller with a single general purpose register called "W" or "working register". It also has "register files", denoted by "F". It has a few instructions that can move bytes to/from W and a given register in a given register file. More on this later.
Print [repeating: Print] all the files/web pages in question. Create a book.
The PIC is relatively simple, with a relatively few instructions. I'd recommend doing your analysis in assembler. By the time you learn enough about the asm and the arch to actually translate into C, you'll actually be able to grok the asm.
The analogy for C is that you're only allowed to do:
if (x) goto label
if (! x) goto label
foo() // with _no_ arguments
W = ...
F[idx] = W
W = F[idx]
First, p12f675.inc is the master definition file for the PIC. It's just a bunch of definitions. Note that ";" is the comment character and is equivalent to C's ANSI "//" [they're both "full line"]. The "EQU" is like a C enum. If you wanted to convert the entire file to a C .h file, change all ";" into "//". Put "enum {" at the top and "};" at the bottom. Then change all:
OSCCAL EQU H'0090'
into:
OSCCAL = 0x0090,
You needn't actually do that, and I recommend against it. Just bite the bullet and get comfy with the EQU syntax.
Here's a general resource: http://www.pic18f.com/ and this tutorial will be pretty helpful getting started: http://www.pic18f.com/tutorial/2007/12/04/18f4550-and-assembly-overview/
For every asm/machine instruction, using the original site I mentioned, print off the given page for the given instruction. For example, for the "movwf", print this page: http://technology.niagarac.on.ca/staff/mboldin/18F_Instruction_Set/MOVWF.html
There really aren't that many. And some aren't in the index page. Just google them. In fact, it might just be easier to print every link on the index page. Then, you'd have the complete "instruction set reference"
PIC register files are "banked". The closest analogy I can think of is consider a 2-dim C array: "F[2][256]". But, you can't access F[y][x] directly. You must do a "selectY(1)" [selects "bank" 1] and the a "getF(x)" [gets the x'th register in the given bank]. See the .inc file for values of x for a given bank. Not all values of x may be valid for a given bank. Dunno.
Some of the registers in the register file are I/O ports (e.g. GPIO). Some are internal, such as STATUS. So, after you've transferred the given F register (e.g. STATUS) into the W register, you can then examine individual bits. In the .inc file, there are EQU's (called "equates") for "C" [the processor "carry" flag] and "Z" [the CPU's "zero" flag"].
Note that ".whatever" denotes a constant value (vs a memory location).
Note that the next to last thing the INIT section of your code does is BANKSEL GPIO. So, when we get to executing the LOW0 loop, INPUT0 is replaced by "GPIO,0" which means bit 0 of register GPIO, which is register 5 in bank 0.
In C, access to hardware registers must be marked "volatile", so, for illustration, F should be "volatile unsigned char F[2][256]".
So, to recode "LOW0" again:
LOW0:
if ((F[0][0x0005] & (1 << 0)) != 0)
goto LOW0
Also, your main.asm has excellent comments. Try ignoring the asm insts and just read the comments over a few times. Then go back and read over the instruction definitions a few times. Cross reference them.
Oh, yeah. Drawing out the register files on graph paper might help.
The pen is mightier than the sword. And to understand asm, pen and paper can be mightier than the computer :-)