N
N
newstatistician19962020-11-30 19:58:44
assembler
newstatistician1996, 2020-11-30 19:58:44

What does this assembler code implement?

The task is to determine what the given code does. Please tell me, it's really bad with assembler.
Initial conditions:
addr - address of initial values
​​var1 - unsigned number, variable
var2, var3 - variables for storing the result
Program text:

JMP     (label4)
label1:
  MOV.B   &var1,R15
  RLA.W   R15
  TST.W   addr(R15)
  JGE     (label2)
  INC.B   &var2
  JMP     (label3)
label2:
  MOV.B   &var1,R15
  RLA.W   R15
  CMP.W   #1,addr(R15)
  JL      (label3)
  INC.B   &var3
label3:
  INC.B   &var1
label4:
  MOV.B   &var1,R15
  RLA.W   R15
  TST.W   addr(R15)
  JNE     (label1)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question