MIPS Seminar

Embed Size (px)

Citation preview

  • 8/2/2019 MIPS Seminar

    1/22

  • 8/2/2019 MIPS Seminar

    2/22

    Ni dung

    Cc thanh ghi ca MIPS

    Cc khun dng lnh

    Cc ch a ch Mt s lnh c bn

    Khung chng trnh hp ng

    S dng trnh bin dch v m phngMIPS2000, MIPS

  • 8/2/2019 MIPS Seminar

    3/22

    Cc thanh ghi ca MIPS

  • 8/2/2019 MIPS Seminar

    4/22

    S dng cc thanh ghi trongMIPSIT (iregdef.h)

    #define zero $0 /* wired zero */#define AT $at /* assembler temp */#define v0 $2 /* return value */

    #define v1 $3#define a0 $4 /* argument registers a0-a3 */#define a1 $5#define a2 $6

    #define a3 $7#define t0 $8 /* caller saved t0-t9 */

  • 8/2/2019 MIPS Seminar

    5/22

    Cc khun dng lnh

  • 8/2/2019 MIPS Seminar

    6/22

    Phn tch khun dng lnh

  • 8/2/2019 MIPS Seminar

    7/22

  • 8/2/2019 MIPS Seminar

    8/22

  • 8/2/2019 MIPS Seminar

    9/22

  • 8/2/2019 MIPS Seminar

    10/22

  • 8/2/2019 MIPS Seminar

    11/22

  • 8/2/2019 MIPS Seminar

    12/22

  • 8/2/2019 MIPS Seminar

    13/22

  • 8/2/2019 MIPS Seminar

    14/22

  • 8/2/2019 MIPS Seminar

    15/22

  • 8/2/2019 MIPS Seminar

    16/22

  • 8/2/2019 MIPS Seminar

    17/22

  • 8/2/2019 MIPS Seminar

    18/22

  • 8/2/2019 MIPS Seminar

    19/22

    Khung chng trnh hp ng

    Ging 8086, chng trnh hp ng choMIPS bao gm cc thnh phn

    nh hng bin dch

    Lnh

    Gi lnh

  • 8/2/2019 MIPS Seminar

    20/22

    Khung chng trnh hp ng

    #include .data

    #Khai bo bin.text

    .globl start.ent start

    start:

    #Ni dung chng trnh chnh

    .end start.ent CTCon

    CTCon:

    #Ni dung chng trnh con

    .end CTCon

  • 8/2/2019 MIPS Seminar

    21/22

    Chng trnh v d

    #include .datatest: .asciiz "Hello World".text.set noreorder.globl start.ent start

    start:la a0,test #load the address of test string to a0jal printf #print test tring to console

    .end start

  • 8/2/2019 MIPS Seminar

    22/22

    S dng MIPSIT & MIPS

    MIPSIT2000

    MIPS

    UPLOAD

    http://c/MipsIT/bin/MipsIt.exehttp://c/MipsIT/bin/Mips.exehttp://c/MipsIT/bin/Mips.exehttp://c/MipsIT/bin/MipsIt.exe