Example #1
0
 public override string GenerateCode()
 {
     return(string.Format("if({0})\r\n{{\r\nint16_t count = {3} % 16;\r\nif(count == 0)\r\n{{\r\n{2} = {1};\r\n}}\r\nelse if(count > 0)\r\n{{\r\nint16_t temp1,temp2;\r\ntemp1 = ({1} >> count) << count;\r\ntemp2 = {1} - temp1;\r\ntemp1 = (temp1 >> count) & (int16_t)(pow(2,16 - count) - 1);\r\n{2} = temp1 + (temp2 << (16 - count));\r\n}}\r\nif({2} == 0)\r\n{{\r\nMBit[8167] = 1;\r\n}}\r\n}}\r\n", ImportVaribleName, SourceValue.GetValue(), DestinationValue.GetValue(), Count.GetValue()));
 }
Example #2
0
 public override string GenerateCode()
 {
     return(string.Format("if({0})\r\n{{\r\nif({3} >= 16)\r\n{{\r\n{2} = ({1} >> 16) & 0x0000;\r\nMBit[8166] = {1} & 0x8000;\r\n}}\r\nelse if({3} > 0)\r\n{{\r\n{2} = ({1} >> {3}) & (int16_t)(pow(2,16 - {3}) - 1);\r\nMBit[8166] = ({1} << (16 - {3})) & 0x8000;\r\n}}\r\nelse if({3} == 0)\r\n{{\r\n{2} = {1};\r\n}}\r\nif({2} == 0)\r\n{{\r\nMBit[8167] = 1;\r\n}}\r\n}}\r\n", ImportVaribleName, SourceValue.GetValue(), DestinationValue.GetValue(), Count.GetValue()));
 }
Example #3
0
 public override string GenerateCode()
 {
     return(string.Format("if({0})\r\n{{\r\nif({3} >= 32)\r\n{{\r\n{2} = {1} << 32;\r\nMBit[8166] = {1} & 0x00000001;\r\n}}\r\nelse if({3} > 0)\r\n{{\r\n{2} = {1} << {3};\r\nMBit[8166] = ({1} >> (32 - {3})) & 0x00000001;\r\n}}\r\nelse if({3} == 0)\r\n{{\r\n{2} = {1};\r\n}}\r\nif({2} == 0)\r\n{{\r\nMBit[8167] = 1;\r\n}}\r\n}}\r\n", ImportVaribleName, SourceValue.GetValue(), DestinationValue.GetValue(), Count.GetValue()));
 }
Example #4
0
 public override string GenerateCode()
 {
     return(string.Format("if({0})\r\n{{\r\nif({3} <= 512 && {3} >= 1)\r\n{{\r\nint32_t* psrc = &{1},pdes = &{2};\r\nint32_t temp[{3}];\r\nfor(int i = 0;i < {3};i++)\r\n{{\r\ntemp[i] = *psrc;\r\npsrc++;\r\n}}\r\nfor(int i = 0;i < {3};i++)\r\n{{\r\n*pdes = temp[i];\r\npdes++;\r\n}}\r\n}}\r\n}}\r\n", ImportVaribleName, SourceValue.GetValue(), DestinationValue.GetValue(), Count.GetValue()));
 }