Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    eager to know weirdness of asm cli...

    General Discussion
    0
    1
    299
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 01/06/2005 at 09:13, xxxxxxxx wrote:

      Hi, i have 1 question about inline assembly.  as shown in the program listing below, if i remove "asm cli", "i=8, flag=5" statement will not be executed.....why the program doesn't work???  why inline assembly asm makes the difference?   I'm hoping that i can get the answer here. please and thanks.
      #include <mc9s12dp256.h>        /* derivative information */
      #include "pll.h"                /* defines _BUSCLOCK, sets bus frequency to _BUSCLOCK MHz */

      void main(void) {
      unsigned int  i, flag;
        /* set system clock frequency to _BUSCLOCK MHz (24 or 4) */
        PLL_Init();
        /* set port B as output (LEDs) */
        DDRB  = 0xff;       // Port B is output
        /* allow all interrupts */
        asm cli   //weirdness happen here
        
        i = 8;
        if (i==8) {
       
          flag=5;
       
        }
       
        /* forever */
        for(;;){}     // remove this to make things even worse...
      }

      1 Reply Last reply Reply Quote 0
      • First post
        Last post