Skip to main content
y_gudekar
Associate III
July 19, 2006
Question

Interrupt disable for some insrtuction

  • July 19, 2006
  • 2 replies
  • 645 views
Posted on July 19, 2006 at 05:22

Interrupt disable for some insrtuction

This topic has been closed for replies.

2 replies

y_gudekar
y_gudekarAuthor
Associate III
July 18, 2006
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 III
July 19, 2006
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