Assembly Beta ISA Introduction
Assembly Beta ISA Introduction
ASSEMBLY LANGUAGE
MASSACHUSETTS INSTITUTE OF TECHNOLOGY
BETA Instruction Set Architecture
Online simulator
BSim Sandbox:
http://computationstructures.org/exercises/sandbox
es/bsim.html
Tutorial :
Giới thiệu phần mềm BSIM: https://youtu.be/FYT38vagylg
Exam 1: https://youtu.be/NVfPtZpZh6M (Bài cơ bản)
Exam 2: https://youtu.be/AepuJT7Fsmc (symbol, label, mảng)
Exam 3: https://youtu.be/IBmPbye9QLQ (vẽ flowchat, đổi giá trị có điều kiện)
Exam 4: https://youtu.be/l3_n73GFV0g (xđ 3 giá trị có phải 3 cạnh tam giác ko)
Exam 5: https://youtu.be/39CRGA5nwHg (tìm min của 3 ô nhớ)
Exam 6: https://youtu.be/FmneWSSbTlI (tìm ước số chung lớn nhất)
Exam 7: https://youtu.be/j5U9ck1bB40 (tính tổng chuỗi số)
Opcde Systax Description
LD LD(Ra,literal,Rc) Rc ← Mem[Ra + literal]
LDR LDR(label,Rc) Rc ← Mem[Label]
ST ST(Rc,literal,Ra) Mem[Ra + literal] ← Rc
ADD ADD(Ra,Rb,Rc) Rc ← Ra + Rb
ADDC ADDC(Ra,literal,Rc) Rc ← Ra + literal
SUB SUB(Ra,Rb,Rc) Rc ← Ra − Rb
SUBC SUBC(Ra,literal,Rc) Rc ← Ra − literal
MUL MUL(Ra,Rb,Rc) Rc ← Ra * Rb
MULC MULC(Ra,literal,Rc) Rc ← Ra * literal
DIV DIV(Ra,Rb,Rc) Rc ← Ra / Rb
DIVC DIVC(Ra,literal,Rc) Rc ← Ra / literal
AND AND(Ra,Rb,Rc) Rc ← Ra & Rb
ANDC ANDC(Ra,literal,Rc) Rc ← Ra & literal
OR OR(Ra,Rb,Rc) Rc ← Ra | Rb
ORC ORC(Ra,literal,Rc) Rc ← Ra | literal
XOR XOR(Ra,Rb,Rc) Rc ← Ra ^ Rb
XORC XORC(Ra,literal,Rc) Rc ← Ra ^ literal
XNOR XNOR(Ra,Rb,Rc) Rc ← ~(Ra ^ Rb)
XNORC XNORC(Ra,literal,Rc) Rc ← ~(Ra ^ literal)
Opcde Systax Description
CMPEQ CMPEQ(Ra,Rb,Rc) if Ra = Rb then Rc ← 1 else Rc ← 0
CMPEQC CMPEQC(Ra,literal,Rc) if Ra = literal then Rc ← 1 else Rc ← 0
CMPLE CMPLE(Ra,Rb,Rc) if Ra ≤ Rb then Rc ← 1 else Rc ← 0
CMPLEC CMPLEC(Ra,literal,Rc) if Ra ≤ literal then Rc ← 1 else Rc ← 0
CMPLT CMPLT(Ra,Rb,Rc) if Ra < Rb then Rc ← 1 else Rc ← 0
CMPLTC CMPLTC(Ra,literal,Rc) if Ra < literal then Rc ← 1 else Rc ← 0
Answer:
Answer:
For all exams, you should make use of the Beta documentation and you
can use the Bsim (Beta simulator) to verify the exams.
3. Divide a[0] by a[1], the integer part stored in a[2], the remaining part stored in a[3].
4. a[0] store the value of minutes. Convert the number of minutes to hour and store in a[1] and
store the remaining one in a[2]. (For example: a[0] = 125, then a[1] = 2 and a[2] = 5).
5. a[0] store the value of hours. Convert the number of hours to week and store in a[1] and store
the remaining days in a[2] and the remaining hours in a[3]. (For example: a[0] = 497 then a[1] =
2, a[2] = 6 and a[3]=17.
7. Find the minimum value of a[0], a[1] and a[2], the result is stored in a[3].
8. Find the maximum value of a[0], a[1] and a[2], the result is stored in a[3].
9. Check if a[0], a[1] and a[2] are the lengths of the triangle. If it is true, store 1 to a[3],
otherwise store 0.