diff --git a/c64/aliases/,aliases_cpu.s b/c64/aliases/,aliases_cpu.s index 85f94c76..922a91bc 100644 --- a/c64/aliases/,aliases_cpu.s +++ b/c64/aliases/,aliases_cpu.s @@ -111,6 +111,21 @@ +// +// Calculation shortcuts +// + +.pseudocommand lda_zero // WARNING: do not use within interrupts +{ +#if HAS_OPCODES_65C02 + tba +#else + lda #$00 +#endif +} + + + // // Stack manipulation - some CPUs will leave .A unchanged, some will use it as temporary storage, so consider .A trashed // diff --git a/c64/basic/math/MOVFM.s b/c64/basic/math/MOVFM.s index f0dbb066..9f6c510c 100644 --- a/c64/basic/math/MOVFM.s +++ b/c64/basic/math/MOVFM.s @@ -71,13 +71,10 @@ MOVMF: lda (INDEX), y sta FAC1_exponent - // Set low order mantissa - to my surprise original ROM seems to put 0 to FACOW - XXX why??? - // Since we do not know the original value (lost due to variable format having one byte shorter - // mantissa than FAC1), it is probably best to put some approximate value here; putting $80 - // would be risky in case rouding is performed later, $7F seems to be sane choice + // Set low order mantissa to 0 - this should give the + // most precision while operating on integers - lda #$7F - sta FACOV + sty FACOV // Return the FAC1 exponent diff --git a/doc/Development.md b/doc/Development.md index 427a037b..86c3160d 100644 --- a/doc/Development.md +++ b/doc/Development.md @@ -88,7 +88,7 @@ List of the most important make targets: Currently there are 2 ROM layouts defined: - `STD` - with 2 code segments: `BASIC` (`$A000-$E4D2`, where `$C000-$DFFF` is a skip-gap for RAM and I/O area) and `KERNAL` (`$E4D3 - $FFFF`) -- `M65` - where `BASIC` becames `BASIC_0` and `KERNAL` becames `KERNAL_0`, additional segments might be added to the build system in the future; at the moment of writing this document additional 8KB of ROM is defined as `KERNAL_1` segment +- `M65` - where `BASIC` becames `BASIC_0` and `KERNAL` becames `KERNAL_0`, additional segments might be added to the build system in the future; at the moment of writing this document additional 8KB of ROM is defined as `BASIC_1` segment and additional 8KB of ROM is defined as `KERNAL_1` segment To check for current ROM layout or code segment use KickAssembler preprocessor defines, like `ROM_LAYOUT_STD`, `ROM_LAYOUT_M65`, `SEGMENT_BASIC`, `SEGMENT_KERNAL_1`.