[SOLVED] Cmpe230 Project-Assembly interpreter

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Cmpe230-Assembly-interpreter-mgwglq.zip (190.8 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

In this project, you will implement an interpreter for an assembly language of a hypothetical 8086- like CPU called HYP86. You can make the following assumptions about HYP86:

  1. It has 64KB of memory.
  2. Each instruction has a fixed length of 6 bytes.
  3. It supports immediate, register, register indirect, memory addressing and stack addressing

    modes.

  4. It has 64K memory. Instructions start at address 0. Stack starts at high address (FFFF) and

    grows towards low address. SP points to free word location on top of stack.

  5. It has 16-bit registers AX,BX, CX, DX, DI, SP, SI, BP.
  6. It has 8-bit registers AH, AL, BH, BL, CH, CL, DH, DL.
  7. It has the following flags: ZF zero flag, CF carry flag, AF auxillary flag, SF sign flag , OF

    overflow flag.

  8. Assume all registers with the exception of SP and flags are initialized to zero at the

    beginning. SP initially contains FFFE.

  9. The following instructions are available: MOV, ADD, SUB, INC, DEC, MUL, DIV, XOR, OR,

    AND, NOT, RCL, RCR, SHL, SHR, PUSH, POP, NOP, CMP, JZ, JNZ, JE, JNE, JA, JAE, JB, JBE,

    JNAE, JNB, JNBE, JNC, JC, PUSH, POP, INT 20h (exit to dos), INT 21h (read/write character).

  10. Interpreter should not allow reading or writing to instruction area starting from 0, up to and

    including INT 20 (which is required to be the last instruction at the end of instruction area).

  11. Labels can be used in the assembly language.
  12. Directives dw and db can be used to define words and bytes. A variable-name can be put in

    front of dw and db. When using variable names offset variable-name accesses the address,

    just the variable-name accesses the value.

  13. If there is overflow, you should exit the interpreter with a message saying overflow and give

    the line number.

  • Cmpe230-Assembly-interpreter-mgwglq.zip