Positive numbers Ok, for negative need two's complement

This commit is contained in:
rigreco 2015-02-22 21:06:08 +01:00
parent 27c0e8f7ca
commit 17795263ab
2 changed files with 16 additions and 6 deletions

View File

@ -28,22 +28,27 @@ ENTRY jsr CHKCOM
dec A
sta FP1
clc
lda FAC+1
eor #$F0 ; Not Hi Byte
ror
;eor #$F0 ; Not Hi Byte
sta FP1+1
lda FAC+2
ror
sta FP1+2
lda FAC+3
ror
sta FP1+3
lda #0
sta E
; lda FAC+4
; lda #0
; sta E
lda FAC+4
ror
sta E
; lda FAC+4
; sta SIGN

View File

@ -24,18 +24,23 @@ ENTRY lda FP1 ; X1 1 Byte --> 9D FAC
inc A ; 2^(FP1+1)
sta MEM
clc
lda FP1+1 ; M1 Hi 2 Byte --> 9E FAC
asl
rol
;asl
eor #$80 ; Not Hi Bit Mantissa (change Sign)
sta MEM+1
lda FP1+2 ; M1 3 Byte --> 9F FAC
rol
sta MEM+2
lda FP1+3 ; M1 Lo 4 Byte --> A0 FAC
rol
sta MEM+3
lda E ; Extra 00 5 Byte --> A1 FAC
rol
sta MEM+4
* lda $EB ; SIGN (F3 to EB) 6 Byte --> A2 FAC