MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / FAC_Unpack

Function FAC_Unpack

source/Debugger/Debugger_Disassembler.cpp:484–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482};
483
484void FAC_Unpack(WORD nAddress, FAC_t& fac_)
485{
486 BYTE e0 = ReadByteFromMemory(nAddress + 0);
487 BYTE m1 = ReadByteFromMemory(nAddress + 1);
488 BYTE m2 = ReadByteFromMemory(nAddress + 2);
489 BYTE m3 = ReadByteFromMemory(nAddress + 3);
490 BYTE m4 = ReadByteFromMemory(nAddress + 4);
491
492 // sign
493 // EB82:A5 9D SIGN LDA FAC
494 // EB84:F0 09 BEQ SIGN3 ; zero
495 // EB86:A5 A2 SIGN1 LDA FAC.SIGN
496 // EB88:2A SIGN2 ROL
497 // EB89:A9 FF LDA #$FF ; negative
498 // EB8B:B0 02 BCS SIGN3
499 // EB8D:A9 01 LDA #$01 ; positive
500 // EB8F:60 SIGN3
501
502 fac_.exponent = e0 - 0x80;
503 fac_.negative =(m1 & 0x80) >> 7; // EBAF:46 A2 ABS LSR FAC.SIGN
504 fac_.mantissa = 0
505 | ((m1 | 0x80) << 24) // implicit 1.0, EB12: ORA #$80, STA FAC+1
506 | ((m2 ) << 16)
507 | ((m3 ) << 8)
508 | ((m4 ) << 0);
509
510 fac_.isZero = (e0 == 0); // TODO: need to check mantissa?
511}
512
513
514// Formats Target string with bytes,words, string, etc...

Callers 1

FormatNopcodeBytesFunction · 0.85

Calls 1

ReadByteFromMemoryFunction · 0.85

Tested by

no test coverage detected