New test.
[mono.git] / mcs / ilasm / codegen / LdstrInstr.cs
1 //
2 // Mono.ILASM.LdstrInstr
3 //
4 // Author(s):
5 //  Jackson Harper (Jackson@LatitudeGeo.com)
6 //
7 // (C) 2003 Jackson Harper, All rights reserved
8 //
9
10
11 using System;
12
13 namespace Mono.ILASM {
14
15         public class LdstrInstr : IInstr {
16
17                 private string operand;
18                 private byte[] b_operand;
19                 
20                 public LdstrInstr (string operand, Location loc)
21                         : base (loc)
22                 {
23                         this.operand = operand;
24                 }
25
26                 public LdstrInstr (byte[] b_operand, Location loc)
27                         : base (loc)
28                 {
29                         this.b_operand = b_operand;
30                 }
31                 
32                 public override void Emit (CodeGen code_gen, MethodDef meth,
33                                            PEAPI.CILInstructions cil)
34                 {
35                         if (operand != null)
36                                 cil.ldstr (operand);
37                         else
38                                 cil.ldstr (b_operand);
39                 }
40
41         }
42
43 }
44