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

Assembly variables form C

I am writing a small C function which is suppose to replace the assembly function

My rest code is written in assembly and the assembler (asm51) is used

The data declaration is done as

t33      EQU     53H
t34      EQU     54H
t35      EQU     55H
t36      EQU     56H
t46      EQU     0A7H
Now here the t32 is a macro definition
(if I am not wrong as I have never used assembly but do have knowledge of it since it was there in the curriculum)

and it is referred as variable in the assembly program as
    MOV     A,t32
    CJNE    A, #1FH,Chk

and I want to access the same t32 from my C function

I tried defining the variables as
t32       	DATA     52H
t33       	DATA     53H
t34       	DATA     54H
t46       	DATA     0A7H

But it does not give me the access in C if I wrote
extern unsigned char t32;

The addressing of the variables at that particular location cannot be changed as some places the address is used as
MOV     R0,#t46

I have only two days to complete the program
and I have finished my C function and it is working fine but
I am not able to patch it at old assembly function


Please help
sachin

0