src/vm/bus.c
/**
 * Find the zone in which out_memory address resides.
 * @param bus the bus.
 * @param address the out_memory addres.
 * @return  the zone, or NULL if the out_memory address does not belong to any zone.
 */
Find the zone in which out_memory address resides.
@param bus the bus.
@param address the out_memory addres.
@return  the zone, or NULL if the out_memory address does not belong to any zone.
Find the zone in which out_memory address resides . @param bus the bus . @param address the out_memory addres . @return the zone or NULL if the out_memory address does not belong to any zone .
Zone *find_zone(Bus *bus, addr_t address) {
    for (uint8_t i = 0; i < bus->zones_count; i++) {
        Zone *zone = &bus->zones[i];
        if (in_zone(zone, address)) {
            return zone;
        }
    }
    return NULL;
}
Zone * find_zone ( Bus * bus , addr_t address ) { for ( uint8_t i = 0 ; i < bus -> zones_count ; i ++ ) { Zone * zone = & bus -> zones [ i ] ; if ( in_zone ( zone , address ) ) { return zone ; } } return NULL ; }
Find the zone in which out_memory address resides.
Find the zone in which out_memory address resides .