Şimdi Ara

assembly PROJESİ yapan var mı

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir (1 Mobil) - 1 Masaüstü1 Mobil
5 sn
1
Cevap
0
Favori
439
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • assembly dersi alıyorum 1 hafta sonra proje teslimi var.

    proje motorola 6800 ve shell script ile ilgili...

    ücreti ile projemi yaptırmak istiyorum...
    PROJE:

    Part 1
    Your parser should be able to read a M6800 assembly language code given in a file, and parse it into its tokens. After parsing the
    tokens, you should print the type of each token: label, operation (opcode), operand or reference. You should also print the
    addressing mode of the instruction. An example input-output is given below:
    Input:
    LDAA 0H
    LDX #10H
    LOOP: STAA 10H,X
    INX
    BRA LOOP
    Output:
    LDAA – operation
    0H – operand
    * Direct Mode *
    LDX – operation
    10H operand
    * Immediate Mode *
    LOOP – label
    STAA – operation
    10H – operand
    X – denotes indexed mode
    * Indexed Mode *
    INX – operation
    * Inherent Mode *
    BRA – operation
    LOOP – reference
    * Relative Mode *
    Assume labels consist of only one word, and have an adjacent semicolon at the end. Other than that, your program should be able
    to deal with whitespaces. Also, don’t forget that ‘#’ denotes immediate values, and all numerical values without an H are in
    decimal form.
    Your parser should read the input from the file character by character until a separation character (such as “:” , “,” , whitespace
    character, end of line character, etc.). Determine the type of this token and print it. Then repeat these steps until the end of file is
    reached.
    While implementing this part, keep in mind that you will need the parser in Part 2. You won’t need the exact output produced in
    Part 1, but you will need to parse the instructions into operations, operands, labels and references; and you will need the
    addressing modes.
    Part 2
    In Part 2 you will implement the interpreter. Your interpreter must follow the steps below:
    1. Initially read the code from the input file line-by-line and store it in a text buffer array. During this process, prepare SDT. Use
    the following structures for text buffer and SDT.Text Buffer
    IP 0 L1: LDAA 0H
    1 LDX #10H
    2 LOOP: STAA 10H,X
    3 INX
    4 BRA LOOP
    struct txt {
    char line[20];
    }
    struct txt textbuffer[100];
    SDT
    Text buffer index
    L1 0
    LOOP 2
    struct st {
    char label[5];
    int textindex;
    }
    struct st sdt[20];
    Then, set instruction pointer (IP) to 0 and start interpretation.
    2. Using your parser in Part 1, parse the instruction pointed by IP.
    3. Check instruction type and call the related execute routine to process it. (You will write an execute routine for each
    instruction.)
    4. Each execute routine must check the addressing mode of the instruction. Then, it must process the instruction and update the
    contents of the following units: memory, accumulators A and B, index register, CCR, etc. It must also display the contents of
    these units.
    5. Set IP as follows and go to Step 2.
    IP  IP+1 (for sequential) or
    IP  SDT entry for the label (for branch)
    Use the following structures for the memory, accumulators A and B, index register, CCR.
    int A; // Accumlator A
    int B; // Accumlator B
    int IX; // Index register
    int IP; // Instruction Pointer
    char CCR; // Condition Code Register
    int Memory[4096] // Memory
    Implement the following instructions and addressing modes:
    Symbol Addressing modes
    LDAA, LDAB Immediate, direct
    ASLA, ASLB Inherent
    ASRA, ASRB Inherent
    STAA, STAB Direct
    ADDA, ADDB Immediate, Direct
    SUBA, SUBB Immediate, Direct
    INCA, INCB Inherent
    DECA, DECB Inherent
    INC Direct
    CMPA, CMPB Immediate, Direct
    BRA Relative
    BEQ Relative
    BPL Relative
    Upon starting, your program must assume a blank memory, setting all memory locations to 0; accumulators will also contain 0.
    During the interpretation, your program must parse each instruction, process the instruction, and display the contents of the
    accumulators, CCR and memory location in the following format:
    A= … B= … CCR= … M[..]= …
    Ex: LDAA 100H
    A= -4 B= 12 CCR= 1101000 M[100]= -4
    There must be at least one loop structure in your input M6800 code



    < Bu mesaj bu kişi tarafından değiştirildi hazal7291 -- 5 Ocak 2015; 19:31:39 >







  • Yapay Zeka’dan İlgili Konular
    çeviri yapabilecek var mı
    3 yıl önce açıldı
    Daha Fazla Göster
    
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.