Skip to main content
Visitor II
July 19, 2006
Question

Interrupt disable for some insrtuction

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

Interrupt disable for some insrtuction

    This topic has been closed for replies.

    2 replies

    y_gudekarAuthor
    Visitor II
    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

    Visitor II
    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