class RegisterSlice:
This class represents a bitwise register slice as defined by a register, its start bit and bit count.
Method | __and__ |
Computes the intersection of this slice with another of the same register. |
Method | __contains__ |
Returns whether or not the passed register or slice is contained in self. |
Method | __eq__ |
Compares the instance for equality with an object. |
Method | __hash__ |
Returns the hash for this value. |
Method | __init__ |
Initializes a RegisterSlice |
Method | __len__ |
Returns the size of this slice in bits, which is at least 1 (empty slices are not allowed). |
Method | __ne__ |
Compares the instance for equality with an object. |
Method | __or__ |
Computes the union of this slice with another of the same register. |
Method | __repr__ |
Returns the "official" string representation of this instance. |
Method | __str__ |
Returns the nicely printable string representation of this instance. |
Method | __sub__ |
Computes the difference of this slice with another of the same register. |
Method | canonicalize |
Returns the equal register slice of the root register of this register. |
Method | difference |
Computes the difference of this slice with another of the same register. |
Method | flags |
An iterator over the individual flag registers contained in this slice. |
Method | intersection |
Computes the intersection of this slice with another of the same register. |
Method | is |
Whether this register is in its canonical form. |
Method | is |
Whether this register is in its minimal form. |
Method | is |
Whether this slice is under the same form (same register alias and same begin/end) as the other. |
Method | isdisjoint |
Returns whether or not there exists no bit contained both in self and in other. |
Method | issubset |
Returns whether or not all bits of self are contained in other. |
Method | issuperset |
Returns whether or not all bits of other are contained in self. |
Method | minimize |
Returns the equal register slice of the smallest register that can fit this slice. |
Method | union |
Computes the union of this slice with another of the same register. |
Property | begin |
The index of the first bit in the slice. |
Property | end |
The index of the first bit not in the slice. |
Property | is |
Property: Whether this slice is aligned at the byte boundaries. |
Property | is |
Property: Whether this slice contains its entire register. |
Property | register |
Property: The sliced register. |
Property | size |
Property: The size of the slice, in bits. |
Property | size |
Property: The minimal number of bytes required to hold this slice. |
Instance Variable | _begin |
Undocumented |
Instance Variable | _register |
Undocumented |
Instance Variable | _size |
Undocumented |
Computes the intersection of this slice with another of the same register.
The intersection is defined as the biggest subslice that is both contained in self and in other.
If such slice would be empty, None is returned.
The intersection is always returned in the canonical form.
Parameters | |
other:_Optional[ | Undocumented |
Returns | |
_Optional[ | Undocumented |
Returns whether or not the passed register or slice is contained in self.
A register is considered as contained in a slice if it fully fits the slice.
A slice is considered as contained in another if it is a subset of that other slice.
Parameters | |
x:_Union[ | Undocumented |
Returns | |
bool | Undocumented |
Compares the instance for equality with an object.
- if the object is not a
RegisterSlice
, will return False.
Returns | |
bool | Undocumented |
Initializes a RegisterSlice
Information
Parameters | |
register:_Register | The sliced register. |
begin:int | The beginning bit of the slice. Defaults to 0. |
size:_Optional[ | The size of the slice, in bits. Defaults register.size_bits - begin. |
Raises | |
IndexError | if size <= 0 or size + begin > register.size_bits. |
Returns the size of this slice in bits, which is at least 1 (empty slices are not allowed).
Returns | |
int | Undocumented |
Compares the instance for equality with an object.
- if the object is not a
RegisterSlice
, will return True.
Returns | |
bool | Undocumented |
Computes the union of this slice with another of the same register.
The union is defined as the smallest slice that contains both self and other, but no other bit of the register.
If self and other are disjoint and not contiguous, then None is returned.
The union is always returned in the canonical form.
Parameters | |
other:_Optional[ | Undocumented |
Returns | |
_Optional[ | Undocumented |
Returns the "official" string representation of this instance.
Returns | |
str | Undocumented |
Returns the nicely printable string representation of this instance.
Returns | |
str | Undocumented |
Computes the difference of this slice with another of the same register.
The difference is defined as a pair of slices such that:
- The first slice contains all bits of self that are before the first bit of other.
- The second slice contains all bits of self that are after the last bit of other.
If any of these ranges would be empty, then None is returned in its stead.
Each returned slice is in the canonical form.
Note: if other slices a different register from self, the pair of slices will contain self.canonicalize() and None.
Parameters | |
other:_Optional[ | Undocumented |
Returns | |
_Tuple[ | Undocumented |
Returns the equal register slice of the root register of this register.
Returns | |
RegisterSlice | Undocumented |
Computes the difference of this slice with another of the same register.
The difference is defined as a pair of slices such that:
- The first slice contains all bits of self that are before the first bit of other.
- The second slice contains all bits of self that are after the last bit of other.
If any of these ranges would be empty, then None is returned in its stead.
Each returned slice is in the canonical form.
Note: if other is disjoint from self, the pair of slices will contain self.canonicalize() and None.
Parameters | |
other:_Optional[ | Undocumented |
Returns | |
_Tuple[ | Undocumented |
An iterator over the individual flag registers contained in this slice.
Returns an empty iterator if no flag is contained in this slice (e.g., because it is rax and not a flag register).
Returns | |
_Iterator[ | Undocumented |
Computes the intersection of this slice with another of the same register.
The intersection is defined as the biggest subslice that is both contained in self and in other.
If such slice would be empty, None is returned.
The intersection is always returned in the canonical form.
Parameters | |
other:_Optional[ | Undocumented |
Returns | |
_Optional[ | Undocumented |
Whether this slice is under the same form (same register alias and same begin/end) as the other.
Parameters | |
other:RegisterSlice | Undocumented |
Returns | |
bool | Undocumented |
Returns whether or not there exists no bit contained both in self and in other.
Parameters | |
other:RegisterSlice | Undocumented |
Returns | |
bool | Undocumented |
Returns whether or not all bits of self are contained in other.
Parameters | |
other:RegisterSlice | Undocumented |
Returns | |
bool | Undocumented |
Returns whether or not all bits of other are contained in self.
Parameters | |
other:RegisterSlice | Undocumented |
Returns | |
bool | Undocumented |
Returns the equal register slice of the smallest register that can fit this slice.
Parameters | |
to:_Register | Undocumented |
Returns | |
RegisterSlice | Undocumented |
Computes the union of this slice with another of the same register.
The union is defined as the smallest slice that contains both self and other, but no other bit of the register.
If self and other are disjoint and not contiguous, then None is returned.
The union is always returned in the canonical form.
Parameters | |
other:_Optional[ | Undocumented |
Returns | |
_Optional[ | Undocumented |