en:docs:mvm:api:1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:docs:mvm:api:1 [2026/03/20 03:03] prokusheven:docs:mvm:api:1 [2026/03/20 03:11] (current) prokushev
Line 1: Line 1:
 ====== SVC_ERROREXIT ====== ====== SVC_ERROREXIT ======
  
-Terminate MVM with an error message. This call displays a message and then terminates the current MVM session.+===== Brief =====
  
-===== Parameters =====+Terminate MVM with error message (far pointer to ASCIIZ message on stack)
  
-^ Register ^ Description ^ +===== Input =====
-| Stack (top) | Far pointer (segment:offset) to an ASCIIZ message string. The message is displayed by the host system before termination. |+
  
-===== Return Value =====+  * Stack (top) far pointer (segment:offset) to an ASCIIZ message string
  
-This function does not return; it terminates the MVM.+===== Return =====
  
-===== Description =====+This function does not return. The MVM is terminated and control passes to the host operating system.
  
-**SVC_ERROREXIT** provides a way to terminate the MVM (Multiple Virtual DOS Machine) with a user‑supplied error message. It is specific to the OS/2 MVDM environment and has no direct equivalent in DOS INT 21h (the closest is AH=4Ch, which terminates without a message).+===== Notes =====
  
-Before invoking the call, the far pointer (segment and offset) of a null‑terminated ASCII string must be pushed onto the stack. The host system (OS/2will display the message and then terminate the virtual machine.+  * The message must be a null‑terminated ASCII string
 +  * The far pointer must be pushed onto the stack (segment first, then offsetbefore issuing the HLT instruction. 
 +  * Because the call never returns, no registers are preserved and the carry flag is undefined.
  
-===== Interface =====+===== Binding ===== 
 +====MASM ====
  
-<code c> 
-/* SVC_ERROREXIT – terminate with error message (far pointer on stack) */ 
-extern void SvcErrorExit(const char far *msg); 
-#pragma aux SvcErrorExit = \ 
-    "hlt"           \ 
-    "db  1"         \ 
-    "db  NOT 1"     \ 
-    parm caller [] [msg] \ 
-    modify [ax bx cx dx]; 
-</code> 
- 
-===== Example ===== 
- 
-**MASM** 
  
 <code asm> <code asm>
Line 45: Line 33:
 </code> </code>
  
-**C**+==== ====
  
 <code c> <code c>
Line 55: Line 43:
 </code> </code>
  
 +The underlying pragma is defined as:
  
 +<code c>
 +extern void SvcErrorExit(const char far *msg);
 +#pragma aux SvcErrorExit = \
 +    "hlt"           \
 +    "db  1"         \
 +    "db  NOT 1"     \
 +    parm caller [] [msg] \
 +    modify [ax bx cx dx];
 +</code>
  
-===== Notes ===== +===== See also =====
- +
-  * The message string must be in the ASCIIZ format (zero‑terminated). +
-  * After this call, the MVM is terminated and control returns to the host operating system. +
-  * Because the call never returns, no register values are preserved. +
- +
-===== See Also ===== +
- +
-  * [[en:docs:mvm:api:2|SVC_EXIT]] – terminate without a message. +
-  * [[en:docs:dos:api:int21:4c|INT 21h AH=4Ch]] – DOS terminate with return code.+
  
 +  * [[en:docs:mvm:api:2|SVC_EXIT]] – terminate without a message
 +  * [[en:docs:dos:api:int21:4c|INT 21h AH=4Ch]] – DOS terminate with return code
  
 {{page>en:templates:svcapi}} {{page>en:templates:svcapi}}