Your code seems fine for me...
Anyways, you can use INT 20h instead of END.
What assembler are you using?
Overflow handling? I suggest hooking a custom ISR to INT 0 (I highly recommend to read on DOS's INT 21h and to not use BIOS = if you exit from your program, you would run some GUI program that caused overflow, and it will trigger INT 0... and you realize that your INT0 ISR had a "jmp ExitFromIsrToMainProgram"... ehh, the result can be highly predictable
).
If you would use BIOS, MS-BOSS wouldn't have idea that the INT0 has changed...
Yes you do not need to MOV EDX,0, if you are changing the EDX right after it.
Its quite simple, but harder to tell -> if you MOVe something to a register, it will automatically erase everything that is stored on the destination (register), and replace it with contents specified as the second operand (source, in the INTEL syntax). But if you have some high number stored in EDX (full 32bit number, like 0FFFFFFFFh), and you would just do MOV DX, 5, I think the CPU will leave the 32bit part "as it is"... Correct me if this is wrong please.
By the way, 0x2 is the same as 2, and 0x0 is the same as XORing the same register with the same (it is faster as you already know, but noticeable maybe only on eerly 8086/80186/V30 etc.
), or 0x0 = 0 simply.
Save two bytes of "0x" in your asm code
JNE means "jump if not eqal", you are right
, so if CMP EDX,0 ; JNE NOTPRIME would jump to label NOTPRIME if EDX is not 0. I think you already know that
Regards
inflater