أرجو
المساعدة ضروري الله يخليكم PCSpim عندي Final
Exam
بسم
الله الرحمن الرحيمالسلام عليكم و رحمة الله وبركاته أخواني الكرام
أعضاء الفريق العربي للبرمجة أنا
كنت أبحث عنكم منذ مدة لأني طالبة ITوأحتاج
إلي من يدعمني و يساعدني في مساقات تخصصي الحمدلله بمحض الصدفة كنت أتصفح
في متحرك GOOGLEأبحث
عن تلك الفئة المتعاونة المساعدة وتوصلت لمنتدياتكم الرائعة وكلي
أمل في مساعدتكم لدي خلال هذا الفصل مساق Computer Architectureوقسم
ال LAB ندرس به تطبيقات على برنامج
الPCSpim وأنا الصراحة لا أستوعب من شرح
المدرس ولكنني حاولت فهم القليل وأعطانا المدرس واجب لابد من
تسليمه يوم السبت في نفس يوم امتحان ال Final وليس لدي الوقت الكافي لكثير من
المحاولات فقد حاولت ولكنني لست متأكدة من صحة حلي لأن الوقت المتبقي لابد لي أن
أدرس به مادة الفاينل فأتمنى من الأخوة الكرام مساعدتي مع الايفاء بشرح
مبسط لأخطائي لأعرف كيفية الحل الصحيح وسأكون شاكرة لكم لحسن تعاونكم
معيأرجوكم ساعدوني أنا بحاجة لكم
اقتباسهذا
السؤال الأصلي
## Assignment Code
.text
.globl main
main:
lui XXX,XXXX #Initialise base address as 0x10000000 in register $10
lw $XX,0(XXX) #Load value labeled 'x' defined in the data section to the register $11
……………… # Load to $15 the value from memory location 0x10000030
ori $12,$0,97 #
#
……………… # Store the value from $12 to memory location 0x10001000
……………… #(This may need more than one instruction to do this)
Ori $13,$0,12 #12 to $13
……………… # multiply the value of $13 and (x + 5) and keep the result
……………… # in $13; Here you may need more than one instruction to do
……………….. #this)
………………
………………
mflo $13 #assume 32 bit result
subu $12,$12,$13
mult $11,$11
mflo $11 #assume 32 bit result
ori $13,$0,5
mult $11,$13
mflo $13
addu $12,$12,$13
sw ……………. #Store from $12 to the location labeled 'poly'
XXXXXXXXX # Display the value from 'poly' on the consol
XXXXXXXXX #
XXXXXXXXX #
XXXXXXXXX #
XXXXXXXXX #
.data
x: .word 17 # Value 'x'
y: ……………….. #Put the bytes 1, 2, 3, 4 starting from memory location 0x10010030
z: ……………….. #Put the bytes 1, 2, 3, 4 starting from memory location 0x10010050
poly: ……………. #Poly is 0x10003000.
## End of file
وهذا حلي
## Practice Code
.text
.globl main
main:
lui $10,0x1000 #Init base register
lw $11,0($10) #Load x
lw $15, 0x30($10) # Load to $15 the value from memory location 0x10000030
ori $12,$0,97 #Initialize the accumulator
#during the "load delay slot"
lw $12,0x1000($10) # Store the value from $12 to memory location 0x10001000
sw $13, $12 #(This may need more than one instruction to do this)
Ori $13,$0,12 #12 to $13
ori $8, $0, 3 # multiply the value of $13 and (x + 5) and keep the result
# in $13; Here you may need more than one instruction to do
addi $13, $8,5 #this)
mult $13,$8
mflo $13
mflo $13 #assume 32 bit result
subu $12,$12,$13 # Sutract the value in $12 by the value in $13 and put the result in $12
mult $11,$11 # x*x = x2
mflo $11 #assume 32 bit result
ori $13,$0,5 # put 5 into $13
mult $11,$13 # 5x2
mflo $13 # assume 32 bit result
addu $12,$12,$13 # $12 = $12 + $13
sw $12,3000($10) #Store from $12 to poly
.data
x: .word 17 #Edit this line to change the value of x
y: .byte b1,b2,b3,b4 #Put the bytes 1, 2, 3, 4 starting from memory location 0x10010030
z: .data<0x10010050> #Put the bytes 1, 2, 3, 4 starting from memory location 0x10010050
poly: .word 0 #Poly is 0x10003000.
## End of file
#