@@ -50,6 +50,25 @@ macro_rules! set_bit {
5050 } ;
5151}
5252
53+ pub const F_CF : u32 = 0 ;
54+ pub const F_PF : u32 = 2 ;
55+ pub const F_AF : u32 = 4 ;
56+ pub const F_ZF : u32 = 6 ;
57+ pub const F_SF : u32 = 7 ;
58+ pub const F_TF : u32 = 8 ;
59+ pub const F_IF : u32 = 9 ;
60+ pub const F_DF : u32 = 10 ;
61+ pub const F_OF : u32 = 11 ;
62+ pub const F_IOPL1 : u32 = 12 ;
63+ pub const F_IOPL2 : u32 = 13 ;
64+ pub const F_NT : u32 = 14 ;
65+ pub const F_RF : u32 = 16 ;
66+ pub const F_VM : u32 = 17 ;
67+ pub const F_AC : u32 = 18 ;
68+ pub const F_VIF : u32 = 19 ;
69+ pub const F_VIP : u32 = 20 ;
70+ pub const F_ID : u32 = 21 ;
71+
5372#[ derive( Clone , Copy , Debug , Serialize , Deserialize ) ]
5473pub struct Flags {
5574 pub f_cf : bool ,
@@ -123,6 +142,27 @@ impl Flags {
123142 self . f_id = false ;
124143 }
125144
145+ pub fn set ( & mut self ) {
146+ self . f_cf = true ;
147+ self . f_pf = true ;
148+ self . f_af = true ;
149+ self . f_zf = true ;
150+ self . f_sf = true ;
151+ self . f_tf = true ;
152+ self . f_if = true ;
153+ self . f_df = true ;
154+ self . f_of = true ;
155+ self . f_iopl1 = true ;
156+ self . f_iopl2 = true ;
157+ self . f_nt = true ;
158+ self . f_rf = true ;
159+ self . f_vm = true ;
160+ self . f_ac = true ;
161+ self . f_vif = true ;
162+ self . f_vip = true ;
163+ self . f_id = true ;
164+ }
165+
126166 pub fn print_trace ( & self , pos : u64 ) {
127167 let mut fs = String :: new ( ) ;
128168 fs. push_str ( "[ " ) ;
0 commit comments