Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:docs:mvm:api:1 [2026/03/20 02:36] – prokushev | en: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: | + | |
| - | ===== Return Value ===== | + | * Stack (top) = far pointer (segment: |
| - | 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 | + | * The message must be a null‑terminated ASCII string. |
| + | * The far pointer | ||
| + | * Because the call never returns, no registers are preserved | ||
| - | The low‑level instruction sequence generated for this SVC is: | + | ===== Binding ===== |
| - | HLT | + | ====MASM ==== |
| - | DB 1 ; function code | + | |
| - | DB NOT 1 ; complement of function code (for validation) | + | |
| - | ===== Example ===== | ||
| - | |||
| - | The following example shows how to terminate with an error message using assembly language: | ||
| <code asm> | <code asm> | ||
| - | push ds | + | include macrolib.inc |
| - | | + | |
| - | hlt | + | push ds |
| - | | + | push offset msg |
| - | db not 1 | + | |
| msg db "Fatal error", | msg db "Fatal error", | ||
| </ | </ | ||
| - | In a high‑level language (e.g., | + | ==== C ==== |
| <code c> | <code c> | ||
| - | #define SvcErrorExit(msg) \ | + | #include < |
| - | | + | |
| - | push ds \ | + | void main(void) { |
| - | push offset msg \ | + | |
| - | hlt \ | + | } |
| - | _emit 1 \ | + | |
| - | _emit ~1 \ | + | |
| - | | + | |
| </ | </ | ||
| - | ===== Notes ===== | + | The underlying pragma is defined as: |
| - | * The message string must be in the ASCIIZ format | + | <code c> |
| - | * After this call, the MVM is terminated and control returns to the host operating system. | + | extern void SvcErrorExit(const char far *msg); |
| - | * Because the call never returns, no register values are preserved. | + | #pragma aux SvcErrorExit = \ |
| + | " | ||
| + | " | ||
| + | " | ||
| + | parm caller [] [msg] \ | ||
| + | modify [ax bx cx dx]; | ||
| + | </ | ||
| - | ===== See Also ===== | + | ===== See also ===== |
| - | * [[en: | + | |
| - | * [[en: | + | * [[en: |
| - | * [[en: | + | |
| {{page> | {{page> | ||




