cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt disable for some insrtuction

y_gudekar
Associate II
Posted on July 19, 2006 at 05:22

Interrupt disable for some insrtuction

2 REPLIES 2
y_gudekar
Associate II
Posted on July 18, 2006 at 15:49

Hi,

I am using ST72561 chip in my application.

I am carrying subtraction operation on variable g_uch_number_of_unread_characters_pos_bos as follow.

g_uch_number_of_unread_characters_pos_bos--;

assembly code generated for above operation is as follow.

ld a,_g_uch_number_of_unread_characters_pos_bos

sub a,#1

ld _g_uch_number_of_unread_characters_pos_bos,a

I am incrementing same variable in intrrrupt.

while carrying 3 instruction for subtraction operation i want to disable interrupt (while executing 3 instruction, even if interrupt comes, then it should get invoke after executing 3 instruction).

whether following sequence will solve my problem?

SIM

g_uch_number_of_unread_characters_pos_bos--;

RIM

If not, then what is other solution?

regards....

Yogesh

wolfgang2399
Associate II
Posted on July 19, 2006 at 05:22

Hi Yogesh,

if you put the variable g_uch_number_... in the short addressing area (00..FFh) the compiler should generate the one instruction command:

dec _g_uch_number_of_unread_characters_pos_bos

Regards

WoRo