Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Assembly syntax for reading specific bits

Status
Not open for further replies.

alperuslu

Full Member level 2
Full Member level 2
Joined
May 16, 2009
Messages
130
Helped
32
Reputation
64
Reaction score
25
Trophy points
1,308
Location
Istanbul , Turkey
Activity points
1,975
Hi everyone

I am using Texas Instrument's C5505 dsp. I want to read specific bit from the I/O register.For example i want to read ADCBUSY bit that is at 15th position of ADCDATA I/O register.How can i read only this bit?

Thanks
 

Read all the register and then mask the bit you want to extract (AND with 0x8000 for B15).

Regards

Mowgli
 

It takes two clock cycle and does not support parralelism.I want to read specific bit at one clock cycle but after researching i can not find any assembly syntax for reading specific bits that are in I/O address space. Thanks for your interest.
 

How is that register defined in the header file?
--
Amr
 

As far I know I don't think that you could find a faster way to test the status of a I/O line using a commercial CPU: usually the status of processor's IO line is mapped to a specific bit in one (or more depending on the IO pin count) CPU register. So I suppose that 2 clock cycles are the minimum overhead you could expect to acquire this information: I am not expert on CPU architecture design but I think that this is because the IO status registers are not allowed to be directly used as operand register for ALU instructions, so the CPU has to perform a read to move the IO register value in the ALU operand register and then the bitwise operation (AND with the bit mask value) to get the status of the IO line.

Just for my curiosity: why it is so critical doing this operation in a single cycle?

Regards
Mowgli
 

It is not critical just i want to know is there any way to read specific bit in one instruction cycle.If there is one way to read it in one cycle why i dont use ?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top