Files
mars-dosutils/doc/kern.asm
Mario Fetka e73eb89f8c docs: update NCP and IPX layer documentation
Update README and file-level comments after the NCP/IPX source split and
renames.

Document the current layering: ncpapi.c/ncpapi.h contain the ncpXX_YY_*
protocol API wrappers, ncpcall.c contains low-level requester/transport
helpers, ncp.asm/ncp.h provide INT 21h and Client32 requester entry points, and
ipx.asm/ipx.h provide IPX and far-memory assembly glue.

Also remove stale c32ncp/kern_wasm/kern.h planning references and update the
license section to mention the root-level COPYING file.

No behavior change.
2026-05-29 12:58:35 +02:00

224 lines
4.6 KiB
NASM
Raw Blame History

;
; mars-nwe-dosutils - NetWare/DOS utility tools.
;
; Copyright (C) 1993,1996 Martin Stover, Marburg, Germany
;
; This program 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 2
; of the License, or (at your option) any later version.
;
; This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
; Purpose: Historical TASM/IDEAL low-level DOS, IPX and NetWare requester glue.
; Depends on: historical Borland/TASM build context; modern Open Watcom builds use ipx.asm and ncp.asm instead.
;
;
; kern.asm: 20-Nov-93, 21:52
IDEAL
P286
MODEL LARGE
; Fuer Turboc gerettet werden muessen folgende Register:
; BP, SS, SP, DS, CS u. SI, DI
MACRO P_START
push bp
mov bp, sp
ENDM
MACRO P_END
pop bp
ENDM
MACRO PUSH_REGS
push ds
push si
push di
ENDM
MACRO POP_REGS
pop di
pop si
pop ds
ENDM
;; EXTRN _esr_routine:FAR
PUBLIC _IPXinit;
PUBLIC _IPXopen_socket;
PUBLIC _IPXclose_socket;
PUBLIC _IPXlisten;
;; PUBLIC _asm_esr_routine;
PUBLIC _xmemmove;
PUBLIC _Net_Call;
DATASEG
enterIPX DD FAR
CODESEG
PROC _IPXinit;
P_START
PUSH_REGS
mov ax, 7A00h
int 2Fh
cmp al, 0FFh
jne @@fertig
mov cx, @data
mov ds, cx
mov [WORD PTR enterIPX], di
mov ax, es
mov [WORD PTR enterIPX+2], ax
mov al, 1 ; OK
@@fertig:
mov ah, 0
POP_REGS
P_END
ret ; OK = 1 ; nicht ok = 0
ENDP
PROC _xmemmove;
ARG z:DATAPTR, q:DATAPTR, nmbr:WORD; Argumente
cli ; Disable Interrupts
push bp
mov bp,sp
mov cx, [nmbr];
or cx, cx;
jz @@fertig; Anzahl ist 0;
push ds;
push si;
push di;
pushf
lds si, [q] ; Quelle
les di, [z] ; Ziel
cmp di, si ;
jl @@L1 ; Ziel ist kleiner
std ; Richtungsflag setzen
dec cx
add di, cx ; Von oben nach unten kopieren
add si, cx ;
inc cx ; alten Wert wiederherstellen
jmp @@L2;
@@L1:
cld ; Richtungsflag loeschen
@@L2: ; und nun das eigentliche kopieren
REP movsb ;
popf
pop di;
pop si;
pop ds;
@@fertig:
pop bp;
sti ; enable Interrupts
ret
ENDP
PROC _IPXopen_socket;
ARG sock:WORD, live:WORD
P_START
PUSH_REGS
mov ax, [live]
mov dx, [sock]
mov bx, @data
mov ds, bx
mov bx, 0
call [enterIPX]
cmp al, 0FFh
jne @@L1
mov ax, -1 ; Socket already open
jmp @@L3
@@L1:
cmp al, 0FEh
jne @@L2
mov ax, -2 ; Socket Table full
jmp @@L3
@@L2:
mov ax, dx
@@L3:
POP_REGS
P_END
ret
ENDP
PROC _IPXclose_socket;
ARG sock:WORD
P_START
PUSH_REGS
mov dx, [sock]
mov bx, @data
mov ds, bx
mov bx, 1
call [enterIPX]
POP_REGS
P_END
ret
ENDP
PROC _IPXlisten;
ARG ecb:DATAPTR
P_START
PUSH_REGS
les si, [ecb] ; Adresse ecb
mov bx, @data
mov ds, bx
mov bx, 4
call [enterIPX]
POP_REGS
P_END
mov ah, 0
ret
ENDP
;; PROC _asm_esr_routine;
;; push bp;
;; PUSH_REGS;
;; mov ax, @data
;; mov ds, ax ; F<>r C PROGRAMM
;; push es; Adressegment vom EBC
;; push si; Adressoffset vom ECB
;; call _esr_routine; C ROUTINE
;; pop si;
;; pop es;
;; POP_REGS;
;; pop bp;
;; cli ; no Interrupt says NOVELL
;; ret
;; ENDP
PROC _Net_Call;
ARG func:WORD, req:DATAPTR, repl:DATAPTR; Argumente
push bp
mov bp, sp
mov ax, [func];
push ds;
push si;
push di;
pushf
lds si, [req] ; Request
les di, [repl] ; Reply
int 21h
popf
pop di;
pop si;
pop ds;
pop bp;
mov ah, 0
ret
ENDP
END