Pi number calculator in 146 bytes of 8088 machine code (github.com) 77 points by nanochess 3y ago ↗ HN
[–] anta40 3y ago ↗ The author has other interesting bootable games, like:- https://github.com/nanochess/Invaders (Invaders)- https://github.com/nanochess/bricks (bricks and paddle)- https://github.com/nanochess/bootRogue (Rogue)If you like learning assembly language/OSDev, his repos are a must to be bookmarked.
[–] Tepix 3y ago ↗ Impressive!It fills the screen with digits of pi, then stops (tried it at https://copy.sh/v86/ ) - is it supposed to scroll? [–] Karellen 3y ago ↗ According to comments in the .asm file It will generate (14000-14)/14*2 digits. Cannot go further with current precision Which works out to about 500 digits. Maybe it's just reached its limit.https://github.com/nanochess/pi/blob/master/pi.asm
[–] Karellen 3y ago ↗ According to comments in the .asm file It will generate (14000-14)/14*2 digits. Cannot go further with current precision Which works out to about 500 digits. Maybe it's just reached its limit.https://github.com/nanochess/pi/blob/master/pi.asm
[–] helsinkiandrew 3y ago ↗ The link to the c code it is based on is down but the archive is:https://web.archive.org/web/20210518022312/http://www.codeco...Not sure I understand how that's calculating Pi though. [–] nickcw 3y ago ↗ I think it is the Spigot algorithm for Pihttps://www.gavalas.dev/blog/spigot-algorithms-for-pi-in-pyt...If you enjoy Pi stuff then I'd recommend the Pi Unleashed bookhttps://link.springer.com/book/10.1007/978-3-642-56735-3Which has this algorithm and many more! [–] airstrike 3y ago ↗ That first link deserves its own submission. Very interesting read [–] naikrovek 3y ago ↗ Simon Tatham (of PuTTY fame) has an implementation of this algorithm which supports far more than just pi.https://www.chiark.greenend.org.uk/~sgtatham/spigot/
[–] nickcw 3y ago ↗ I think it is the Spigot algorithm for Pihttps://www.gavalas.dev/blog/spigot-algorithms-for-pi-in-pyt...If you enjoy Pi stuff then I'd recommend the Pi Unleashed bookhttps://link.springer.com/book/10.1007/978-3-642-56735-3Which has this algorithm and many more! [–] airstrike 3y ago ↗ That first link deserves its own submission. Very interesting read [–] naikrovek 3y ago ↗ Simon Tatham (of PuTTY fame) has an implementation of this algorithm which supports far more than just pi.https://www.chiark.greenend.org.uk/~sgtatham/spigot/
[–] naikrovek 3y ago ↗ Simon Tatham (of PuTTY fame) has an implementation of this algorithm which supports far more than just pi.https://www.chiark.greenend.org.uk/~sgtatham/spigot/
[–] Eupraxias 3y ago ↗ Interested parties should check out Ken Ward's excellent pi-calculating javascriptural here:https://www.trans4mind.com/personal_development/JavaScript/l...
[–] Waterluvian 3y ago ↗ If this works on an 8088, booting directly from the boot sector, how far are we to compiling it for a Game Boy (an 8080-like) cartridge?
9 comments
[ 4.1 ms ] story [ 31.3 ms ] thread- https://github.com/nanochess/Invaders (Invaders)
- https://github.com/nanochess/bricks (bricks and paddle)
- https://github.com/nanochess/bootRogue (Rogue)
If you like learning assembly language/OSDev, his repos are a must to be bookmarked.
It fills the screen with digits of pi, then stops (tried it at https://copy.sh/v86/ ) - is it supposed to scroll?
https://github.com/nanochess/pi/blob/master/pi.asm
https://web.archive.org/web/20210518022312/http://www.codeco...
Not sure I understand how that's calculating Pi though.
https://www.gavalas.dev/blog/spigot-algorithms-for-pi-in-pyt...
If you enjoy Pi stuff then I'd recommend the Pi Unleashed book
https://link.springer.com/book/10.1007/978-3-642-56735-3
Which has this algorithm and many more!
https://www.chiark.greenend.org.uk/~sgtatham/spigot/
https://www.trans4mind.com/personal_development/JavaScript/l...