This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to use a bit variable defined in another module?

Gentlemen:
I wanna use a bit variable in file:assem.asm.And the bit variable is defined in another file:main.c;Just as follows:

in main.c
unsigned char bdata flags;
sbit red_flag = flags^1;

in assem.asm
what should I do to let the keil know I want invoke the red_flag bit variable which is defined in main.c;how to declare it? The MCU I use is atmel at89s52.Thanks.
---going to mad.

Parents
  • Dear Jim:
    Thank you for helping me with this problem.
    Now I've got another qustion that:
    in my main.c flie,I define as follows:
    sbit sda = P1^1;
    sbit scl = P1^2;

    Now I wanna use sda & scl in my assem.asm file,how to declare them? I have tried these:
    extrn bit(sda);extrn bit(scl);
    but failed.:(

    So is it possible?If yes,then how?
    expecting your reply.

Reply
  • Dear Jim:
    Thank you for helping me with this problem.
    Now I've got another qustion that:
    in my main.c flie,I define as follows:
    sbit sda = P1^1;
    sbit scl = P1^2;

    Now I wanna use sda & scl in my assem.asm file,how to declare them? I have tried these:
    extrn bit(sda);extrn bit(scl);
    but failed.:(

    So is it possible?If yes,then how?
    expecting your reply.

Children