home *** CD-ROM | disk | FTP | other *** search
- .386
- ;
- ; BUGTST.ASM - By: John Lauro
- ; Based on bug found by Jeff Prothero
- ;
- DATA SEGMENT USE16 PUBLIC
- MOK DB 'POPAD ok',13,10,'$'
- MNOTOK DB '*** POPAD fails test ***',13,10,'$'
- DATA ENDS
- ;
- ;
- STKSEG SEGMENT USE16 STACK
- DW 100 DUP(?)
- STKSEG ENDS
- ;
- ;
- CODE SEGMENT USE16 PUBLIC
- ASSUME CS:CODE,SS:STKSEG,DS:DATA
- CODES PROC FAR
- START: MOV AX,DATA
- MOV DS,AX
-
- mov eax,12345678
- mov edx, 0
- mov edi, 0
- pushad
- popad
-
- ; The instruction immediately following popad is the critical
- ; instruction. Simple fix, insert a NOP after popad.
-
- mov ecx, [edx+edi]
-
- cmp eax, 12345678
- je ok
- mov dx, offset mnotok
- outmsg: mov ah, 09h ; ConStringOutput
- int 21h
-
- mov ah, 4ch ; Exit
- mov al, 0
- int 21h
-
- ok: mov dx, offset mok
- jmp outmsg
-
- CODES ENDP
- CODE ENDS
- END START
-
-