1<html lang="en"> 2<head> 3<title>Struct - Using as</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Using as"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Pseudo-Ops.html#Pseudo-Ops" title="Pseudo Ops"> 9<link rel="prev" href="String.html#String" title="String"> 10<link rel="next" href="SubSection.html#SubSection" title="SubSection"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<!-- 13This file documents the GNU Assembler "as". 14 15Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 162000, 2001, 2002, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, 17Inc. 18 19Permission is granted to copy, distribute and/or modify this document 20under the terms of the GNU Free Documentation License, Version 1.3 21or any later version published by the Free Software Foundation; 22with no Invariant Sections, with no Front-Cover Texts, and with no 23Back-Cover Texts. A copy of the license is included in the 24section entitled ``GNU Free Documentation License''. 25 26--> 27<meta http-equiv="Content-Style-Type" content="text/css"> 28<style type="text/css"><!-- 29 pre.display { font-family:inherit } 30 pre.format { font-family:inherit } 31 pre.smalldisplay { font-family:inherit; font-size:smaller } 32 pre.smallformat { font-family:inherit; font-size:smaller } 33 pre.smallexample { font-size:smaller } 34 pre.smalllisp { font-size:smaller } 35 span.sc { font-variant:small-caps } 36 span.roman { font-family:serif; font-weight:normal; } 37 span.sansserif { font-family:sans-serif; font-weight:normal; } 38--></style> 39<link rel="stylesheet" type="text/css" href="../cs.css"> 40</head> 41<body> 42<div class="node"> 43<a name="Struct"></a> 44<p> 45Next: <a rel="next" accesskey="n" href="SubSection.html#SubSection">SubSection</a>, 46Previous: <a rel="previous" accesskey="p" href="String.html#String">String</a>, 47Up: <a rel="up" accesskey="u" href="Pseudo-Ops.html#Pseudo-Ops">Pseudo Ops</a> 48<hr> 49</div> 50 51<h3 class="section">7.107 <code>.struct </code><var>expression</var></h3> 52 53<p><a name="index-g_t_0040code_007bstruct_007d-directive-473"></a>Switch to the absolute section, and set the section offset to <var>expression</var>, 54which must be an absolute expression. You might use this as follows: 55<pre class="smallexample"> .struct 0 56 field1: 57 .struct field1 + 4 58 field2: 59 .struct field2 + 4 60 field3: 61</pre> 62 <p>This would define the symbol <code>field1</code> to have the value 0, the symbol 63<code>field2</code> to have the value 4, and the symbol <code>field3</code> to have the 64value 8. Assembly would be left in the absolute section, and you would need to 65use a <code>.section</code> directive of some sort to change to some other section 66before further assembly. 67 68 </body></html> 69 70