3 ms·
Pi number calculator in 146 bytes of 8088 machine code
- anta40 4y agoThe author has other interesting bootable games, like: - https://github.com/nanochess/Invaders https://github.com/nanochess/Invaders (Invaders) - https://github.com/nanochess/bricks https://github.com/nanochess/bricks (bricks and paddle) - https://github.com/nanochess/bootRogue https://github.com/nanochess/bootRogue (Rogue) If you like learning assembly language/OSDev, his repos are a must to be bookmarked.
- Tepix 4y agoImpressive! It fills the screen with digits of pi, then stops (tried it at https://copy.sh/v86/ https://copy.sh/v86/ ) - is it supposed to scroll?
- Karellen 4y agoAccording 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 https://github.com/nanochess/pi/blob/master/pi.asm
- helsinkiandrew 4y agoThe link to the c code it is based on is down but the archive is: https://web.archive.org/web/20210518022312/http://www.codecodex.com/wiki/Calculate_digits_of_pi#C https://web.archive.org/web/20210518022312/http://www.codeco... Not sure I understand how that's calculating Pi though.
- nickcw 4y agoI think it is the Spigot algorithm for Pi https://www.gavalas.dev/blog/spigot-algorithms-for-pi-in-python/ 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 https://link.springer.com/book/10.1007/978-3-642-56735-3 Which has this algorithm and many more!
- airstrike 4y agoThat first link deserves its own submission. Very interesting read
- naikrovek 4y agoSimon 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/ https://www.chiark.greenend.org.uk/~sgtatham/spigot/
- Eupraxias 4y agoInterested parties should check out Ken Ward's excellent pi-calculating javascriptural here: https://www.trans4mind.com/personal_development/JavaScript/longnumPiMachin.htm https://www.trans4mind.com/personal_development/JavaScript/l...
- Waterluvian 4y agoIf 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?