-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an ASM test for self modifying code. Made the Test fail after 1…
…00k cycles to prevent infinite loop.
- Loading branch information
1 parent
68db988
commit 8f514f8
Showing
8 changed files
with
54 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/Spice86.Tests/Resources/cpuTests/asmsrc/selfmodify.asm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
;00: 01 00 ff ff | ||
; compile it with fasm | ||
use16 | ||
start: | ||
mov ax,0 | ||
mov ss,ax | ||
mov sp,4 | ||
selmodifiedmov: | ||
mov ax,0ffffh | ||
push ax | ||
mov word[cs:selmodifiedmov+1],0001h ; modify value to put in AX next time | ||
; loop back to mov if AX is 0ffffh | ||
cmp ax,word 0ffffh | ||
je selmodifiedmov | ||
;stack should be 0100ffff | ||
hlt | ||
|
||
; bios entry point at offset fff0 | ||
rb 65520-$ | ||
jmp start | ||
rb 65535-$ | ||
db 0ffh |
Binary file not shown.