N
N
Nikolaika2019-09-16 19:02:31
assembler
Nikolaika, 2019-09-16 19:02:31

Doesn't terminate correctly after int 20h?

The program in afdpro displays a message - "Hello world!", and does not terminate correctly after the instruction int 20h (invalid opcode), so it can work, just wondering what's wrong?

CSEG segment
assume CS:CSEG, DS:CSEG, ES:CSEG, SS:CSEG
org 100h

Begin:
  mov ax,9
  mov dx,offset Message
  int 21h

  int 20h

 Message db 'Hello, world!$'
CSEG ends
end Begin

(after this
int 20
command, this command is executed:
db fe
these commands are executed correctly with their registers.)
Then all registers and segments are mixed up in
pusha and all sorts of catastrophes .. and
invalid opcode ..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pfemidi, 2019-09-16
@pfemidi

Does it compile to .com or to .exe ? int 20h to exit is good only for .com , for .exe you should use

mov ax, 4c00h
int 21h

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question