עבור לתוכן
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.

מערך

Featured Replies

פורסם

כתבתי תכנית שצריכה כל פעם להדפיס את התו הבא במחרוזת, אבל זה מדפיס לי רק את התו הראשון ואח"כ מדפיס לי 0

למה????

(השורה lb שמה בתוך רגיסטר 6 0)

התכנית:



.data

str: .asciiz "abcd"

s: .asciiz "\n"

.text

main:

la $s2, str

li $s5, 0

li $s1, 4

li $s4, 0 #אתחול רגיסטרים

li, $t1, 0

Loop:

slt $t0, $s5, $s1

beq $t0, $zero, Exit



add $t1, $s4, $s4 # הכפלת המונה ב- 4

add $t1, $t1, $t1

add $t1, $t1, $s2 # כתובת של המערך+ מונה

lb $s6, 0($t1) # קריאת המקום במערך



li $v0, 1

move $a0, $s6

syscall # הדפסה

li $v0, 4

la $a0, s

syscall # הדפסת רווח

addi $s4, $s4, 1 # קידום המונה

addi $s5, $s5, 1

j Loop

Exit:

li $v0, 10

syscall # יציאה מהתוכנית


פורסם

באיזה שפת תיכנות אתה רושם ?

פורסם
  • מחבר

MIPS

פורסם

את צריכה במחרוזת להתקדם כל פעם כתובת +1 (ולא כתובת +4) כי מדובר במערך של CHAR ולא INT.

ארכיון

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

דיונים חדשים

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.