Page 2 of 2

New demo uploaded: Floating Point in 6502

Posted: Sun Jan 17, 2021 10:45 am
by gavinhaslehurst


18 hours ago, desertfish said:




Yeah, the floating point routines are on different addresses in the X16 rom.  Also I think not all "internal" basic routines of the C64 basic rom can be used or are even available.  I stuck with the exposed routines listed here:



https://github.com/commanderx16/x16-rom/blob/master/fplib/fplib.inc



(translated into Prog8 here with a little bit of description added for each routine)



Unfortunately FIN is listed as ";fin = $fe7b ; XXX TODO" and the routine is not implemented. So converting a string to a floating point value is "Left As An Exercise For The Reader" I think.....  



I haven't had to do this myself so far--- all I ever needed was the user inputting an integer .  This can be converted to float using GIVAYF for instance.  For floating point constant values in the program, the Prog8 compiler itself is doing the conversion to the 5-byte binary format so the program never sees the string...



 



 



Update: absolutely brilliant! Thanks for the pointers here. Managed to get my Julia Set demo working in assembler. Super chuffed! Finally feel like I've got my head round it.