Bugfix-- registers now appropriately truncated.
git-svn-id: http://www.cdkersey.com/harp/harptool@117 0246edb2-e076-4747-b392-db732a341fa2
This commit is contained in:
@@ -24,8 +24,14 @@ namespace Harp {
|
||||
Reg(Word c, Word n): cpuId(c), regNum(n), val(0) {}
|
||||
|
||||
Reg &operator=(T r) { val = r; doWrite(); return *this; }
|
||||
|
||||
operator T() { doRead(); return val; }
|
||||
|
||||
void trunc(Size s) {
|
||||
Word mask((~0ull >> (sizeof(Word)-s)*8));
|
||||
val &= mask;
|
||||
}
|
||||
|
||||
private:
|
||||
Word cpuId, regNum;
|
||||
T val;
|
||||
|
||||
Reference in New Issue
Block a user