From 4b97427937b833ac7b24587ab93887f3166cbd1f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 11 May 2022 07:00:35 -0400 Subject: [PATCH] Remove further magic constants. --- .../M68k/Implementation/PerformImplementation.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/InstructionSets/M68k/Implementation/PerformImplementation.hpp b/InstructionSets/M68k/Implementation/PerformImplementation.hpp index 796cd2ba0..42b6b2ea2 100644 --- a/InstructionSets/M68k/Implementation/PerformImplementation.hpp +++ b/InstructionSets/M68k/Implementation/PerformImplementation.hpp @@ -9,6 +9,8 @@ #ifndef InstructionSets_M68k_PerformImplementation_h #define InstructionSets_M68k_PerformImplementation_h +#include "../ExceptionVectors.hpp" + #include #include @@ -500,7 +502,7 @@ template < #define announce_divide_by_zero() \ status.negative_flag_ = status.overflow_flag_ = 0; \ status.zero_result_ = 1; \ - flow_controller.raise_exception(5); + flow_controller.raise_exception(Exception::IntegerDivideByZero) case Operation::DIVU: { status.carry_flag_ = 0; @@ -538,7 +540,7 @@ template < // An attempt to divide by zero schedules an exception. if(!src.w) { // Schedule a divide-by-zero exception. - announce_divide_by_zero() + announce_divide_by_zero(); break; } @@ -578,12 +580,12 @@ template < // TRAP, which is a nicer form of ILLEGAL. case Operation::TRAP: - flow_controller.template raise_exception(src.l + 32); + flow_controller.template raise_exception(src.l + Exception::TrapBase); break; case Operation::TRAPV: { if(status.overflow_flag_) { - flow_controller.template raise_exception(7); + flow_controller.template raise_exception(Exception::TRAPV); } } break; @@ -605,7 +607,7 @@ template < // exception is necessary. flow_controller.did_chk(is_under, is_over); if(is_under || is_over) { - flow_controller.template raise_exception(6); + flow_controller.template raise_exception(Exception::CHK); } } break;