-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d27c7cd
commit 5e3e3c5
Showing
3 changed files
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.exe | ||
*.sw* |
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,12 @@ | ||
; Test01: simplest possible program | ||
|
||
BITS 32 | ||
|
||
SECTION .text | ||
|
||
GLOBAL _main | ||
_main | ||
xor eax, eax | ||
ret | ||
|
||
|
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,31 @@ | ||
; Test02: add some data variables and accesses | ||
|
||
BITS 32 | ||
|
||
SECTION .data | ||
|
||
_var1 db 1 | ||
_var2 dw 2 | ||
_var3 dd 4 | ||
|
||
SECTION .bss | ||
|
||
_bss1 resb 3 | ||
_bss2 resw 2 | ||
_bss3 resd 1 | ||
|
||
SECTION .text | ||
|
||
GLOBAL _main | ||
_main | ||
movzx ebx, byte [_var1] | ||
mov ecx, _var2 | ||
mov [_var3], ecx | ||
|
||
movsx edx, byte [_bss1] | ||
mov eax, _bss2 | ||
mov [_bss3], eax | ||
|
||
xor eax, eax | ||
ret | ||
|