de-lint. disable c++ parentheses warnings. fix casts in AROSPDFApp.cc
[AROS-Contrib.git] / rexx / src / int2e.a
blobbcbac8e5c667da8169f8247d3e80bdbb332fa042
1 TITLE 'Interrupt 2E back door for COMMAND.COM'
2 NAME INT2E
4 ; void far int2e(char far *cmd);
6 ; Caller Borland C
8 CMDoff EQU word ptr [bp+06h] ; standard stack frame
9 CMDseg EQU word ptr [bp+08h]
11 _TEXT SEGMENT byte public 'CODE'
12 ASSUME cs:_TEXT,ds:_TEXT,es:_TEXT
15 PUBLIC _int2e
16 _int2e PROC far
17 push bp ; preserve caller registers
18 mov bp,sp
19 push ds
20 push es
22 push ax
23 push bx
24 push cx
25 push dx
26 push si
27 push di
29 mov ax,CMDseg
30 mov ds,ax ; DS -> segment of ASCIIZ with the cmd
31 mov dx,CMDoff ; DX -> offset of ASCIIZ
33 ; Let's point our stack
35 mov ax,ss ; Save old stack segment
36 mov cs:OldSS,ax ;
37 mov cs:OldSP,sp ; and stack pointer
38 cli ; turn off interupts while switching
39 mov ax,cs
40 mov ss,ax ; Stack segment
41 mov sp,offset STAK ; point our stack
42 sti ; enable interupts
44 ; Copy command to the our area and found its length
46 mov ax,ds
47 mov es,ax
48 mov di,dx
49 mov cx,0ffffh
50 xor ax,ax
51 cld
52 repne scasb ; Find ascii'Z' in es:di -> argument
53 neg cx
54 sub cx,2
55 mov cs:CMDLEN,cl
56 mov si,dx
57 mov di,offset CMD
58 mov ax,cs
59 mov es,ax
60 rep movsb ; move from DS:SI to ES:DI
61 xor bx,bx
62 mov bl,cs:CMDLEN
63 mov cs:CMD[bx],0Dh
65 mov ax,cs
66 mov ds,ax
67 mov si,offset CMDLEN
68 int 2eh
70 ; Restore old stack
72 mov ax,cs:OldSS
73 cli
74 mov ss,ax ; Stack segment
75 mov sp,cs:OldSP ; and Stack pointer
76 sti
78 pop di
79 pop si
80 pop dx
81 pop cx
82 pop bx
83 pop ax
85 pop es
86 pop ds ; restore caller registers
87 mov sp,bp
88 pop bp
89 ret
92 db 32 DUP ('STACK___') ; 512 bytes stack
93 STAK label byte
95 OldSS dw ?
96 OldSP dw ?
98 CMDLEN db ?
99 CMD db 130 DUP (00h)
101 _int2e ENDP
103 _TEXT ENDS