Advertisement
_takumi

hw1n14

Feb 18th, 2022
1,765
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %include "io.inc"
  2.  
  3. section .text
  4. global CMAIN
  5. CMAIN:
  6.     mov ebp, esp; for correct debugging
  7.     GET_DEC 4, eax
  8.     GET_DEC 4, ebx
  9.     GET_DEC 4, ecx
  10.     mul ebx
  11.     mul ecx
  12.     GET_DEC 4, ebx
  13.     mov ecx, eax; ecx - number of vegetables
  14.     xor edx, edx
  15.     div ebx; eax - number of boxes, edx - in last box
  16.     or edx, 0
  17.     add eax, edx
  18.     GET_DEC 4, ebx; ebx - hrs
  19.     GET_DEC 4, ecx; ecx - mins
  20.     ; -- определяем, меньше ли введенный час, чем 6
  21.     sub ebx, 6
  22.     mov ecx, 1
  23.     shl ecx, 31
  24.     and ebx, ecx
  25.     shr ebx, 31
  26.     ; -- в ebx 1, если введенный час меньше 6 и 0 в противном случае
  27.    
  28.     xor eax, eax
  29.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement