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 [2024/11/07 03:54] – prokushev | en:docs:mvm:api:1 [2026/03/20 03:11] (current) – prokushev | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| ===== Brief ===== | ===== Brief ===== | ||
| + | |||
| + | Terminate MVM with error message (far pointer to ASCIIZ message on stack) | ||
| ===== Input ===== | ===== Input ===== | ||
| + | * Stack (top) = far pointer (segment: | ||
| ===== Return ===== | ===== Return ===== | ||
| + | This function does not return. The MVM is terminated and control passes to the host operating system. | ||
| ===== Notes ===== | ===== Notes ===== | ||
| + | * The message must be a null‑terminated ASCII string. | ||
| + | * The far pointer must be pushed onto the stack (segment first, then offset) before issuing the HLT instruction. | ||
| + | * Because the call never returns, no registers are preserved and the carry flag is undefined. | ||
| + | |||
| + | ===== Binding ===== | ||
| + | ====MASM ==== | ||
| + | |||
| + | |||
| + | <code asm> | ||
| + | include macrolib.inc | ||
| + | |||
| + | push ds | ||
| + | push offset msg | ||
| + | @SvcErrorExit | ||
| + | |||
| + | msg db "Fatal error", | ||
| + | </ | ||
| + | |||
| + | ==== C ==== | ||
| + | |||
| + | <code c> | ||
| + | #include < | ||
| + | |||
| + | void main(void) { | ||
| + | SvcErrorExit(" | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | The underlying pragma is defined as: | ||
| + | |||
| + | <code c> | ||
| + | extern void SvcErrorExit(const char far *msg); | ||
| + | #pragma aux SvcErrorExit = \ | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | parm caller [] [msg] \ | ||
| + | modify [ax bx cx dx]; | ||
| + | </ | ||
| ===== See also ===== | ===== See also ===== | ||
| + | * [[en: | ||
| + | * [[en: | ||
| {{page> | {{page> | ||




