regop.isa (5409:0343cd06df4f) regop.isa (5424:d4f80459ad5d)
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

--- 974 unchanged lines hidden (view full) ---

983
984 class Rdsel(SegOp):
985 code = '''
986 DestReg = SegSelSrc1;
987 '''
988
989 class Chks(SegOp):
990 code = '''
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

--- 974 unchanged lines hidden (view full) ---

983
984 class Rdsel(SegOp):
985 code = '''
986 DestReg = SegSelSrc1;
987 '''
988
989 class Chks(SegOp):
990 code = '''
991 // The selector is in source 1.
991 // The selector is in source 1 and can be at most 16 bits.
992 SegSelector selector = psrc1;
993
994 // Compute the address of the descriptor and set DestReg to it.
995 if (selector.ti) {
996 // A descriptor in the LDT
992 SegSelector selector = psrc1;
993
994 // Compute the address of the descriptor and set DestReg to it.
995 if (selector.ti) {
996 // A descriptor in the LDT
997 Addr target = (selector.esi << 3) + LDTRBase;
998 if (!LDTRSel || (selector.esi << 3) + dataSize > LDTRLimit)
997 Addr target = (selector.si << 3) + LDTRBase;
998 if (!LDTRSel || (selector.si << 3) + dataSize > LDTRLimit)
999 fault = new GeneralProtection(selector & mask(16));
1000 DestReg = target;
1001 } else {
1002 // A descriptor in the GDT
999 fault = new GeneralProtection(selector & mask(16));
1000 DestReg = target;
1001 } else {
1002 // A descriptor in the GDT
1003 Addr target = (selector.esi << 3) + GDTRBase;
1004 if ((selector.esi << 3) + dataSize > GDTRLimit)
1003 Addr target = (selector.si << 3) + GDTRBase;
1004 if ((selector.si << 3) + dataSize > GDTRLimit)
1005 fault = new GeneralProtection(selector & mask(16));
1006 DestReg = target;
1007 }
1008 '''
1009 flag_code = '''
1010 // Check for a NULL selector and set ZF,EZF appropriately.
1011 ccFlagBits = ccFlagBits & ~(ext & (ZFBit | EZFBit));
1005 fault = new GeneralProtection(selector & mask(16));
1006 DestReg = target;
1007 }
1008 '''
1009 flag_code = '''
1010 // Check for a NULL selector and set ZF,EZF appropriately.
1011 ccFlagBits = ccFlagBits & ~(ext & (ZFBit | EZFBit));
1012 if (!selector.esi && !selector.ti)
1012 if (!selector.si && !selector.ti)
1013 ccFlagBits = ccFlagBits | (ext & (ZFBit | EZFBit));
1014 '''
1015
1016 class Wrdh(RegOp):
1017 code = '''
1018
1019 '''
1020

--- 42 unchanged lines hidden ---
1013 ccFlagBits = ccFlagBits | (ext & (ZFBit | EZFBit));
1014 '''
1015
1016 class Wrdh(RegOp):
1017 code = '''
1018
1019 '''
1020

--- 42 unchanged lines hidden ---