Debian Codegraph @

travis/test/multisection.asm

raw
1 ;Testname=aout; Arguments=-faout -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
2 ;Testname=aoutb; Arguments=-faoutb -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
3 ;Testname=as86; Arguments=-fas86 -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
4 ;Testname=elf32; Arguments=-felf32 -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
5 ;Testname=elf64; Arguments=-felf64 -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
6 ;Testname=obj; Arguments=-fobj -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
7 ;Testname=rdf; Arguments=-frdf -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
8 ;Testname=win32; Arguments=-fwin32 -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
9 ;Testname=win64; Arguments=-fwin64 -olnxhello.o -Ox; Files=stdout stderr lnxhello.o
10
11 ; To test where code that is placed before any explicit SECTION
12 ; gets placed, and what happens if a .text section has an ORG
13 ;statement, uncomment the following lines.
14 ;
15 ; times 10h nop
16 ;
17 ;section .text
18 ;org 0x300
19 ; times 20h inc ax
20
21 ; let's see which of these sections can be placed in the specified order.
22
23 section .appspecific
24 section .data
25 section .stringdata
26 section .mytext
27 section .code
28 section .extra_code
29
30
31 section .stringdata
32 mystr1: db "Hello, this is string 1", 13, 10, '$'
33
34 section .extra_code
35 ;org 0x200
36 bits 16
37 more:
38 mov si, asciz1
39 mov ah, 0x0E
40 xor bx, bx
41 .print:
42 lodsb
43 test al, al
44 jz .end
45 int 0x10
46 jmp short .print
47 .end:
48
49 xor ax, ax
50 int 0x16
51
52 mov ax, 0x4c00
53 int 0x21
54
55 section .appspecific
56 asciz1: db "This is string 2", 0
57
58 section .code
59 ;org 0x100
60 bits 16
61
62 start:
63 mov dx, mystr1
64 mov ah, 9
65 int 0x21
66
67 xor ax, ax
68 int 0x16
69
70 jmp more
71
72 section .text
73 xor eax,eax
74 times 50h nop
75
76 section .mytext
77
78 xor ebx,ebx
79
80 section .data
81 db 95h,95h,95h,95h,95h,95h,95h,95h
82
83 section .hmm
84 resd 2
85
86 section .bss
87 resd 8
88
89 section .final1
90 inc ax
91
92 section .final2
93 inc bx
94
95 section .final3
96 inc cx