1 / 7

PROCESSORE DELUXE

SET DI ISTRUZIONI. PROCESSORE DELUXE. Examples of Arithmetic / Logical instructions. Banco Registri. Banco Registri. ADD | SUB | MULT | DIV. C.S. < Regs dest >, < Reg sorg 1 >, < Reg sorg 2 >. LHI | LLI. 4. Examples of Load and Store instructions.

rinah-hicks
Download Presentation

PROCESSORE DELUXE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SET DI ISTRUZIONI PROCESSORE DELUXE

  2. Examples of Arithmetic / Logicalinstructions Banco Registri Banco Registri ADD | SUB | MULT | DIV C.S. <Regsdest>, <Regsorg 1>, <Regsorg 2> LHI | LLI 4

  3. Examples of Load and Storeinstructions C.S. <Regs dest>, immediato ( <Reg sorg> ) LOAD Memoria Esterna Banco Registri C.S. immediato ( <Reg dest> ), <Regs sorg> Store Memoria Esterna Banco Registri 5

  4. Examples of Control-Flowinstructions Altero il contenuto del registro speciale PC che contiene l’indirizzo in memoria programmi dell’istruzione corrente <Regs dest> = PC 6

  5. SimpleAssembly Code PROCESSORE DELUXE

  6. Somma Vettoriale di due vettori A e B a n componenti int 32bits:C = A + B • - a, b, c sono i rispettivi indirizzi in memoria delle prime componenti vettoriali (int 32bits) • tali vettori sono memorizzati in memoria con componenti sequenziali Example of AssemblyProgram Language C++ For (k=0; k<n; k++) C[k] = A[k] + B[k]; C[k] = A[k] + B[k]; LW R1, a(R4) LW R2, b(R4) ADD R3,R1,R2 SW c(R4),R3 R1 <- Mem [R4+a] R2 <- Mem [R4+b] R3 <- R1 + R2 Mem [c+R4] <- R3 dove R4 = 0, 4, 8, 12 …, (4xn) 7

  7. Somma Vettoriale di due vettori A e B a n componenti int 32bits:C = A + B • - a, b, c sono i rispettivi indirizzi in memoria delle prime componenti vettoriali (int 32bits) • tali vettori sono memorizzati in memoria con componenti sequenziali Branch label2: Branch label1: Example of AssemblyProgram Language C++ For (k=0; k<n; k++) C[k] = A[k] + B[k]; Istruzione precedente LW R5, addr_n(R0) SUB R4,R4,R4 SLT R12,R4,R5 BEQZ R12,label1 carico il num “n x 4” in R5 azzero R4 if R4<R5 then R12=1 else R12=0 salta a label1 (+6x4) se R12=0 LW R1, a(R4) LW R2, b(R4) ADD R3,R1,R2 SW c(R4),R3 incremento R4 di 4 byte salta a label2(-8x4) ADDI R4,R4,#4 J label2 Istruzione successiva 8

More Related