summaryrefslogtreecommitdiff
path: root/asmDOSAPI.asm
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-11-28 22:34:01 +0000
committerDave Hibberd <hibby@debian.org>2024-11-28 22:34:01 +0000
commit5d8d8963ef3279f86bd26928b43ca58c27704867 (patch)
tree9fe9a224bd247020d186941173e373a0aed609f9 /asmDOSAPI.asm
parent96d6e87d127146b44fa79761de7cda1c3766add9 (diff)
parente2a62732f504cca5db8fb8d6d38ca64dfd4b92ac (diff)
Update upstream source from tag 'upstream/6.0.24.51'
Update to upstream version '6.0.24.51' with Debian dir b28e5722f66385b34f6117cf7c6dcf9d79e5cb62
Diffstat (limited to 'asmDOSAPI.asm')
-rw-r--r--asmDOSAPI.asm136
1 files changed, 136 insertions, 0 deletions
diff --git a/asmDOSAPI.asm b/asmDOSAPI.asm
new file mode 100644
index 0000000..bda758e
--- /dev/null
+++ b/asmDOSAPI.asm
@@ -0,0 +1,136 @@
+IF 0
+
+Copyright 2001-2015 John Wiseman G8BPQ
+
+This file is part of LinBPQ/BPQ32.
+
+LinBPQ/BPQ32 is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+LinBPQ/BPQ32 is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
+
+ENDIF
+
+IFNDEF BPQ64
+
+ PAGE 56,132
+;
+
+.386
+;
+; SEGMENT definitions and order
+;
+
+
+;* 32 Bit code
+_TEXT SEGMENT DWORD USE32 PUBLIC 'CODE'
+_TEXT ENDS
+
+
+
+;* Contains 32 Bit data
+_BPQDATA SEGMENT DWORD PUBLIC 'DATA'
+_BPQDATA ENDS
+
+
+ ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:FLAT
+
+OFFSET32 EQU <OFFSET FLAT:>
+
+_BPQDATA SEGMENT
+
+ extern _APISemaphore:DWORD
+
+ApiEAX DD 0;
+ApiEBX DD 0;
+ApiECX DD 0;
+ApiEDX DD 0;
+ApiESI DD 0;
+ApiEDI DD 0;
+
+_BPQDATA ENDS
+
+_TEXT SEGMENT
+;
+ EXTRN _CHOSTAPI:NEAR
+MARKER DB 'G8BPQ' ; MUST BE JUST BEFORE INT 7F ENTRY
+ DB 4 ; MAJORVERSION
+ DB 9 ; MINORVERSION
+
+
+ PUBLIC _BPQHOSTAPI
+_BPQHOSTAPI:
+;
+; SPECIAL INTERFACE, MAINLY FOR EXTERNAL HOST MODE SUPPORT PROGS
+;
+ extrn _GetSemaphore:near
+ extrn _FreeSemaphore:near
+ extrn _Check_Timer:near
+
+
+ pushad
+ call _Check_Timer
+ push offset _APISemaphore
+ call _GetSemaphore
+ add esp, 4
+ popad
+
+; Params are 16 bits
+
+ movzx eax,ax
+ movzx ebx,bx
+ movzx ecx,cx
+ movzx edx,dx
+
+ mov ApiEAX, eax
+ mov ApiEBX, ebx
+ mov ApiECX, ecx
+ mov ApiEDX, edx
+ mov ApiESI, esi
+ mov ApiEDI, edi
+
+ lea eax,ApiEDI
+ push eax
+ lea eax,ApiESI
+ push eax
+ lea eax,ApiEDX
+ push eax
+ lea eax,ApiECX
+ push eax
+ lea eax,ApiEBX
+ push eax
+ lea eax,ApiEAX
+ push eax
+
+ call _CHOSTAPI
+ add esp, 24
+
+ mov eax,ApiEAX
+ mov ebx,ApiEBX
+ mov ecx,ApiECX
+ mov edx,ApiEDX
+ mov esi,ApiESI
+ mov esi,ApiEDI
+
+
+ pushad
+ push offset _APISemaphore
+ call _FreeSemaphore
+ add esp, 4
+ popad
+
+ ret
+
+_TEXT ENDS
+ENDIF
+
+END
+