2
// Copyright (C) 2009 Parth Malwankar <parth.malwankar@gmail.com>
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
package nazgul.opcodes
20
import nazgul.decoder.argdata._
21
import nazgul.core.exceptions._
22
import nazgul.decoder.Instruction
23
import nazgul.core.Core
24
import nazgul.core.EFlags
25
import nazgul.core.EFlags._
26
import nazgul.registers._
29
case object OpSAHF extends Opcode {
30
override def execute(pc: PC, inst: Instruction): Unit = {
31
super.execute(pc, inst)
32
val MASK = 0xffffffff & ~SF_MASK & ~ZF_MASK & ~AF_MASK & ~PF_MASK & ~CF_MASK
33
val f = pc.core.eflags.flags & MASK
34
pc.core.eflags.flags = pc.core.ah | f