Advertisement
Guest User

Untitled

a guest
Dec 13th, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. .method public hidebysig static
  2. float64 M () cil managed
  3. {
  4. .locals init (
  5. [0] int32 a,
  6. [1] int32 b,
  7. [2] float64 e,
  8. [3] float64 c,
  9. [4] float64 d,
  10. [5] bool,
  11. [6] float64
  12. )
  13.  
  14. nop //Blank Instruction, no operation
  15. ldc.i4.s 34 //Push num 34 onto the stack as int32, short form.
  16. stloc.0 //Pop a value “34” from stack into local variable 0
  17. ldc.i4.6 //Push num 6 of type int32 onto the stack as int32.
  18. stloc.1 //Pop a value “6” from stack into local variable 1
  19. ldc.r8 2.5 //Push num 2.5 of type float64 onto the stack as F.
  20. stloc.2 //Pop a value “2.5” from stack into local variable 2
  21. ldloc.0 //Load local variable 0 onto stack. -> load num 34 onto stack
  22. conv.r8 //Convert to float64, pushing F on stack. -> convert num 34 into float64 type -> 34.0
  23. ldloc.1 //Load local variable 1 onto stack. -> load num 6 onto stack
  24. conv.r8 //Convert to float64, pushing F on stack. -> convert num 6 into float64 type -> 6.0
  25. div //Divide two values to return a quotient or floating-point result. -> 34.0 / 6.0 ??
  26. stloc.3 //Pop a value from div operation from stack into local variable 3
  27. ldloc.3 //Load local variable 3 onto stack. -> load 34.0/6.0 (float64) onto stack
  28. conv.i4 //Convert to int32, pushing int32 on stack. -> Convert 34.0/6.0 (float64) to int32
  29. ldloc.1 //Load local variable 1 onto stack. -> load 6 (int32) onto stack
  30. clt //Push 1 (of type int32) if value1 lower than value2, else push 0. ??
  31. ldc.i4.0 //Push 0 onto the stack as int32.
  32. ceq //Push 1 (of type int32) if value1 equals value2, else push 0. ??
  33. stloc.s 5 //Pop a value 5 from stack into local variable indx, short form.
  34. ldloc.s 5 //Load local variable 5 of index indx onto stack, short form.
  35. brfalse.s l1 //***Branch to target 11 if value is zero (false), short form. -> if value 0 jump to 11: (jz in asm) ?
  36. nop //Blank Instruction, no operation
  37. ldloc.1 //Load local variable 1 onto stack. -> load num 1 onto stack
  38. ldloc.3 //Load local variable 3 onto stack. -> load num 3 onto stack
  39. conv.i4 //Convert to int32, pushing int32 on stack. -> convert ldloc.1 & ldloc.3 to type int32 ?
  40. mul //Multiply values. -> 1*3 ?
  41. conv.r8 //Convert to float64, pushing F on stack. -> convert mul result into float64 type -> 3.0 ?
  42. stloc.s 4 //Pop a value 4 from stack into local variable indx, short form.
  43. nop //Blank Instruction, no operation
  44. br.s l2 //Branch to target, short form. -> jump to 12:
  45. l1: //***jump here (from line: "brfalse.s l1", if value 0)
  46. nop //Blank Instruction, no operation
  47. ldloc.0 //Load local variable 0 onto stack. -> load num 0 onto stack
  48. ldloc.1 //Load local variable 1 onto stack. -> load num 1 onto stack
  49. xor //Bitwise XOR of integer values, returns an integer. ->
  50. //XOR or eXclusive OR is a logical operation that compares the input values (bits) and generates the output value (bit). The exclusive OR logic is very simple. If the input values are the same, the output //is 0 (or false). If the input values are different, the result is 1 (or true).
  51. // result 1 ?
  52. conv.r8 //Convert to float64, pushing F on stack. -> convert num from xor operation into float64 type -> 1.0
  53. stloc.s 4 //Pop a value 4 from stack into local variable indx, short form.
  54. nop //Blank Instruction, no operation
  55. l2: //***jump here (from line: "br.s l2" ) ; jmp in asm
  56. ldloc.s 4 //Load local variable 4 onto stack. -> load num 4 onto stack
  57. stloc.s 6 //Pop a value 6 from stack into local variable indx, short form.
  58. br.s l3 //Branch to target, short form. -> jump to 13: ; next line
  59. l3: //***jump here (from line: "br.s l3" ) ; jmp in asm
  60. ldloc.s 6 //Load local variable 6 onto stack. -> load num 6 onto stack
  61. ret //Return from method, possibly with a value.
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement