

Posts tagged with :rustlang:



rmc_assemble
(an assembler for LMC assembly) that will be able to be used with the LMC emulator I've made.
I decided to develop this tool using test-driven development, because I can steal the example programs from the online simulator and use them as test data. Today I set up a test and a stub function, but haven't started implementing yet.
I also updated my project to the 2024 edition of Rust (which became stable this month). This didn't require any code changes.
Tomorrow I plan to continue working on the assembler program :)
bin_creator
program (part of Rusty-Man Computer) by letting it accept multi-line input, because that's the format you get when you copy memory data from the online LMC simulator. This should make it much more convenient to use (previously, you had to manually remove the newlines). This involved learning how to get the last two digits of a string in Rust, which is a bit more involved than it sounds (I got away with line.chars().rev().take(2).collect::<String>()
)
I also wrote a script (build_binaries.sh
) to use cross
to cross-compile my code for 3 different target platforms, and then copy the generated binaries into a single folder to make them easy to upload to GH Releases.
Naturally, I used that script to publish my first release that contains pre-compiled binaries for multiple platforms, which you can read about at github.com/RandomSearch18/rusty_man_computer/releases/tag/v0.4.0
Next, I want to start work on an assembler tool to add to the project :D
cross
(Github) to compile the code for various platforms. (Of course, users can still run the Rust compiler themselves if they wish.) This is an important step for distributing my program and making it accessible to more people.
I also added 14 more tests to the code, which test that each individual instruction works correctly. This should make it easy to pin down any regressions during development in the future.
cross
, working towards perhaps releasing a stable version. But for now, it's 7pm, and I should really be revising for my Physics mock tomorrow morning. Cya!
Vec<[char; 4]>
, toyed with the idea of a Vec<String>
, before deciding to go back to a simple String
and only split it into lines when rendering the output. A challenge came from trying to work out how the LMC simulator decides when to insert a line break: numbers on their own are always on their own line, but numbers with some letters after them all end up on the same line... but if I just print a 1
and a Space a bunch of times, there's a new line in between each iteration...
I'm still trying to wrap my head around the logic for those line breaks, so I haven't finished "fixing" my output-printing code, but the work-in progress commit is on GitHub.




















![DhairyaSHAH[11U19]-U040X9BB30C](/_next/image?url=https%3A%2F%2Favatars.slack-edge.com%2F2022-09-02%2F4014303954887_7ac397d9ca9fad4f1600_192.png&w=96&q=75)


















