From 2d04cacc5322951f187bb17e017c12920ac8ebe2 Mon Sep 17 00:00:00 2001 From: Mark Zbikowski Date: Thu, 25 Apr 2024 21:24:10 +0100 Subject: MZ is back! --- v4.0/src/CMD/ATTRIB/_MSGRET.ASM | 233 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 v4.0/src/CMD/ATTRIB/_MSGRET.ASM (limited to 'v4.0/src/CMD/ATTRIB/_MSGRET.ASM') diff --git a/v4.0/src/CMD/ATTRIB/_MSGRET.ASM b/v4.0/src/CMD/ATTRIB/_MSGRET.ASM new file mode 100644 index 0000000..7acb51e --- /dev/null +++ b/v4.0/src/CMD/ATTRIB/_MSGRET.ASM @@ -0,0 +1,233 @@ +page 60,132 ;AN000; +name _msgret ;AN000; +title C to Message Retriever ;AN000; +;------------------------------------------------------------------- ;AN000; +; ;AN000; +; MODULE: _msgret ;AN000; +; ;AN000; +; PURPOSE: Supplies an interface between C programs and ;AN000; +; the DOS message retriever ;AN000; +; ;AN000; +; CALLING FORMAT: ;AN000; +; sysloadmsg(&inregs,&outregs); ;AN000; +; sysgetmsg(&inregs,&outregs); ;AN000; +; sysdispmsg(&inregs,&outregs); ;AN000; +; ;AN000; +; ;AN000; +; DATE: 5-21-87 ;AN000; +; Modified: 6/18/87 ;AN000; +; ;AN000; +;------------------------------------------------------------------- ;AN000; +; ;AN000; + INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AN000; +; ;AN000; + MSG_UTILNAME ;IDENTIFY THE COMPONENT ;AN000; +; ;AN000; + .8087 ;AN000; +_TEXT SEGMENT BYTE PUBLIC 'CODE' ;AN000; +_TEXT ENDS ;AN000; +_DATA SEGMENT WORD PUBLIC 'DATA' ;AN000; +_DATA ENDS ;AN000; +CONST SEGMENT WORD PUBLIC 'CONST' ;AN000; +CONST ENDS ;AN000; +_BSS SEGMENT WORD PUBLIC 'BSS' ;AN000; +_BSS ENDS ;AN000; +DGROUP GROUP CONST, _BSS, _DATA ;AN000; + ASSUME CS: _TEXT, DS: _TEXT, SS: DGROUP, ES: DGROUP ;AN000; +; ;AN000; + public _sysloadmsg ;AN000; + public _sysgetmsg ;AN000; + public _sysdispmsg ;AN000; +; ;AN000; +;------------------------------------------------------------------- ;AN000; +;------------------------------------------------------------------- ;AN000; +; ;AN000; +_DATA segment ;AN000; +.XLIST ;AN000; +.XCREF ;AN000; +; MSG_SERVICES ;DATA AREA FOR THE MESSAGE HANDLER ;AN000; + MSG_SERVICES ;DATA AREA FOR THE MESSAGE HANDLER ;AN000; +.LIST ;AN000; +.CREF ;AN000; +_DATA ends ;AN000; +; ;AN000; +; ;AN000; +_TEXT segment ;AN000; +; ;AN000; +;------------------------------------------------------------------- ;AN000; +; ;AN000; + ;DEFAULT=CHECK DOS VERSION ;AN000; + ;DEFAULT=NEARmsg ;AN000; + ;DEFAULT=INPUTmsg ;AN000; + ;DEFAULT=NUMmsg ;AN000; + ;DEFAULT=NO TIMEmsg ;AN000; + ;DEFAULT=NO DATEmsg ;AN000; +; MSG_SERVICES ;AN000; +; MSG_SERVICES ;MSG TEXT ;AN000; +.XLIST ;AN000; +.XCREF ;AN000; + MSG_SERVICES ;AN000; + MSG_SERVICES ;MSG TEXT ;AN000; +.LIST ;AN000; +.CREF ;AN000; +; ;AN000; +;------------------------------------------------------------------- ;AN000; +_sysloadmsg proc near ;AN000; + push bp ; save user's base pointer ;AN000; + mov bp,sp ; set bp to current sp ;AN000; + push di ; save some registers ;AN000; + push si ;AN000; +; ;AN000; +; copy C inregs into proper registers ;AN000; +; ;AN000; + mov di,[bp+4] ; fix di (arg 0) ;AN000; +; ;AN000; + mov ax,[di+0ah] ; load di ;AN000; + push ax ; the di value from inregs is now on stack ;AN000; +; ;AN000; + mov ax,[di+00] ; get inregs.x.ax ;AN000; + mov bx,[di+02] ; get inregs.x.bx ;AN000; + mov cx,[di+04] ; get inregs.x.cx ;AN000; + mov dx,[di+06] ; get inregs.x.dx ;AN000; + mov si,[di+08] ; get inregs.x.si ;AN000; + pop di ; get inregs.x.di from stack ;AN000; +; ;AN000; + push bp ; save base pointer ;AN000; +; ;AN000; +;------------------------------------------------------------------- ;AN000; + call sysloadmsg ; call the message retriever ;AN000; +;------------------------------------------------------------------- ;AN000; +; ;AN000; + pop bp ; restore base pointer ;AN000; + push di ; the di value from call is now on stack ;AN000; + mov di,[bp+6] ; fix di (arg 1) ;AN000; +; ;AN000; + mov [di+00],ax ; load outregs.x.ax ;AN000; + mov [di+02],bx ; load outregs.x.bx ;AN000; + mov [di+04],cx ; load outregs.x.cx ;AN000; + mov [di+06],dx ; load outregs.x.dx ;AN000; + mov [di+08],si ; load outregs.x.si ;AN000; +; ;AN000; + lahf ; get flags into ax ;AN000; + mov al,ah ; move into low byte ;AN000; + mov [di+0ch],ax ; load outregs.x.cflag ;AN000; +; ;AN000; + pop ax ; get di from stack ;AN000; + mov [di+0ah],ax ; load outregs.x.di ;AN000; +; ;AN000; + pop si ; restore registers ;AN000; + pop di ;AN000; + mov sp,bp ; restore sp ;AN000; + pop bp ; restore user's bp ;AN000; + ret ;AN000; +_sysloadmsg endp ;AN000; +; ;AN000; +; ;AN000; +_sysgetmsg proc near ;AN000; + push bp ; save user's base pointer ;AN000; + mov bp,sp ; set bp to current sp ;AN000; + push di ; save some registers ;AN000; + push si ;AN000; +; ;AN000; +; copy C inregs into proper registers ;AN000; +; ;AN000; + mov di,[bp+4] ; fix di (arg 0) ;AN000; +; ;AN000; + mov ax,[di+0ah] ; load di ;AN000; + push ax ; the di value from inregs is now on stack ;AN000; +; ;AN000; + mov ax,[di+00] ; get inregs.x.ax ;AN000; + mov bx,[di+02] ; get inregs.x.bx ;AN000; + mov cx,[di+04] ; get inregs.x.cx ;AN000; + mov dx,[di+06] ; get inregs.x.dx ;AN000; + mov si,[di+08] ; get inregs.x.si ;AN000; + pop di ; get inregs.x.di from stack ;AN000; +; ;AN000; + push bp ; save base pointer ;AN000; +; ;AN000; +;------------------------------------------------------------------- ;AN000; + call sysgetmsg ; call the message retriever ;AN000; +;------------------------------------------------------------------- ;AN000; +; ;AN000; + pop bp ; restore base pointer ;AN000; + push di ; the di value from call is now on stack ;AN000; + mov di,[bp+6] ; fix di (arg 1) ;AN000; +; ;AN000; + mov [di+00],ax ; load outregs.x.ax ;AN000; + mov [di+02],bx ; load outregs.x.bx ;AN000; + mov [di+04],cx ; load outregs.x.cx ;AN000; + mov [di+06],dx ; load outregs.x.dx ;AN000; + mov [di+08],si ; load outregs.x.si ;AN000; +; ;AN000; + lahf ; get flags into ax ;AN000; + mov al,ah ; move into low byte ;AN000; + mov [di+0ch],ax ; load outregs.x.cflag ;AN000; +; ;AN000; + pop ax ; get di from stack ;AN000; + mov [di+0ah],ax ; load outregs.x.di ;AN000; +; ;AN000; + pop si ; restore registers ;AN000; + pop di ;AN000; + mov sp,bp ; restore sp ;AN000; + pop bp ; restore user's bp ;AN000; + ret ;AN000; +_sysgetmsg endp ;AN000; +; ;AN000; +; ;AN000; +_sysdispmsg proc near ;AN000; + push bp ; save user's base pointer ;AN000; + mov bp,sp ; set bp to current sp ;AN000; + push di ; save some registers ;AN000; + push si ;AN000; +; ;AN000; +; copy C inregs into proper registers ;AN000; +; ;AN000; + mov di,[bp+4] ; fix di (arg 0) ;AN000; +; ;AN000; + mov ax,[di+0ah] ; load di ;AN000; + push ax ; the di value from inregs is now on stack ;AN000; +; ;AN000; + mov ax,[di+00] ; get inregs.x.ax ;AN000; + mov bx,[di+02] ; get inregs.x.bx ;AN000; + mov cx,[di+04] ; get inregs.x.cx ;AN000; + mov dx,[di+06] ; get inregs.x.dx ;AN000; + mov si,[di+08] ; get inregs.x.si ;AN000; + pop di ; get inregs.x.di from stack ;AN000; +; ;AN000; + push bp ; save base pointer ;AN000; +; ;AN000; +;------------------------------------------------------------------- ;AN000; + call sysdispmsg ; call the message retriever ;AN000; +;------------------------------------------------------------------- ;AN000; +; ;AN000; + pop bp ; restore base pointer ;AN000; + push di ; the di value from call is now on stack ;AN000; + mov di,[bp+6] ; fix di (arg 1) ;AN000; +; ;AN000; + mov [di+00],ax ; load outregs.x.ax ;AN000; + mov [di+02],bx ; load outregs.x.bx ;AN000; + mov [di+04],cx ; load outregs.x.cx ;AN000; + mov [di+06],dx ; load outregs.x.dx ;AN000; + mov [di+08],si ; load outregs.x.si ;AN000; +; ;AN000; + lahf ; get flags into ax ;AN000; + mov al,ah ; move into low byte ;AN000; + mov [di+0ch],ax ; load outregs.x.cflag ;AN000; +; ;AN000; + pop ax ; get di from stack ;AN000; + mov [di+0ah],ax ; load outregs.x.di ;AN000; +; ;AN000; + pop si ; restore registers ;AN000; + pop di ;AN000; + mov sp,bp ; restore sp ;AN000; + pop bp ; restore user's bp ;AN000; + ret ;AN000; +_sysdispmsg endp ;AN000; +; ;AN000; +; ;AN000; +_TEXT ends ; end code segment ;AN000; + + include msgdcl.inc + + end ;AN000; + \ No newline at end of file -- cgit v1.2.3