עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

NOPים מיותרים? בשביל מה?

Featured Replies

פורסם

היי יש לי שאלה.

להלן קוד קטן שקימפלתי:

int main() { return 0; }

וזה האסמבלי שלו שהתקבל אחרי קימפול:


08048374: 55 push %ebp
8048375: 89 e5 mov %esp,%ebp
8048377: b8 00 00 00 00 mov $0×0,%eax
804837c: 5d pop %ebp
804837d: c3 ret
804837e: 90 nop
804837f: 90 nop

הנא עוד קוד

void main() {}

ושוב האסמבלי:


8048374: 55 push %ebp
8048375: 89 e5 mov %esp,%ebp
8048377: 5d pop %ebp
8048378: c3 ret
8048379: 90 nop
804837a: 90 nop
804837b: 90 nop
804837c: 90 nop
804837d: 90 nop
804837e: 90 nop
804837f: 90 nop

כמות ה NOPים בקוד השני מפצה על חוסר הפקודה mov eax, 0x0 (שהיא לוקחת 5 ביתים) ולכן בקודה שני יש 5 NOPים יותר.

השאלה למה בכלל צריך אותם?מה זה נותן?

תודה רבה מראש!

פורסם
  • מחבר

חשבתי שזה הסיבה אבל לא הצלחתי להבין למה מהקוד הנ"ל. אבל שכחתי שיש גם עוד הרבה קוד פרט ל MAIN צעמו.

תודה!

פורסם

עוד סיבות ל-NOP:

* במעבדים עם branch delay slots, בדרך כלל תמצא NOP-ים, במיוחד בחזרה מפונקציות.

* על מנת להשאיר מקום ל-patch עתידי (נדיר).

* self modifying code.

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.