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