procsupt.lst

来自「DOS SOURCE CODE,DOS-C started in 1988 as」· LST 代码 · 共 506 行 · 第 1/2 页

LST
506
字号
    229				     ;
    230						     POP$ALL
1   231	001D  58				     pop     ax
1   232	001E  5B				     pop     bx
1   233	001F  59				     pop     cx
1   234	0020  5A				     pop     dx
1   235	0021  5E				     pop     si
1   236	0022  5F				     pop     di
1   237	0023  5D				     pop     bp
1   238	0024  1F				     pop     ds
1   239	0025  07				     pop     es
    240	0026  CF				     iret
    241
    242	0027			     _exec_user		     endp
    243
    244
    245
    246
    247
    248				     ;
    249				     ;	     Special call for switching	processes during break handling
    250				     ;
    251				     ;	     void interrupt far	handle_break()
    252				     ;
    253				     ;
    254				     ;	     +---------------+
    255				     ;	     |	   flags     |	     22
    256				     ;	     +---------------+
    257				     ;	     |	     cs	     |	     20
    258				     ;	     +---------------+
    259				     ;	     |	     ip	     |	     18
    260				     ;	     +---------------+
    261				     ;	     |	     es	     |	     16
    262				     ;	     +---------------+
    263				     ;	     |	     ds	     |	     14
    264				     ;	     +---------------+
    265				     ;	     |	     bp	     |	     12
    266				     ;	     +---------------+
    267				     ;	     |	     di	     |	     10
    268				     ;	     +---------------+
    269				     ;	     |	     si	     |	     8
    270				     ;	     +---------------+
    271				     ;	     |	     dx	     |	     6
    272				     ;	     +---------------+
    273				     ;	     |	     cx	     |	     4
    274				     ;	     +---------------+
    275				     ;	     |	     bx	     |	     2
Turbo Assembler	 Version 3.1	    04/11/13 12:54:49	    Page 6
PROCSUPT.ASM



    276				     ;	     +---------------+
    277				     ;	     |	     ax	     |	     0	     <--- bp & sp after	mov bp,sp
    278				     ;	     +---------------+
    279				     ;
    280						     public  _handle_break
    281	0027			     _handle_break   proc far
    282
    283						     PUSH$ALL
1   284	0027  06				     push    es
1   285	0028  1E				     push    ds
1   286	0029  55				     push    bp
1   287	002A  57				     push    di
1   288	002B  56				     push    si
1   289	002C  52				     push    dx
1   290	002D  51				     push    cx
1   291	002E  53				     push    bx
1   292	002F  50				     push    ax
    293	0030  B8 0000s				     mov     ax,DGROUP
    294	0033  8E D8				     mov     ds,ax
    295	0035  8B EC				     mov     bp,sp
    296						     assume DS:	DGROUP
    297	0037  FC				     cld
    298
    299						     ; handler body - start out	by restoring stack
    300	0038  9C				     pushf
    301	0039  FA				     cli
    302
    303						     ; save background stack
    304	003A  8C 16 0000e			     mov     word ptr DGROUP:_api_ss,ss
    305	003E  89 26 0000e			     mov     word ptr DGROUP:_api_sp,sp
    306
    307						     ; restore foreground stack	here
    308	0042  8E 16 0000e			     mov     ss,word ptr DGROUP:_usr_ss
    309	0046  8B 26 0000e			     mov     sp,word ptr DGROUP:_usr_sp
    310
    311						     ; get all the user	registers back
    312						     POP$ALL
1   313	004A  58				     pop     ax
1   314	004B  5B				     pop     bx
1   315	004C  59				     pop     cx
1   316	004D  5A				     pop     dx
1   317	004E  5E				     pop     si
1   318	004F  5F				     pop     di
1   319	0050  5D				     pop     bp
1   320	0051  1F				     pop     ds
1   321	0052  07				     pop     es
    322
    323						     ; do the int 23 handler and see if	it returns
    324	0053  CD 23				     int     23h
    325
    326						     ; we're back, must	have been users	handler
    327						     PUSH$ALL
1   328	0055  06				     push    es
1   329	0056  1E				     push    ds
1   330	0057  55				     push    bp
Turbo Assembler	 Version 3.1	    04/11/13 12:54:49	    Page 7
PROCSUPT.ASM



1   331	0058  57				     push    di
1   332	0059  56				     push    si
1   333	005A  52				     push    dx
1   334	005B  51				     push    cx
1   335	005C  53				     push    bx
1   336	005D  50				     push    ax
    337	005E  8B EC				     mov     bp,sp
    338	0060  B8 0000s				     mov     ax,DGROUP
    339	0063  8E D8				     mov     ds,ax
    340						     assume DS:	DGROUP
    341
    342						     ; test for	far return or iret
    343	0065  3B 26 0000e			     cmp     sp,_usr_sp
    344	0069  74 00				     jz	     hbrk1	     ; it was far ret
    345
    346						     ; restart int 21 from the top
    347	006B			     hbrk1:	     POP$ALL
1   348	006B  58				     pop     ax
1   349	006C  5B				     pop     bx
1   350	006D  59				     pop     cx
1   351	006E  5A				     pop     dx
1   352	006F  5E				     pop     si
1   353	0070  5F				     pop     di
1   354	0071  5D				     pop     bp
1   355	0072  1F				     pop     ds
1   356	0073  07				     pop     es
    357	0074  9A 00000000se			     call    _int21_entry
    358	0079  CF				     iret
    359
    360	007A  9D		     hbrk2:	     popf		     ; clear the flag from the stack
    361	007B  73 EE				     jnc     hbrk1	     ; user wants to restart
    362						     POP$ALL
1   363	007D  58				     pop     ax
1   364	007E  5B				     pop     bx
1   365	007F  59				     pop     cx
1   366	0080  5A				     pop     dx
1   367	0081  5E				     pop     si
1   368	0082  5F				     pop     di
1   369	0083  5D				     pop     bp
1   370	0084  1F				     pop     ds
1   371	0085  07				     pop     es
    372	0086  B8 4C00				     mov     ax,4c00h	     ; exit
    373	0089  C6 06 0000e FF			     mov     byte ptr _break_flg,0ffh ;	set break detected flag
    374	008E  9A 00000000se			     call    _int21_entry
    375	0093  CF				     iret
    376
    377
    378	0094			     _handle_break   endp
    379
    380
    381				     ;
    382				     ; interrupt enable	and disable routines
    383				     ;
    384						     public  _enable
    385	0094			     _enable	     proc near
Turbo Assembler	 Version 3.1	    04/11/13 12:54:49	    Page 8
PROCSUPT.ASM



    386	0094  FB				     sti
    387	0095  C3				     ret
    388	0096			     _enable	     endp
    389
    390						     public  _disable
    391	0096			     _disable	     proc near
    392	0096  FA				     cli
    393	0097  C3				     ret
    394	0098			     _disable	     endp
    395
    396	0098			     _TEXT	     ends
    397
    398						     end
Turbo Assembler	 Version 3.1	    04/11/13 12:54:49	    Page 9
Symbol Table




Symbol Name			  Type	 Value

??DATE				  Text	 "04/11/13"
??FILENAME			  Text	 "PROCSUPT"
??TIME				  Text	 "12:54:49"
??VERSION			  Number 030A
@CPU				  Text	 0101H
@CURSEG				  Text	 _TEXT
@FILENAME			  Text	 PROCSUPT
@WORDSIZE			  Text	 2
HBRK1				  Near	 _TEXT:006B
HBRK2				  Near	 _TEXT:007A
STANDALONE			  Text	 1
_API_SP	(_api_sp)		  Word	 ----:---- Extern
_API_SS	(_api_ss)		  Word	 ----:---- Extern
_BREAK_FLG (_break_flg)		  Near	 ----:---- Extern
_DISABLE (_disable)		  Near	 _TEXT:0096
_ENABLE	(_enable)		  Near	 _TEXT:0094
_EXEC_USER (_exec_user)		  Far	 _TEXT:0000
_HANDLE_BREAK (_handle_break)	  Far	 _TEXT:0027
_INT21_ENTRY (_int21_entry)	  Far	 ----:---- Extern
_KSTACKP (_kstackp)		  Near	 ----:---- Extern
_USR_SP	(_usr_sp)		  Word	 ----:---- Extern
_USR_SS	(_usr_ss)		  Word	 ----:---- Extern
_USTACKP (_ustackp)		  Near	 ----:---- Extern

Macro Name

POP$ALL
PUSH$ALL

Structure Name			  Type	Offset

REGFRAME
 REG_AX				  Word	 0000
 REG_BX				  Word	 0002
 REG_CX				  Word	 0004
 REG_DX				  Word	 0006
 REG_SI				  Word	 0008
 REG_DI				  Word	 000A
 REG_BP				  Word	 000C
 REG_DS				  Word	 000E
 REG_ES				  Word	 0010
 REG_IP				  Word	 0012
 REG_CS				  Word	 0014
 REG_FLAGS			  Word	 0016
 IRP_LOW			  Word	 0018
 IRP_HI				  Word	 001A

Groups & Segments		  Bit Size Align  Combine Class

DGROUP				  Group
  _BSS				  16  0000 Word	  Public  BSS
  _BSSEND			  16  0000 Byte	  Public  STACK
Turbo Assembler	 Version 3.1	    04/11/13 12:54:49	    Page 10
Symbol Table



  _DATA				  16  0000 Word	  Public  DATA
_TEXT				  16  0098 Byte	  Public  CODE


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?