Programming in ASSEMBLY is ASS
- steve
- Dec, 16, 2023
- Cars, Boats, ATVs, Genius
- Comments Off on Programming in ASSEMBLY is ASS
Learn assembly, they said
It’ll be fun, they said
Okay it’s actually pretty fucking fun. And once you know assembly, literally everything is open source and you become like Neo manipulating the shit around you like an absolute madman, just because you can.
SO in my quest to make my car more better-er, the next step was to learn assembly and rewrite some of the code in the ECU. Now, I’m an experienced programmer already, but if I can figure this shit out I’m baffled that more people aren’t doing this. Anyway I’m in a kind of state of disbelief right now, because not only was I able to reverse-engineer some of volvos OEM code, but also reverse engineered some code written by nobody-knows-exactly-which-tuner-because-they-all-copy-each-other that makes the car go BANG BANG BANG, purely for the purpose of showing off.
Now the problem that I wanted to solve by learning this was as follows: You can set your bang bang bangs to act as a sort of rudimentary launch control, so you hold the clutch and the gas down and the code will load a bogus ignition angle value, and the car will burble away to keep the turbo spooled and ready to go. SOME people will modify this value to the extreme, so you get massive explosions of fire out of your tailpipe instead. The only way to switch between these two levels of boom is to flash between the ‘burble’ bin and the ‘kaboom’ bin. BUT FLASHING A BIN TAKES LIKE 85 SECONDS, WHY CAN’T I JUST PUSH A BUTTON OR SOMETHING??
So I wrote some new code that switches the ignition value between burble and kaboom based on whether or not the cruise control button was pressed. Not cruise active, just the base on/off. AND IT FUCKING WORKED HOLY SHIT.
Okay I’m not going to jerk myself off too hard, the flavor of assembly used on this ECU is pretty simple. Like if the Z80 was 16-bit. But writing an assembly program, then converting it to hex manually because you can’t be arsed to find an assembler, then uploading it to your car, testing it, and having it work perfectly is an otherworldly kind of feeling. SO SATISFYING.
I began collaborating with the team behind OpenMoose, because what they’re doing to make all the volvo secrets public is awesome, and I stand behind that idea 100%. So this code (combined with a lot of other code) will be released through that project some time in the future. I always hoped all my canbus and vida tinkering would lead me somewhere cool, and now my FUCKING CAR SHOOTS FIRE!
Ps. Shooting fire is a lot of fun if you don’t have a catalytic converter. If you do, you’ll be shooting bits of platinum at people on the highway. Ask me how I know >_>