https://github.com/KatPurpy/asmle Skip to content Sign up * Product + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} KatPurpy / asmle Public * Notifications * Fork 0 * Star 4 ASMLE - Wordle in 512 bytes! 4 stars 0 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code Latest commit @KatPurpy KatPurpy fixed a whoopsie in readme.md ... a12dc5b Mar 10, 2022 fixed a whoopsie in readme.md a12dc5b Git stats * 2 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time README.md fixed a whoopsie in readme.md Mar 10, 2022 asmle.com publishing this work :) Mar 10, 2022 asmle.img publishing this work :) Mar 10, 2022 compile.bat publishing this work :) Mar 10, 2022 demo.gif publishing this work :) Mar 10, 2022 dict.py publishing this work :) Mar 10, 2022 dictionary.bin publishing this work :) Mar 10, 2022 main.asm publishing this work :) Mar 10, 2022 makedict.bat publishing this work :) Mar 10, 2022 makedicts.py publishing this work :) Mar 10, 2022 View code ASMLE - Wordle in 512 bytes Running How does compression work Concept Generation Decompression README.md ASMLE - Wordle in 512 bytes [demo] Written in 3 days! (22 bytes left after cleaning up for people) Running DOSBOX (COM version) dosbox asmle.com DOSBOX (Boot sector version) dosbox -c "mount C: ." -c "C:" -c "boot asmle.img" QEMU (boot sector version) "qemu-system-x86_64.exe" -drive format=raw,file=asmle.img How does compression work Concept The easiest way to compress something is to make it use less bits. We could make each letter a 4 bit index into a charset, cutting the size in half, a word is 2.5 bytes now. But wait, let's not forget we are doing real computing here. Here's our today's guest: padding! Padding turns our sweet 2.5 bytes into 3 bytes, what a rude guy. But don't worry, we gotta make use of extra 0.5 bytes (4 bits) later. We need a lookup table for characters. Let's introduce "charset" - a set of 16 characters. We'll have 2 such charsets to make the game more varied and gain more points for added complexity. This is where extra 4 bits go, they become charset index, it takes values from 0 to 1. Padding will help us save space on decompression routine by making it possible to extract all of the values in a sequence. The formula for getting the decompressed character becomes charset*16 + char. Here's the resulting word format cs ch0 ch1 ch2 ch3 ch4 | | | | | | v v v v v v 0000 0000 0000 0000 0000 0000 Generation makedict.py generates a dictionary by first generating a charset: by picking up 16 random characters from English alphabet and then it takes 32 words that match that set. We do it twice to get 2 dictionaries. Then the script writes charsets and the words into a binary file which is then included into the game executable itself. Vocabulary format charset1 (16 bytes) charset2 (16 bytes) 64 words (3 bytes each) Decompression See main.asm:148 About ASMLE - Wordle in 512 bytes! Resources Readme Stars 4 stars Watchers 1 watching Forks 0 forks Releases No releases published Packages 0 No packages published Languages * Assembly 52.4% * Python 40.8% * Batchfile 6.8% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.