Commit | Line | Data |
---|---|---|
39bec121 TW |
1 | * \r |
2 | * Various sections directives\r | |
3 | * .bss, .data, .sect, .text, .usect\r | |
4 | * .align, .space, .bes\r | |
5 | * \r | |
6 | ; default section (should be .text)\r | |
7 | .word 0x1234 ; this should be put in .text\r | |
8 | \r | |
9 | ; initialized data\r | |
10 | .data\r | |
11 | .global coeff\r | |
12 | coeff .word 011h,022h,033h\r | |
13 | \r | |
14 | ; uninitialized data\r | |
15 | .global B1, buffer\r | |
16 | .bss buffer, 10\r | |
17 | B1: .usect ".bss", 10 ; alocate 10 words \r | |
18 | \r | |
19 | ; more initialized data in .data\r | |
20 | .global ptr\r | |
21 | ptr .word 0123h\r | |
22 | \r | |
23 | ; .text section\r | |
24 | .text\r | |
25 | .global add, aloop\r | |
26 | add: ld 0fh,a\r | |
27 | aloop: sub #1,a\r | |
28 | bc aloop,ageq \r | |
29 | \r | |
30 | ; more initialized data into .data\r | |
31 | .data\r | |
32 | .global ivals\r | |
33 | ivals .word 0aah, 0bbh, 0cch\r | |
34 | \r | |
35 | ; define another section for more variables\r | |
36 | .global var2, inbuf, align2\r | |
37 | var2 .usect "newvars", 1 ; with quotes\r | |
38 | inbuf .usect newvars, 7, 1 ; w/o quotes, block 7 words\r | |
39 | align2 .usect newvars, 15, ,1 ; 15 words aligned\r | |
40 | \r | |
41 | ; more code\r | |
42 | .text\r | |
43 | .global mpy, mloop\r | |
44 | mpy: ld 0ah,b\r | |
45 | mloop: mpy #0ah,b\r | |
46 | bc mloop,bnov\r | |
47 | .global space, bes, spacep, besp\r | |
48 | space: .space 64 ; points to first word of block\r | |
49 | bes: .bes 64 ; points to last word of block\r | |
50 | spacep: .word space\r | |
51 | besp: .word bes \r | |
52 | .global pk1, pk2, pk3, endpk1, endpk2, endpk3\r | |
53 | pk1: .space 20\r | |
54 | endpk1: .space 12 \r | |
55 | pk2: .bes 20\r | |
56 | endpk2 .bes 12 \r | |
57 | pk3: .space 20\r | |
58 | endpk3: .bes 12 \r | |
59 | ; named initialized section (TI assembler marks this as DATA, not CODE)\r | |
60 | .sect "vectors"\r | |
61 | .word 011h, 033h\r | |
62 | \r | |
63 | ; named, initialized section, no quotes (TI assembler marks as DATA)\r | |
64 | .sect clink\r | |
65 | .clink ; mark section clink as STYP_CLINK\r | |
66 | .word 022h, 044h\r | |
67 | \r | |
68 | .sect "blksect" ; (TI assembler marks this as DATA)\r | |
69 | .word 0x1234,0x4321\r | |
70 | .sblock "blksect", vectors ; set block flag on blksect and vectors\r | |
71 | \r | |
72 | .end\r |