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 define a byte variable in bit addressing space in assembly

Hi,

There is am assembly file that will be integrated into my project that is written in c. A variable defined in the assembly file as

PROCTOCOL  equ  020H
I converted it to
RSEG ?BI?RunIsp?ISP
?RunIsp?BIT:
PROTOCOL:  DBIT  8
The compiler gave me two errors:
1. DATA-ADDRESS EXPECTED
2. INVALID BYTE BASE IN BIT ADDRESS EXPRESSION

The first error was caused by
MOV	PROTOCOL, #0
and the second error was caused by
SETB	PROTOCOL^1

How should I define PROTOCOL to make it work in c environment? Thank you for answering my question.

chao.

Parents
  • Hi,

    Did I provide not enough information about my question?
    The original assembly file compiled successfully. The file is like

    ...
    PROCTOCOL  equ  020H
    ...
    ...
    MOV	PROTOCOL, #0
    ...
    ...
    SETB	PROTOCOL^1
    ...
    ...
    
    I modified the declaration of PROCOCOL to
    ...
    ?BI?RunIsp?ISP SEGMENT BIT OVERLAYABLE
    ...
    ...
    RSEG ?BI?RunIsp?ISP
    ?RunIsp?BIT:
    PROTOCOL:	DBIT	8
    ...
    ...
    
    so my project written in c can use this file. After compilation, I got the two errors mentioned in the previous thread.

    chao.

Reply
  • Hi,

    Did I provide not enough information about my question?
    The original assembly file compiled successfully. The file is like

    ...
    PROCTOCOL  equ  020H
    ...
    ...
    MOV	PROTOCOL, #0
    ...
    ...
    SETB	PROTOCOL^1
    ...
    ...
    
    I modified the declaration of PROCOCOL to
    ...
    ?BI?RunIsp?ISP SEGMENT BIT OVERLAYABLE
    ...
    ...
    RSEG ?BI?RunIsp?ISP
    ?RunIsp?BIT:
    PROTOCOL:	DBIT	8
    ...
    ...
    
    so my project written in c can use this file. After compilation, I got the two errors mentioned in the previous thread.

    chao.

Children
No data