Metropoli BBS
VIEWER: rm_test.asm MODE: TEXT (ASCII)
; --------------------------------------------------------------------------- ;
; Dawn disassembler v1.1, UnCopyright 1995-97 Sami Kantoluoto.		      ;
; --------------------------------------------------------------------------- ;
;									      ;
;	 file: rm_test.asm						      ;
; description: Test code for disassembler (realmode).			      ;
;      coding: Sami Kantoluoto						      ;
; last update: 25/09/1997 (dd/mm/yyyy)					      ;
;									      ;
; --------------------------------------------------------------------------- ;
		.386P
		.387
		.RADIX	16
Lines		equ	18
; =========================================================================== ;
PMODE_TEXT	Segment Para Public Use16 'PMODE'
		Assume	CS:PMODE_TEXT,DS:PMODE_TEXT,SS:_STCK
; --------------------------------------------------------------------------- ;
Extrn		UnAssemble:Near,Instruction_Off:DWord,Instruction_Len:Byte
Extrn		UBuf:Byte,SegSize:Byte
; --------------------------------------------------------------------------- ;
Public		HexTable
HexTable	db	"0123456789ABCDEF"
; --------------------------------------------------------------------------- ;
Start:		push	cs
		pop	ds
		mov	Instruction_Off,offset Jore
		movzx	esp,sp
		mov	cx,Lines
S_Next_Ins:	push	cx
		db	66h
		push	cs
		push	Instruction_Off
		push	Instruction_Off
		call	UnAssemble
		mov	byte ptr ds:[di],'$'
		mov	dx,offset UBuf
		mov	ah,09h
		int	21h
		mov	dx,offset LineFeed
		int	21h
		pop	cx
		in	al,60h
		cmp	al,1
		je	Exit
		dec	cx
		jnz	S_Next_Ins
		mov	dx,offset Msg
		int	21h
		xor	ah,ah
		int	16h
		cmp	al,27d
		je	Exit
		mov	ah,09h
		mov	dx,offset LineFeed
		int	21h
		mov	cx,Lines
		jmp	S_Next_Ins
Exit:		mov	ax,4C00h
		int	21h
; --------------------------------------------------------------------------- ;
LineFeed	db	13d,10d,"$"
Msg		db	"- Press ESC to exit, or any other key to continue -$"
TestNum 	dd	0FEDCBA98h
; --------------------------------------------------------------------------- ;
		.486P
Jore:		db	67h,30h,04Ch,0B5h,0h
		db	66h,67h,0Fh,40h,00h
		db	0F,61,00	    ; punpcklwd mm0,dword ptr [bx+si]
		db	0F,6E,00	    ; movd mm0,dword ptr [bx+si]
		db	0F,6F,00	    ; movq mm0,qword ptr [bx+si]
		db	90h,90h
		mov	eax,[eax*4]
		lss	eax,fword ptr LineFeed
		aam
		f2xm1
		fabs
		fiadd	dword ptr Jore
		faddp	st(1)
		fchs
		fcomp	dword ptr Jore
		fcos
		fdiv	dword ptr es:[ebx*8+eax-1234]
		ffree	st(7)
		fldcw	word ptr Jore
		db	0Fh,31h
		db	82,00,0FE
		db	83,00,0FE
		db	6A,0ABh
		db	66,0C8,10,00,0FF
		mov	eax,fs			; This really WORKS! Kewl ;)
		db	66h
		mov	word ptr TestNum,ds
		mov	ax,ds:[bx+si]
		test	cx,ds:[bx+di]
		cmp	dx,ss:[bp+si]
		xchg	bx,ss:[bp+di]
		cmp	word ptr ds:[si],1234
		or	word ptr ds:[di],4321
		jmp	dword ptr ds:[1234]
		xor	bx,ds:[bx]
		mov	byte ptr ds:[bx+di-21],12
		mov	ss,gs:[eax+ebx*8-1234]
		cmp	eax,ss:[1234556]
		rep	lock test dword ptr es:[12345678], 87654321 ; 13 bytes
					    ; screws up CodeView
		db	067h, 08Bh, 0C1h    ; mov ax,cx
		nop
		db	0,0		    ; add [bx+si],al
		db	066,0,0 	    ; same here
		mov	ax,[bx]
		mov	ax,[ebx]
		mov	ax,[edi]
		mov	ax,[bp+1]
		mov	eax,[bx]
		mov	eax,[ebx]
		mov	eax,[edi]
		mov	eax,[bp+1]
		push	12
		push	0CAFE
		push	12345678
		db	0F6, 0C4, 08	    ; test ah, 08
		test	dword ptr ds:[100], 12345678
		test	word ptr es:[100], 1
		test	byte ptr es:[100], 1
		test	word ptr ds:[100], 1
		test	byte ptr ds:[100], 1
		test	ax,1
		test	al,1
		test	eax,1
		test	di,80
		test	di,0FF80
		nop
		db	66,0E3,-10		; jcxz $-10
		db	0E3,-10 		; jcxz $-10
		db	0EBh,1			; jmp short $+1
		db	0F7, 0C7, 080, 00	; add di,0080
		db	0F7, 046, 04, 40, 00	; add word ptr [bp+04],0040
		db	084, 10, 90		; test [bx+si],dl
		db	085, 10, 90		; test [bx+si],dx
		db	83, 0f9, 02		; cmp cx,02
		db	83, 0f9, 0ca		; cmp cx,FFCA
		db	20, 43, 6f		; and [bp+di+6F],al
		db	06A, 0CA		; push 0FFCA (sign...)
		db	082, 047, 10, 20	; add byte ptr [bx+10],20
		test	[bx-1f], ebp
		db	8bh, 07 		; mov ax,[bx]
		db	67, 8bh, 07		; mov ax,[edi]
		db	068, 0ca, 0		; push 00CA
		db	068, 0fe, 99		; push 99FE
		db	066h, 00, 00
		db	01, 00
		db	66h, 01, 00
		jecxz	$+2
		idiv	dh
		idiv	si
		db	06bh, 0c0h, 0d4h	; imul ax,ax,D4
		db	06ah, 0c7h		; push FFC7
		db	0f, 020, 014		; mov dword ptr [si],cr2 (invalid)
		db	08e, 03e, 0, 0		; mov !s,word ptr [0000] (invalid segmentreg)
		db	08c, 0cbh		; mov bx,cs

		db	0F6, 0F9		; idiv cl
		db	0F7, 0F9		; idiv cx
		db	0F6, 0F8		; idiv al
		db	0F7, 0F8		; idiv ax
		db	0D0, 0F0		; shl al,1
		db	0D3, 0F3		; shl bx,cl
		db	0E8h, 0EBh, 0EBh
		db	066, 020, 04D
		db	66,061			; popad
		db	066, 020, 035
		db	081, 03F, 0, 1
		db	0FE, 07
		db	080, 03e, 00, 00, 05a
		db	0F6, 0B1, 0F1, 0AF
		db	026, 01, 06, 085, 0E
		db	0C7, 06, 3, 0, 0FF, 0
		db	08E, 05E, 0
		db	26h, 89h, 0fh
		db	08Bh, 037h
		db	08Bh, 00Eh, 0D2h, 01h
		db	3, 6, 3, 0
; --------------------------------------------------------------------------- ;
PMODE_TEXT	EndS
; =========================================================================== ;
_STCK		Segment Para Public Use16 Stack 'STACK'
		db	1000h dup (0)
_STCK		EndS
; =========================================================================== ;
		End	Start
[ RETURN TO DIRECTORY ]