Search found 656 matches

by jedie
Tue Jul 08, 2014 11:33 am
Forum: Hints and Tips
Topic: How does the floating point math package in BASIC work?
Replies: 41
Views: 27830

Re: How does the floating point math package in BASIC work?

Run the first Test. Test values are: 0, 1, 2, 126, 127, 128, 129, 130, 253, 254, 255 Values as expected are: 1, 2, 126, 127, 128, 130, 254 Values with results in differences are: 0, 129, 253, 255 Complete Output: Float value was: 0 exponent......: dez.: 0 hex: $00 exponent byte.: dez.: 128 hex: $80 ...
by jedie
Tue Jul 08, 2014 11:10 am
Forum: Hints and Tips
Topic: How does the floating point math package in BASIC work?
Replies: 41
Views: 27830

Re: How does the floating point math package in BASIC work?

I have created a Python class for representing a BASIC-Float: #!/usr/bin/env python import math import decimal def unsigned8(x): """ convert a signed 8-Bit value into a unsigned value """ if x < 0: x = x + 0x0100 # 0x100 == 2**8 == 256 return x class FloatingPoint(object): """ exponent: 1Byte = 8 Bi...
by jedie
Mon Jul 07, 2014 8:29 pm
Forum: Hints and Tips
Topic: How does the floating point math package in BASIC work?
Replies: 41
Views: 27830

Re: How does the floating point math package in BASIC work?

jedie wrote:What i not understand: Storing the sign into one byte, seems to be "extravagance"... For the information is only one bit needed, isn't it?
From "Inside the Dragon": It's just for speed ;)
by jedie
Mon Jul 07, 2014 8:20 pm
Forum: Hints and Tips
Topic: How does the floating point math package in BASIC work?
Replies: 41
Views: 27830

Re: How does the floating point math package in BASIC work?

This is very well explained in "Inside the Dragon", section 9.3. I can recommend reading the whole book! :) Also thanks! I found it ;) If I calculate the value back from the FP representation $36 = 54 Float: 86 d8 00 00 00 00 2^(+6) 10001010 110110000 00000000 00000000 00000000 00000000 + 4+2 || ||...
by jedie
Mon Jul 07, 2014 4:35 pm
Forum: Hints and Tips
Topic: How does the floating point math package in BASIC work?
Replies: 41
Views: 27830

Re: How does the floating point math package in BASIC work?

Question: What floating point format is it? Seems that is not a a standard format, isn't it? not IEEE 754-1985 or? Seems that the float values are stored like this: exponent: 1Byte = 8 Bits (most significant bit is the sign 1=positive 0=negative) mantissa/fraction: 4Bytes = 32 Bits sign of mantissa:...
by jedie
Mon Jul 07, 2014 2:04 pm
Forum: Hints and Tips
Topic: How does the floating point math package in BASIC work?
Replies: 41
Views: 27830

How does the floating point math package in BASIC work?

I still try to bugfix my Emulator: http://archive.worldofdragon.org/phpBB3/viewtopic.php?f=5&t=4308&p=11316#p11316 There is a bug somewhere related with the BASIC09 "floating point math package"... So i try to understand how it works. I find a article "Floating Point Math" by "Steven R. Broadwater" ...
by jedie
Fri Jul 04, 2014 9:16 pm
Forum: Hints and Tips
Topic: Small assembler test programms...
Replies: 17
Views: 12892

Re: Small assembler test programms...

I updated my code, too and test your examples.

Only the underflow seems to be wrong:

Code: Select all

DIVH  DIVL    DVSR    QUOT    REM     comment
0000  0001    8000    0000    8000    underflow
Here i get:

Code: Select all

$1 / $8000
OK: 1/32768=0 remainder: 1 (hex: q:$0 r:=$1)
So there is no underflow, isn't it?
by jedie
Thu Jul 03, 2014 7:43 am
Forum: Hints and Tips
Topic: Small assembler test programms...
Replies: 17
Views: 12892

Re: Small assembler test programms...

OK, i updated my test here: https://github.com/jedie/DragonPy/commit/feb5395823a64a7fbdffc6094b8809fa11831911 Based on the changes here: https://github.com/6809/sbc09/commit/3f090c158f28f0cce260165f93b5a6080f65e534 Now these tests passed: test(10, 10) # OK: 10/10=1 remainder: 0 test(10, 5) # OK: 10/...
by jedie
Wed Jul 02, 2014 4:52 pm
Forum: Hints and Tips
Topic: TFR and EXR: 8bit <-> 16bit and undefined registers?!?
Replies: 3
Views: 4243

Re: TFR and EXR: 8bit <-> 16bit and undefined registers?!?

It really shouldn't be, and it's not something I can replicate: 4000| 8e0000 LDX #$0000 cc=a4 a=00 b=ff dp=00 x=0000 y=0197 u=c562 s=7f2c 4003| 86cd LDA #$cd cc=a8 a=cd b=ff dp=00 x=0000 y=0197 u=c562 s=7f2c 4005| 1f81 TFR A,X cc=a8 a=cd b=ff dp=00 x=ffcd y=0197 u=c562 s=7f2c 4007| 8e1234 LDX #$123...