next up previous
Next: About this document ...

EE 308

Use of dc.b and ds Assembler Directives

Here is a simple program using the assembler directives dc and ds:

DATA:    section .data    ;The stuff which follows is data
         org     $0900
table1:  dc.b    $23,$17,$f2,$a3,$56
table2:  ds.b    5
var:     dc.w    $43af

Here is the listing from the assembler:

   9                     DATA:    section .data    ;The stuff which follows is data
  10  0900                        org     $0900
  11  0900 2317f2a356    table1:  dc.b    $23,$17,$f2,$a3,$56
  12  0905 0000000000    table2:  ds.b    5
  13  090a 43af          var:     dc.w    $43af

And here is the map file:

Map of demo.h12 from link file demo.lkf - Thu Jan 25 09:56:12 2001

table1   00000900  
table2   00000905  
var      0000090a

Note that, e.g., table1 is a name with a value of 0x0900, the address of table1.





Bill Rison
2001-01-25