⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 version.asm

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 ASM
字号:
;
;Example to detect if running under CauseWay and to get version if so.
;

	.model small
	.386
	.stack 1024

	.code

start	proc	near
	mov	ax,DGROUP
	mov	ds,ax

;
;Get CauseWay API interrupt vector address.
;
	mov	ax,3531h
	int	21h
;
;Check segment/selector isn't zero.
;
	mov	ax,es
	or	ax,ax
	jz	@@NotCauseway
;
;Move back to where the CauseWay ID should be and check for it.
;
;CauseWay API handler is preceded by:
;
; DB "CAUSEWAY"
; DB MajorVersion
; DB MinorVersion
;
;MajorVersion is in the range 0-255
;MinorVersion is in the range 0-99
;
;Both version numbers are binary, ie, NOT ASCII or BCD.
;
	sub	bx,10
	cmp	es:dword ptr[bx],"SUAC"
	jnz	@@NotCauseway
	cmp	es:dword ptr[bx+4],"YAWE"
	jnz	@@NotCauseway
;
;Running under CauseWay so let the user know.
;
	mov	dx,offset IsCauseWayText
	mov	ah,9
	int	21h
	jmp	@@Done
;
;Not running under CauseWay so let the user know.
;
@@NotCauseway:	mov	dx,offset NotCauseWayText
	mov	ah,9
	int	21h
;
;Exit to DOS/CauseWay
;
@@Done:	mov	ax,4c00h
	int	21h
start	endp

	.data

IsCauseWayText	db "Running under CauseWay.",13,10,"$"
NotCauseWayText db "Not running under CauseWay.",13,10,"$"

	end start

⌨️ 快捷键说明

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