That would be awesome! Thank you so much Santiago!
I think that the best way is to use BCD math so ASCII conversion and printing will be easier
If you need code to convert integers to strings look for long2ascii here
It expects a 32 bit number in HLDE and a RAM pointer in BC where to put the result
Oh, I remember that routine. It was discussed in this forum too. But when I noticed it I had already ready my BCD score routine for Freedom Fighter
Ah, cool. Recently I did do a recursive Fibo in asm myself. I was just testing some stuff in the realm of compression techniques, binary trees and stuff. Just for fun and understanding
There you go:
- example assembler: https://braingames.santiontanon.dev/uploads/tmp/example.asm
- compiled rom: https://braingames.santiontanon.dev/uploads/tmp/example.rom
It's limited to 16 bit numbers, so, if you enter 50000 + 50000, the result will be wrong, of course. Also, only positive numbers :)
Converting ascii to integer and viceversa is always a bit tricky to start (as it involves multiplications and divisions, which the Z80 doesn't know how to do, and hence you have to write routines). But I hope the code is not too confusing :)
I had never used these CHPUT/CHGET BIOS routines, so, it was fun learning how to use them btw :)
Thank you guys! Much appreciated!