Нужно написать ассемблер на Java (срочно)
Есть готовый код нужно изменить! В файлах прикреплён)
Телеграм: @just_aish
Вы мне срочно нужны!
Laboratory work 5
Assembly interpreter
In this laboratory work you should write a simple assembly interpreter in C++, Java (language is up to you).
You are given the following instructions:
Arithmetic:
• ADD, SUB, MUL, DIV, INC, DEC
Data transfer:
• MOV, XCHG
Pseudo-ops:
• DB, DW, DD
and variables should meet following requirements:
Variable name should be legal as it’s described in
Lecture 7 slide 6
- Values of variables should be expressed in binary,
decimal, hexadecimal and in characters (note that characters can be both in letter and ASCII)
o Use radix symbol to differentiate data type as it’s described in Lecture 7 slide 10
Your task is to write the assembly interpreter. As input you should write a one or multiple assembly statements. For example, the statement:
VARIABLE_NAME DB ‘Hello, assembly!’
should print out ‘Hello, assembly!’ string.
You can also input multiple statements. For example:
TEST_VAR DB 1
INC TEST_VAR
should create a variable called “TEST_VAR” with initial value 1, increments the value of “TEST_VAR” and print out the value: 2.
Here are some more examples:
In: VAR_A DB 6
VAR_B DB 1
ADD VAR_A VAR_B
INC VAR_A
Out: 8
In: HEX_VAR DB 8ABh
HEX_VAR_2 DB B78h
SUB HEX_VAR HEX_VAR_2
Out: DADh
In: CHAR_VAR DB 41h
CHAR_VAR_2 DB 42h
MOV CHAR_VAR CHAR_VAR_2
Out: 42h