1 ; ***********************************************************
  2 ; *                                                         *
  3 ; * Copyright, (C) Honeywell Bull Inc., 1987                *
  4 ; *                                                         *
  5 ; * Copyright, (C) Honeywell Information Systems Inc., 1986 *
  6 ; *                                                         *
  7 ; ***********************************************************
  8 
  9 ; HISTORY COMMENTS:
 10 ;  1) change(86-01-01,McGinn), approve(87-07-13,MCR7580),
 11 ;     audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
 12 ;     Created.
 13 ;  2) change(86-04-13,Flegel), approve(87-07-13,MCR7580),
 14 ;     audit(87-07-13,Leskiw), install(87-08-07,MR12.1-1072):
 15 ;     Major/minor capability number in dh/dl.
 16 ;                                                      END HISTORY COMMENTS
 17 
 18 ;/* : PROCEDURE FUNCTION (send_message)
 19 ;
 20 ;Send the message to multics through protocol channels with major/minor
 21 ;numbers prepended to the message.
 22 ;*/
 23 
 24 ;/* : NOTES
 25 ;
 26 ;Syntax:
 27 ;        mov  cx,length
 28 ;        mov  dh,major_cap
 29 ;        mov  dl,major_cap
 30 ;        mov  si,offset data_buff
 31 ;
 32 ;Arguments:
 33 ;        cx - length of data
 34 ;        dx - major/minor capability number
 35 ;        si - address of data
 36 ;
 37 ;
 38 ;Currently, messages greater than 1 packet length will lose the data after
 39 ;one packetlength.
 40 ;*/
 41 
 42 page 55,132
 43 include dos.mac
 44 include mowsdefs.mac
 45 
 46 dseg
 47 
 48 ;---------- Public Declarations
 49 
 50 public send_message
 51 hal_buff        db 255
 52 endds
 53 page
 54 ;**************************************************************************
 55 ;                               MAIN
 56 ;**************************************************************************
 57 pseg
 58 
 59 ;----------- Externals
 60 
 61 extrn snddat:near
 62 
 63 send_message proc near
 64 
 65         push ax
 66         push cx
 67         push dx
 68         push di
 69         push si
 70 
 71 ;/* : place major and minor into packet buffer */
 72 
 73         mov  ax,offset hal_buff
 74         mov  di,ax
 75 
 76         add  dh,ADD_CONTROL            ; Make sure major printable
 77         mov  ds:[di],dh
 78         inc  di
 79         add  dl,ADD_CONTROL            ; Make sure minor printable
 80         mov  ds:[di],dl
 81         inc  di
 82 
 83 ;/* : Copy message into sending packet buffer */
 84 
 85         push cx
 86 
 87 copyloop:
 88         mov  ax, es:[si]               ; si is indexing source data
 89         mov  ds:[di], ax               ; di is indexing destination data
 90         inc  si
 91         inc  di
 92         loopne copyloop
 93 
 94         pop  cx
 95         add  cx,2                      ; add character count plus minr/major count
 96 
 97         mov  si, offset hal_buff       ; prepare to call into snddat
 98         mov  ax, 1
 99         mov  bp,sp
100         push cx                        ; length
101         push si                        ; Message address
102         push ax                        ; channel
103 
104 ;/* : call snddat(channel, data, length) */
105 
106         call snddat                     ;Hal's routine to build packet &
107                                         ;send it to multics
108         mov  sp,bp
109 
110         pop  si
111         pop  di
112         pop  dx
113         pop  cx
114         pop  ax
115         ret
116 
117 send_message endp
118         endps
119         end
120 ^Z