S
S
SaltSugar2020-06-10 18:13:23
assembler
SaltSugar, 2020-06-10 18:13:23

Laboratory in Assembler, model of educational computer. How to put a condition if = (a specific number), then the transition?

In the manual there are only conditional transitions, but it is not clear how to create such a condition. Maybe you can write something differently?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2020-06-10
@fox_12

CMP AL, 1             ; сравниваем AL и конкретное число 1
JE  <метка перехода>  ; прыгаем если равно

F
freeExec, 2020-06-10
@freeExec

You just need conditional jumps depending on the bits in the flag register.
And the commands are called like this JNE- Jump Not Equal - jump if not equal (if the zero flag is not set). And before the jump, there is a type check CMP AX, 27hthat will set the flags.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question