פורסם 2017 באפריל 258 שנים יש תרגיל שבו צריך להחליף צמד תווים ואם הם זהים אז לקחת את התו הימני. יש לי את הסגמנט ולמען האמת אין לי שמץ של מושג איך לעשות את זה. אשמח להכוונה. תודה # Computer Architecture #Question 1: # Input: 1)in buf (in the data segment) string of exactly 10 chars # # # Output: 1)swap each pair chars in the string # (if the pair identical change the second to '*' ) # 2)print buf in reverse ## ## # Example # buf= "aabb456788" # #After swap buf= "a*b*54768* # # in reverse = "*86745*b*a" ################# Data segment ##################### .data buf: .ascii "aabb456788" ################# Code segment ##################### .text .globl main main: # main program entry #answer la $t0,buf lw $t1,1(buf) beq $t0,$t1,swap_same swap_same : lw $t1,1(buf) sw $t1, 6 # end of program exit: li $v0,10 syscall
ארכיון
דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.