[HN Gopher] Pi number calculator in 146 bytes of 8088 machine code
___________________________________________________________________
Pi number calculator in 146 bytes of 8088 machine code
Author : nanochess
Score : 72 points
Date : 2022-12-12 03:44 UTC (1 days ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| anta40 wrote:
| 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 wrote:
| Impressive!
|
| It fills the screen with digits of pi, then stops (tried it at
| https://copy.sh/v86/ ) - is it supposed to scroll?
| Karellen wrote:
| 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
| Eupraxias wrote:
| Interested parties should check out Ken Ward's excellent pi-
| calculating javascriptural here:
|
| https://www.trans4mind.com/personal_development/JavaScript/l...
| Waterluvian wrote:
| 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?
| helsinkiandrew wrote:
| 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 wrote:
| I think it is the Spigot algorithm for Pi
|
| 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!
| airstrike wrote:
| That first link deserves its own submission. Very interesting
| read
| naikrovek wrote:
| 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/
___________________________________________________________________
(page generated 2022-12-13 23:02 UTC)