During the Yavin blockade that occurred in 0 ABY, according to Legends, the 501st Legion responded in force to the destruction of the first Death Star.
A component of the 501st, which included a Star Destroyer and two accompanying Victory II-class frigates, broke away from the blockade. A number of Rebels had found a route through the blockade and had assembled a convoy of starships, intending to breach it using a hyperspace jump.
The 501st's pilots quickly realized that a substantial Rebel contingent was aboard several GR-75 medium transports. However, TIE/sa bombers overwhelmed the transports, swiftly destroying them. The Mon Calamari Star Cruiser became the next primary target. Before an attack could be launched, however, starfighters were being decimated by Corellian Corvettes. Despite this setback, bombers managed to encircle and eliminate the Corvettes.
With the situation turning against them, the Rebel fleet adopted a risky tactic: a hyperspace jump directly through the Imperial Star Destroyer. To divert any potential attacks, starfighters were deployed against the Imperial forces, but they were quickly defeated.
Subsequently, the Imperial force initiated a ground assault on the Massassi base. A Sentinel-class landing craft landed on the moon, and the 501st forces opted to attack a Rebel hangar base located within a Massassi Temple. They successfully secured the fountain and viaduct. After fighting through a strong Rebel force, including AAC-1 speeder tanks, they then seized control of the reflecting pool.
The Rebel forces, initially surprised by the sudden assault, managed to reorganize and launch a counterattack. Closing a blast door over the hangar behind them, a large force of infantry and armored vehicles attacked the reflecting pool. However, the Imperials, despite suffering considerable losses, managed to halt the attack.
Before an assault on the main temple could begin, the door needed to be breached. A squad of Imperial engineers planted a bomb on the hangar door, detonating it. The Imperials then stormed the temple, engaging in intense close-quarters combat with the remaining rebels. Using this chaos as a diversion, a squad of stormtroopers infiltrated a small command room and assassinated the Bothan High Command.
This represents another depiction of the events leading up to the Evacuation of Yavin, as portrayed in the 2005 video game Star Wars: Battlefront II.