This is an Assembly code and i want to know what the result for every instruction: AX and BX

The code is:

Mov ax, 0
Mov bx, -5
100: Inc ax++
Sub bx, ax
Cmp bx, -10
Jb 100
Put ax
Move ax, bx
Put ax
End

Is the above program Right or worng? it seems to me there is logical problem?!
what do you think ?!

Hi,

There is a loop which turns 3 times so 4 of the instructions are called 3 times so you want a 17 by 2 table or the end result ? The last two puts will give 3 and -11 respectively.

Loren Soth

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.