ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Вторник
23 июля
898921 Топик полностью
SciFi (25.01.2019 07:33 - 07:54, просмотров: 140) ответил Dingo на Может не очень умный вопрос, но всё же: а можно без ассемблера понять, когда при сложении было переполнение? Аналог флажка carry так сказать. Ну или букварь соответствующий порекомендуйте.
Оно? (-->) Кстати, клевещут, у MIPS нет флага переноса. https://stackoverflow.com/questions/53252235/overflow-carry-flag-in-mips
https://stackoverflow.com/questions/33948450/c-detect-unsigned-int-overflow-of-addition
You could use if((a + b) < a) The point is that if a + b is overflowing, the result will be trimmed and must be lower then a. Consider the case with hypothetical bound range of 0 -> 9 (overflows at 10): b can be 9 at the most. For any value a such that a + b >= 10, (a + 9) % 10 < a. For any values a, b such that a + b < 10, since b is not negative, a + b >= a.
ส็็็็็็็็็็็็็็็็็็็็็็็็็༼ ຈل͜ຈ༽ส้้้้้้้้้้้้้้้้้้้้้้้