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

Function daa

source/emulation/cpu/normal/instructions.cpp:330–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330void daa(CPU* cpu) {
331 cpu->lazyFlagType=FLAGS_NONE;
332 if (((AL & 0x0F)>0x09) || cpu->getAF()) {
333 if ((AL > 0x99) || cpu->getCF()) {
334 AL+=0x60;
335 cpu->addCF();
336 } else {
337 cpu->removeCF();
338 }
339 AL+=0x06;
340 cpu->addAF();
341 } else {
342 if ((AL > 0x99) || cpu->getCF()) {
343 AL+=0x60;
344 cpu->addCF();
345 } else {
346 cpu->removeCF();
347 }
348 cpu->removeAF();
349 }
350 cpu->setSF(AL & 0x80);
351 cpu->setZF(AL == 0);
352 cpu->setPFonValue(AL);
353}
354
355void das(CPU* cpu) {
356 cpu->lazyFlagType=FLAGS_NONE;

Callers 1

normal_daaFunction · 0.70

Calls 9

addCFMethod · 0.80
removeCFMethod · 0.80
addAFMethod · 0.80
removeAFMethod · 0.80
setSFMethod · 0.80
setZFMethod · 0.80
setPFonValueMethod · 0.80
getAFMethod · 0.45
getCFMethod · 0.45

Tested by

no test coverage detected