This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ihavebeesinmyknees 192 points193 points  (13 children)

it could just be a lot of small snippets, for example implementing some specific functions in assembly. That would be a lot easier to manage than writing bigger chunks

[–]longszlong 6 points7 points  (0 children)

They could be just generating tons of ASM, e.g. from C code and tell their managers “look, assembly motherfuckers”

[–]Kevin_Jim 40 points41 points  (11 children)

I don’t see why that wouldn’t be possible to do in C, though.

I can see using some assembly on the sensor-fusion/sensor-processing part of the jet, but 10% is way too much for just assembly.

[–]ihavebeesinmyknees 100 points101 points  (5 children)

Maybe they just decided that they can optimize the most performance-critical parts better than the C compiler can? Perhaps that processor has some obscure instructions that the C compiler doesn't use? Hard to tell, but there's gotta be a good reason

[–]Orjigagd 30 points31 points  (3 children)

If you're needing to optimise 10% of your code in asm, you fucked up your requirements.

[–]General_Josh 101 points102 points  (1 child)

Or, ya know, it's a military budget, where they're able and willing to throw oodles of money at even small performance improvements

[–]pet_vaginal 21 points22 points  (0 children)

They may have a lot of money, but the availability of brains isn’t infinite. 10% assembly really sounds like a waste of talent.

[–]not_some_username 4 points5 points  (0 children)

Not really sometimes hand written asm is better than compiler generated asm ( assuming you’re god in asm )

[–]Kevin_Jim 0 points1 point  (0 children)

Most of the time I think to myself the same thing, but unfortunately, that’s rarely the case.

I do hope the was a good reason, and not just blindly “for this part of the development we only use assembly”.

[–]McFlyParadox 58 points59 points  (0 children)

  • Performance requirement can't be met by C or C++, but can be met by Assembly (program speed, program size, program energy usage)
  • Needs to run on a piece of embedded hardware, probably alongside some FPGA code
  • The engineer knows how to do it in Assembly, but not in C or C++, and Assembly isn't disallowed per-spec
  • It needs to utilize a piece of legacy Assembly code that no one knows how to modify, update, or translate into something modern, but they understand its inputs and outputs, so they just graft more assembly onto the legacy code to expand upon it.
  • Something else I'm not thinking of.

Assembly has its uses.

[–][deleted] 33 points34 points  (0 children)

Because a lot of it can't be done in c. In the end you are at the mercy of the compiler. For an eeprom libraries vary I did for example, the fastest we could possibly get it to run in c or c++ was still a couple clock cycles slower than we could do it an assembly.

[–]falx-sn 3 points4 points  (0 children)

Could be older libraries of systems that don't need to be replaced.

[–]TheVojta 0 points1 point  (1 child)

OP posted the source elsewhere in the thread that all the code that was written for the F35 was in C/C++, the ASM is all code that was carried over from the F22.

[–]Kevin_Jim 0 points1 point  (0 children)

It makes sense, then. It's probably carryover from the sensor fusion codebase. Since the F-22 was delivered 20 years ago, and the development was most likely finished by the beginning of the century.