Mang Tomas
Mang Tomas

Reputation: 25

emu8086 - How do i terminate a program according to a condition

i just want to ask how do i terminate or close the program after it meets a condition. im near to finishing this case study.. thanks for answering :]

like:

cmp byte ptr [sel3_1+2], 'a'
je stop

stop:
*code here*

or something that coded to stop under the condition

Upvotes: 2

Views: 8458

Answers (1)

Tony68000
Tony68000

Reputation: 303

Call INT 21h with service 4CH - exit with a return code, put the return code in AL.

So,

MOV AH, 4CH
MOV AL, 01 ;your return code.
INT 21H

Or to exit without a return code, use service 0...

MOV AH, 0
INT 21H

Upvotes: 4

Related Questions