亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? process.asm

?? 匯編編程藝術
?? ASM
?? 第 1 頁 / 共 3 頁
字號:
		include	process.a

StdGrp		group	stdlib,stddata
stddata		segment	para public 'sldata'

wp		equ	<word ptr>

DefaultPCB	pcb	<>
DefaultCortn	pcb	<>

ProcessID	dw	0
ReadyQ		dd	DefaultPCB
LastRdyQ	dd	DefaultPCB

CurCoroutine	dd	DefaultCortn	;Points at the currently executing
					; coroutine.

TimerIntVect	dd	?

SaveSP		dw	?		;Temp holding location for fork.
SaveSS		dw	?		;Temp holding location for fork.

stddata		ends



stdlib		segment	para public 'slcode'
		assume	cs:stdgrp

; Special case to handle MASM 6.0 vs. all other assemblers:
; If not MASM 5.1 or MASM 6.0, set the version to 5.00:

		ifndef	@version
@version	equ	500
		endif
;
;
;
;============================================================================
; Process package.
; These routines handle multitasking/multiprogramming in the standard
; library.
;============================================================================
;
;
; sl_prcsinit-	Initializes the process manager.  By default, this guy
;		assumes the use of the 1/18 second timer.  At some future
;		date I may add support for the AT msec timer.
;
;		Warning: This code patches into several interrupts.  If
;		you call this routine in your program, you must call the
;		sl_prcsquit routine before your program terminates.  Other-
;		wise the system will crash shortly thereafter.

		public	sl_prcsinit
;
sl_prcsinit	proc	far
		assume	ds:stdgrp
		push	ds
		push	es
		push	ax
		push	bx
		push	cx
		push	dx

		mov	ax, StdGrp
		mov	ds, ax

; Okay, set up this code as the first (and only) process currently in the
; ready queue:

		mov	ax, offset StdGrp:DefaultPCB
		mov	wp StdGrp:ReadyQ, ax
		mov	wp StdGrp:LastRdyQ, ax
		mov	ax, ds
		mov	wp StdGrp:ReadyQ+2, ax
		mov	wp StdGrp:LastRdyQ+2, ax

		xor	ax, ax
		mov	ProcessID, ax			;Start process IDs at 0

		mov	wp StdGrp:DefaultPCB.NextProc, ax
		mov	wp StdGrp:DefaultPCB.NextProc[2], ax
		mov	wp StdGrp:DefaultPCB.CPUTime+2, ax
		mov	wp StdGrp:DefaultPCB.CPUTime+2, 1

		mov	ah, 2ah				;Get the date.
		int	21h
		mov	wp StdGrp:DefaultPCB.StartingDate, cx
		mov	wp StdGrp:DefaultPCB.StartingDate+2, dx

		mov	ah, 2ch				;Get the time.
		int	21h
		mov	wp StdGrp:DefaultPCB.StartingTime, cx
		mov	wp StdGrp:DefaultPCB.StartingTime+2, dx


		mov	ax, 3508h		;Timer interrupt vector.
		int	21h
		mov	wp StdGrp:TimerIntVect, bx
		mov	wp StdGrp:TimerIntVect+2, es

		mov	ax, 2508h		;Patch the dispatcher into the
		mov	dx, seg StdGrp:TimerISR	; timer interrupt.
		mov	ds, dx
		mov	dx, offset StdGrp:TimerISR
		int	21h


		pop	dx
		pop	cx
		pop	bx
		pop	ax
		pop	es
		pop	ds
		ret
sl_prcsinit	endp
		assume	ds:nothing


; sl_prcsquit-	This code restores the interrupt vectors patched by the
;		sl_prcsinit routine.  This routine *must* be called before
;		you exit your program or the system will crash shortly
;		thereafter.

		public	sl_prcsquit
sl_prcsquit	proc	far
		assume	ds:StdGrp

		push	ds
		push	es
		push	ax
		mov	ax, StdGrp
		mov	ds, ax

		mov	ax, 0
		mov	es, ax

; Cannot call DOS to restore this vector because this call might
; occur in a critical error or break handler routine.

		pushf
		cli
		mov	ax, word ptr StdGrp:TimerIntVect
		mov	es:[8*4], ax
		mov	ax, word ptr StdGrp:TimerIntVect+2
		mov	es:[8*4 + 2], ax
		popf

		pop	ax
		pop	es
		pop	ds
		ret
sl_prcsquit	endp
		assume	ds:nothing



; sl_fork-	Starts a new process.  On entry, ES:DI points at a PCB.
;		This routine initializes that process and adds it to the
;		ready queue.
;
;		WARNING: This routine assumes that the only information to
;		copy off the stack is a far return address (to FORK). When
;		fork returns there will be nothing sitting on the stack of
;		the new process.  Therefore, you should not call fork from
;		inside a procedure if you expect the child process to return
;		to the called procedure.
;
;		This code assumes that you've initialized the ssSave and
;		spSave fields of the new PCB with the address of a stack
;		for that new process.
;
;		This guy returns with AX=0 and BX=<ChildProcessID> to the
;		parent process.  It returns AX=<ChildProcessID> and BX=0
;		to the child process.

		public	sl_fork
sl_fork		proc	far
		assume	ds:stdgrp

		push	bp
		mov	bp, sp
		pushf
		push	ds
		push	cx
		push	dx

		mov	ax, stdgrp
		mov	ds, ax

		if	@version ge 600

; Initialize various fields in the new PCB:
; Start with the register.  Remember, AX contains the process ID for the
; child process, BX contains zero for the child process.  AX contains zero
; for the parent process, and BX contains the child process ID for the
; parent process.
;
; SS:SP should already be set up on entry (by the caller).

		inc	StdGrp:ProcessID	;Grab a new process ID.
		mov	ax, StdGrp:ProcessID
		mov	es:[di].pcb.regax, ax
		mov	es:[di].pcb.PrcsID, ax
		mov	wp es:[di].pcb.regbx, 0
		mov	es:[di].pcb.regcx, cx
		mov	es:[di].pcb.regdx, dx
		mov	ax, 0[bp]		;Get bp value off stack.
		mov	es:[di].pcb.regbp, ax
		mov	es:[di].pcb.regsi, si
		mov	es:[di].pcb.regdi, di
		mov	ax, [bp-4]		;Get ds value off stack.
		mov	es:[di].pcb.regds, ax
		mov	es:[di].pcb.reges, es
		sti				;Must have interrupts on!
		pushf
		cli				;But the rest is a critical
		pop	ax			; section.
		mov	es:[di].pcb.regflags, ax

; The return address should be the return address for fork:

		mov	ax, 2[bp]		;Get return offset
		mov	es:[di].pcb.regip, ax
		mov	ax, 4[bp]		;Get return segment
		mov	es:[di].pcb.regcs, ax


; Set up accounting information (CPU time):

		mov	wp es:[di].pcb.CPUTime, 0
		mov	wp es:[di+2].pcb.CPUTime, 0

		mov	ah, 2ah				;Get the date.
		int	21h
		mov	wp es:[di].pcb.StartingDate, cx
		mov	wp es:[di].pcb.StartingDate+2, dx

		mov	ah, 2ch				;Get the time.
		int	21h
		mov	wp es:[di].pcb.StartingTime, cx
		mov	wp es:[di].pcb.StartingTime+2, dx


; Okay, now move the new PCB onto the ready queue (interrupts must be off
; while we're doing this!).  Place this guy in the ready queue after the
; current process so it gets a time slice real soon.

		cli
		push	es
		push	di
		les	di, StdGrp:ReadyQ
		mov	cx, wp es:[di].pcb.NextProc
		mov	dx, wp es:[di+2].pcb.NextProc
		pop	ax
		mov	wp es:[di].pcb.NextProc, ax
		pop	ax
		mov	wp es:[di+2].pcb.NextProc, ax
		les	di, es:[di].pcb.NextProc	;Pt ES:DI @ new prcs.
		mov	wp es:[di].pcb.NextProc, cx	;Link in prev 2nd
		mov	wp es:[di+2].pcb.NextProc, dx	; process.

; If there was only one process on the ready queue prior to adding this
; process, point the LastRdyQ pointer at the new process.

		mov	ax, wp StdGrp:ReadyQ
		cmp	ax, wp StdGrp:LastRdyQ
		jne	RdyNELast
		mov	ax, wp StdGrp:ReadyQ+2
		cmp	ax, wp StdGrp:LastRdyQ+2
		jne	RdyNELast
		mov	wp StdGrp:LastRdyQ, di
		mov	wp StdGrp:LastRdyQ+2, es

; Okay, return back to the calling code with AX=0 to denote that this is
; the parent routine returning.  It also returns the child process ID in
; the BX register.

RdyNELast:	xor	ax, ax
		mov	bx, StdGrp:ProcessID

		else				;TASM or MASM pre-6.0

		inc	StdGrp:ProcessID
		mov	ax, StdGrp:ProcessID
		mov	es:[di].regax, ax
		mov	es:[di].PrcsID, ax
		mov	wp es:[di].regbx, 0
		mov	es:[di].regcx, cx
		mov	es:[di].regdx, dx
		mov	ax, 0[bp]
		mov	es:[di].regbp, ax
		mov	es:[di].regsi, si
		mov	es:[di].regdi, di
		mov	ax, [bp-4]
		mov	es:[di].regds, ax
		mov	es:[di].reges, es
		sti
		pushf
		cli
		pop	ax
		mov	es:[di].regflags, ax
		mov	ax, 2[bp]
		mov	es:[di].regip, ax
		mov	ax, 4[bp]
		mov	es:[di].regcs, ax
		mov	wp es:[di].CPUTime, 0
		mov	wp es:[di+2].CPUTime, 0
		mov	ah, 2ah
		int	21h
		mov	wp es:[di].StartingDate, cx
		mov	wp es:[di].StartingDate+2, dx
		mov	ah, 2ch
		int	21h
		mov	wp es:[di].StartingTime, cx
		mov	wp es:[di].StartingTime+2, dx
		cli
		push	es
		push	di
		les	di, StdGrp:ReadyQ
		mov	cx, wp es:[di].NextProc
		mov	dx, wp es:[di+2].NextProc
		pop	ax
		mov	wp es:[di].NextProc, ax
		pop	ax
		mov	wp es:[di+2].NextProc, ax
		les	di, es:[di].NextProc
		mov	wp es:[di].NextProc, cx
		mov	wp es:[di+2].NextProc, dx
		mov	ax, wp StdGrp:ReadyQ
		cmp	ax, wp StdGrp:LastRdyQ
		jne	RdyNELast
		mov	ax, wp StdGrp:ReadyQ+2
		cmp	ax, wp StdGrp:LastRdyQ+2
		jne	RdyNELast
		mov	wp StdGrp:LastRdyQ, di
		mov	wp StdGrp:LastRdyQ+2, es
RdyNELast:	xor	ax, ax
		mov	bx, StdGrp:ProcessID

		endif



		pop	dx
		pop	cx
		pop	ds
		popf
		pop	bp
		ret
sl_fork		endp
		assume	ds:nothing



; sl_Die-	Terminate the current process.  If this is not the only
;		process in the ready queue, then this code removes the current
;		process from the ready queue and transfers control to the
;		next process in the Ready Queue.  Since the current process
;		is not the the ready queue, this action effectively kills
;		the current process.
;
;		This routine will *not* delete the current process from the
;		ready queue if it is the *only* process in the ready queue.
;		In such an event, this code returns to the caller with the
;		carry flag set (it returns this way because sl_Kill can call
;		this routine and sl_Kill requires the carry set if an error
;		occurs).

		public	sl_Die
sl_Die		proc	far
		assume	ds:StdGrp

		pushf			;Push registers onto the stack just
		push	ds		; in case there is an error return.
		push	di

		mov	di, StdGrp
		mov	ds, di
		cli				;Critical region ahead!

		if	@version ge 600

		les	di, StdGrp:ReadyQ
		cmp	wp es:[di].pcb.NextProc+2, 0
		jne	GoodDIE

; YIKES! The caller is trying to delete the only process in the ReadyQ.
; We can't let that happen, so return an error down here.

		pop	di
		pop	ds
		stc
		ret

; Okay, this DIE operation can proceed.  Handle that down here.

GoodDIE:	mov	ax, wp es:[di].pcb.NextProc
		mov	wp StdGrp:ReadyQ, ax
		mov	ax, wp es:[di].pcb.NextProc+2
		mov	wp StdGrp:ReadyQ+2, ax

; The following code, which passes control to the new "current process"
; must look exactly like the code at the tail end of the dispatcher!
; In particular, the values pushed at the beginning of this routine are
; history.  They are on a different stack, which will not be accessed again,
; so we do not need to worry about them.

		les	di, StdGrp:ReadyQ
		inc	wp es:[di].pcb.CPUTime
		jne	NoHOIncCPU
		inc	wp es:[di+2].pcb.CPUTime

NoHOIncCPU:	mov	ss, es:[di].pcb.regss
		mov	sp, es:[di].pcb.regsp
		push	es:[di].pcb.regflags
		push	es:[di].pcb.regcs
		push	es:[di].pcb.regip
		mov	ax, es:[di].pcb.regax
		mov	bx, es:[di].pcb.regbx
		mov	cx, es:[di].pcb.regcx
		mov	dx, es:[di].pcb.regdx
		mov	bp, es:[di].pcb.regbp
		mov	si, es:[di].pcb.regsi
		mov	ds, es:[di].pcb.regds
		push	es:[di].pcb.regdi
		mov	es, es:[di].pcb.reges
		pop	di
		iret


		else

		les	di, StdGrp:ReadyQ
		cmp	wp es:[di].NextProc+2, 0
		jne	GoodDIE
		pop	di
		pop	ds
		stc
		ret

GoodDIE:	mov	ax, wp es:[di].NextProc
		mov	wp StdGrp:ReadyQ, ax
		mov	ax, wp es:[di].NextProc+2
		mov	wp StdGrp:ReadyQ+2, ax
		les	di, StdGrp:ReadyQ
		inc	wp es:[di].CPUTime
		jne	NoHOIncCPU
		inc	wp es:[di+2].CPUTime
NoHOIncCPU:	mov	ss, es:[di].regss
		mov	sp, es:[di].regsp
		push	es:[di].regflags
		push	es:[di].regcs
		push	es:[di].regip
		mov	ax, es:[di].regax
		mov	bx, es:[di].regbx
		mov	cx, es:[di].regcx
		mov	dx, es:[di].regdx
		mov	bp, es:[di].regbp
		mov	si, es:[di].regsi
		mov	ds, es:[di].regds
		push	es:[di].regdi
		mov	es, es:[di].reges
		pop	di
		iret

		endif

sl_DIE		endp


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品乱人伦久久久久久| 精品99999| 毛片av一区二区三区| 国产精品无码永久免费888| 91丨porny丨首页| 亚洲国产精品久久不卡毛片 | 成人污视频在线观看| 国产.欧美.日韩| 色综合久久九月婷婷色综合| 欧美日韩中文精品| 久久影视一区二区| 日韩av午夜在线观看| 成人av电影在线网| 26uuu欧美日本| 亚洲成a人片在线不卡一二三区| 国产一区二区三区四区五区入口 | 亚洲色图丝袜美腿| 麻豆高清免费国产一区| 欧美四级电影在线观看| 色综合视频在线观看| 51久久夜色精品国产麻豆| 偷窥少妇高潮呻吟av久久免费| 男女男精品网站| 91精品国产综合久久香蕉的特点| 丝袜美腿亚洲色图| 亚洲成va人在线观看| 午夜精品久久久| 国产乱码精品一区二区三区av | 国产一区二区三区| 国内精品在线播放| 久久国产人妖系列| 欧美少妇一区二区| 国产精品伦一区二区三级视频| 午夜精品123| 欧美在线综合视频| 一区二区三区免费观看| 97se亚洲国产综合自在线| 日韩欧美国产综合在线一区二区三区 | 欧美精品在线视频| 丝瓜av网站精品一区二区| 精品视频1区2区| 午夜电影一区二区三区| 国产大片一区二区| 欧美大片免费久久精品三p| 蜜臀av一区二区三区| 国产欧美日韩亚州综合| 一本色道亚洲精品aⅴ| 亚洲一区二区三区爽爽爽爽爽| 欧美久久久久久久久中文字幕| 五月天激情小说综合| 精品免费99久久| 在线精品视频免费观看| 亚洲国产成人porn| 国产精品色哟哟| 91精品国产乱| 91片黄在线观看| 精品一区二区三区免费毛片爱| 国产精品免费视频网站| 欧美日韩视频不卡| 高清成人免费视频| 久久99精品国产麻豆婷婷洗澡| 国产精品久久久久天堂| 久久综合九色欧美综合狠狠| 在线亚洲精品福利网址导航| 国产精品99久久久久久久vr| 日本va欧美va瓶| 亚洲一区二区三区四区在线| 亚洲美腿欧美偷拍| 国产精品福利一区二区| 国产视频一区在线观看| 精品国产髙清在线看国产毛片 | 欧美性生活大片视频| 色综合婷婷久久| 在线观看不卡一区| 91.xcao| 2022国产精品视频| 国产亚洲欧美日韩在线一区| 26uuu色噜噜精品一区| 国产亚洲短视频| 亚洲欧洲精品一区二区三区| 亚洲激情中文1区| 午夜电影网一区| 国产麻豆欧美日韩一区| 成人a级免费电影| 欧美日韩电影一区| 亚洲精品在线观看视频| 正在播放亚洲一区| 日韩免费在线观看| 国产日产欧美一区二区视频| 中文字幕在线观看一区二区| 一个色在线综合| 国内精品伊人久久久久影院对白| 高清不卡一区二区| 日韩三级电影网址| 亚洲男人电影天堂| 国产精品羞羞答答xxdd| 日本精品一区二区三区高清| 欧美大胆人体bbbb| 亚洲小说欧美激情另类| 亚洲一区二区中文在线| 久久先锋影音av| 日产欧产美韩系列久久99| 欧美a级一区二区| 一区二区三区不卡视频在线观看| 亚洲福利视频导航| 亚洲午夜久久久久久久久久久| 午夜精品一区二区三区三上悠亚| 97se亚洲国产综合自在线| 国产一区二区三区在线看麻豆| 蜜桃免费网站一区二区三区| 欧美在线综合视频| 一区二区理论电影在线观看| 成人短视频下载| 最新欧美精品一区二区三区| 成人一区二区三区视频在线观看 | 欧美人与z0zoxxxx视频| 亚洲免费av在线| 国产一区二区三区四区五区美女| 欧美三级乱人伦电影| 亚洲.国产.中文慕字在线| 这里只有精品99re| 另类综合日韩欧美亚洲| 欧美国产1区2区| 欧美日韩在线播放一区| 午夜精品福利视频网站| 久久久久亚洲综合| 91麻豆swag| 国产一区二区免费在线| 一区二区三区成人| 国产视频亚洲色图| 7777精品伊人久久久大香线蕉最新版 | 免费人成在线不卡| 亚洲美女免费在线| 精品99久久久久久| 欧美精品久久一区二区三区| 国产69精品一区二区亚洲孕妇| 一区二区在线观看视频| 日韩女优av电影| 亚洲色图丝袜美腿| 日韩视频免费观看高清完整版在线观看 | 视频一区在线视频| 精品中文字幕一区二区小辣椒 | 在线亚洲免费视频| 精品美女一区二区| 一区二区三区中文字幕| 国产高清不卡一区二区| 精品视频一区三区九区| 综合分类小说区另类春色亚洲小说欧美 | 一本色道久久综合精品竹菊| 欧美一区二区三区视频在线| 一区二区三区不卡在线观看| 国产麻豆视频精品| 精品欧美久久久| 久久精品久久精品| 欧美一区二区三区色| 亚洲国产精品欧美一二99| 色网综合在线观看| 国产精品久线观看视频| 成人激情综合网站| 国产精品嫩草影院av蜜臀| av网站一区二区三区| 一区在线中文字幕| 日本精品一级二级| 亚洲va欧美va人人爽午夜| 欧美日韩国产区一| 秋霞午夜鲁丝一区二区老狼| 91精品综合久久久久久| 国产真实乱子伦精品视频| 久久久精品影视| 99精品视频在线观看| 亚洲国产精品久久一线不卡| 欧美日韩久久不卡| 久久99久久久久| 国产精品污污网站在线观看| 在线看不卡av| 狠狠色丁香九九婷婷综合五月| 国产精品久久看| 91精品婷婷国产综合久久性色| 久久精品理论片| 亚洲激情中文1区| 欧美一区二区三区影视| 亚洲色图制服丝袜| 日韩欧美亚洲国产另类 | 久久精品综合网| 午夜视频在线观看一区二区| 在线观看成人小视频| 日韩精品国产精品| 日韩一区二区三区视频在线| 成人av网站在线观看| 最新不卡av在线| 国产丝袜美腿一区二区三区| 国产一区二区三区黄视频 | 久久国产精品色| 一二三四社区欧美黄| 欧美激情中文不卡| wwww国产精品欧美| 日韩欧美在线影院| 91精品国产一区二区人妖| 欧美日韩视频第一区| 欧美唯美清纯偷拍|