| 5 | |
| 6 | public class SetCC extends Base { |
| 7 | public void generate(FileOutputStream fos_init) { |
| 8 | try { |
| 9 | FileOutputStream fos = new FileOutputStream("normal_setcc.h"); |
| 10 | FileOutputStream fos32 = new FileOutputStream("../dynamic/dynamic_setcc.h"); |
| 11 | |
| 12 | fos.write(header.getBytes()); |
| 13 | cc(fos, fos_init, fos32, "O", "cpu->getOF()"); |
| 14 | cc(fos, fos_init, fos32, "NO", "!cpu->getOF()"); |
| 15 | cc(fos, fos_init, fos32, "B", "cpu->getCF()"); |
| 16 | cc(fos, fos_init, fos32, "NB", "!cpu->getCF()"); |
| 17 | cc(fos, fos_init, fos32, "Z", "cpu->getZF()"); |
| 18 | cc(fos, fos_init, fos32, "NZ", "!cpu->getZF()"); |
| 19 | cc(fos, fos_init, fos32, "BE", "cpu->getZF() || cpu->getCF()"); |
| 20 | cc(fos, fos_init, fos32, "NBE", "!cpu->getZF() && !cpu->getCF()"); |
| 21 | cc(fos, fos_init, fos32, "S", "cpu->getSF()"); |
| 22 | cc(fos, fos_init, fos32, "NS", "!cpu->getSF()"); |
| 23 | cc(fos, fos_init, fos32, "P", "cpu->getPF()"); |
| 24 | cc(fos, fos_init, fos32, "NP", "!cpu->getPF()"); |
| 25 | cc(fos, fos_init, fos32, "L", "cpu->getSF()!=cpu->getOF()"); |
| 26 | cc(fos, fos_init, fos32, "NL", "cpu->getSF()==cpu->getOF()"); |
| 27 | cc(fos, fos_init, fos32, "LE", "cpu->getZF() || cpu->getSF()!=cpu->getOF()"); |
| 28 | cc(fos, fos_init, fos32, "NLE", "!cpu->getZF() && cpu->getSF()==cpu->getOF()"); |
| 29 | fos.close(); |
| 30 | } catch (IOException e) { |
| 31 | |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | public void cc(FileOutputStream fos, FileOutputStream fos_init, FileOutputStream fos32, String name, String condition) throws IOException { |
| 36 | out(fos, "void OPCALL normal_set"+name+"_reg(CPU* cpu, DecodedOp* op) {"); |