summaryrefslogtreecommitdiff
path: root/test/struc.asm
diff options
context:
space:
mode:
Diffstat (limited to 'test/struc.asm')
-rw-r--r--test/struc.asm33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/struc.asm b/test/struc.asm
new file mode 100644
index 0000000..3c8c1b4
--- /dev/null
+++ b/test/struc.asm
@@ -0,0 +1,33 @@
+;Testname=test; Arguments=-fbin -ostruc.bin; Files=stdout stderr struc.bin
+
+bits 32
+
+; Simple struc example
+struc teststruc1
+ .long: resd 1
+ .word: resw 1
+ .byte: resb 1
+ .str: resb 32
+endstruc
+
+; Reference with offset
+mov [ebp - 40 + teststruc1.word], ax
+
+istruc teststruc1
+ at .word, db 5
+iend
+
+; Struc with base offset
+; should be the same as the previous stuc
+struc teststruc2, -40
+ .long: resd 1
+ .word: resw 1
+ .byte: resb 1
+ .str: resb 32
+endstruc
+
+mov [ebp + teststruc2.word], ax
+
+istruc teststruc2
+ at .word, db 5
+iend