MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / div8

Function div8

source/emulation/cpu/normal/instructions.cpp:23–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21#include "instructions.h"
22
23U32 div8(CPU* cpu, U8 src) {
24 if (src==0) {
25 cpu->prepareException(EXCEPTION_DIVIDE, 0);
26 return 0;
27 }
28
29 U16 quo = AX / src;
30 U8 rem = AX % src;
31
32 if (quo > 255) {
33 cpu->prepareException(EXCEPTION_DIVIDE, 1);
34 return 0;
35 }
36 AL = (U8)quo;
37 AH = rem;
38 return 1;
39}
40
41U32 idiv8(CPU* cpu, S8 src) {
42 if (src==0) {

Callers 6

normal_divR8Function · 0.70
normal_divE8Function · 0.70
dynamic_divR8Method · 0.50
dynamic_divE8Method · 0.50
dynamic_idivR8Method · 0.50
dynamic_idivE8Method · 0.50

Calls 1

prepareExceptionMethod · 0.80

Tested by

no test coverage detected