Maker Pro
Maker Pro

"c" to asm.

trying

Oct 23, 2010
2
Joined
Oct 23, 2010
Messages
2
please forgive me I'm one of those newbies coming with a ?

I was looking @ some code that is a mix of "c" and asm. because I know just a little about
asm. and nothing about "c" how this would be written (or converted ) to asm.

#define word1 0x43
#define msb 0x07
#define same 0x01

void main()
{
// initialization
//
n_bits =0;
recv_reg =1;
cvs =4;
special_word =0x0f

I think n_bits =0 would be CLRF n_bits
and recv_reg =1 would be bsf recv_reg
but I'm not sure about the cvs=4 and special_word =0x0f
as for the #define would you list it after the endc as is just like I do
#DEFINE LED PORTC,0
thank you for your time
I'm just "trying"
 

juantravel

May 14, 2010
41
Joined
May 14, 2010
Messages
41
c to asm

Looks like there just initializing variables. Made it as basic as possible. Might want to read a little bit more on pic micro instruction set.


cblock
n_bits
recv_reg
cvs
special_word
endc


_main movlw 0x00
movwf n_bits
movlw 0x01
movwf recv_reg
movlw 0x04
movwf cvs
movlw 0x0F
movwf special_word
 
Last edited:

trying

Oct 23, 2010
2
Joined
Oct 23, 2010
Messages
2
thanks juantravel
that's what I did just making sure i did it right
 
Top