Appendix e
Default Segment Names
If you use simplified segment directives by themselves, you do not need to know the names assigned for each segment. However, it is possible to mix full segment definitions with simplified segment directives, in which case you need to know the segment names.
Table E.1 shows the default segment names created by each directive.
If you use .MODEL, a _TEXT segment is always defined, even if all .CODE directives specify a name. The default segment name used as part of far-code segment names is the filename of the module. The default name associated with the .CODE directive can be overridden, as can the default names for .FARDATA and .FARDATA?.
The segment and group table at the end of listings always shows the actual segment names. However, the GROUP and ASSUME statements generated by the .MODEL directive are not shown in listing files. For a program that uses all possible segments, group statements equivalent to the following would be generated:
DGROUP GROUP _DATA, CONST, _BSS, STACK
For the tiny model, these ASSUME statements would be generated:
ASSUME cs:DGROUP, ds:DGROUP, ss:DGROUP
For small and compact models with NEARSTACK, these ASSUME statements would be generated:
ASSUME cs: _TEXT, ds:DGROUP, ss:DGROUP
For medium, large, and huge models with NEARSTACK, these ASSUME statements would be generated:
ASSUME cs:name_TEXT, ds:DGROUP, ss:DGROUP
Table E.1 Default Segments and Types for Standard Memory Models
Model Directive Name Align Combine Class Group
Tiny .CODE _TEXT WORD PUBLIC 'CODE' DGROUP
.FARDATA FAR_DATA PARA PRIVATE 'FAR_DATA'
.FARDATA? FAR_BSS PARA PRIVATE 'FAR_BSS'
.DATA _DATA WORD PUBLIC 'DATA' DGROUP
.CONST CONST WORD PUBLIC 'CONST' DGROUP
.DATA? _BSS WORD PUBLIC 'BSS' DGROUP
Small .CODE _TEXT WORD PUBLIC 'CODE'
.FARDATA FAR_DATA PARA PRIVATE 'FAR_DATA'
.FARDATA? FAR_BSS PARA PRIVATE 'FAR_BSS'
.DATA _DATA WORD PUBLIC 'DATA' DGROUP
.CONST CONST WORD PUBLIC 'CONST' DGROUP
.DATA? _BSS WORD PUBLIC 'BSS' DGROUP
.STACK STACK PARA STACK 'STACK' DGROUP*
Medium .CODE name_TEXT WORD PUBLIC 'CODE'
.FARDATA FAR_DATA PARA PRIVATE 'FAR_DATA'
.FARDATA? FAR_BSS PARA PRIVATE 'FAR_BSS'
.DATA _DATA WORD PUBLIC 'DATA' DGROUP
.CONST CONST WORD PUBLIC 'CONST' DGROUP
.DATA? _BSS WORD PUBLIC 'BSS' DGROUP
.STACK STACK PARA STACK 'STACK' DGROUP*
Compact .CODE _TEXT WORD PUBLIC 'CODE'
.FARDATA FAR_DATA PARA PRIVATE 'FAR_DATA'
.FARDATA? FAR_BSS PARA PRIVATE 'FAR_BSS'
.DATA _DATA WORD PUBLIC 'DATA' DGROUP
.CONST CONST WORD PUBLIC 'CONST' DGROUP
.DATA? _BSS WORD PUBLIC 'BSS' DGROUP
.STACK STACK PARA STACK 'STACK' DGROUP*
Table E.1 (continued)
Model Directive Name Align Combine Class Group
Large or huge .CODE name_TEXT WORD PUBLIC 'CODE'
.FARDATA FAR_DATA PARA PRIVATE 'FAR_DATA'
.FARDATA? FAR_BSS PARA PRIVATE 'FAR_BSS'
.DATA _DATA WORD PUBLIC 'DATA' DGROUP
.CONST CONST WORD PUBLIC 'CONST' DGROUP
.DATA? _BSS WORD PUBLIC 'BSS' DGROUP
.STACK STACK PARA STACK 'STACK' DGROUP*
Flat .CODE _TEXT DWORD PUBLIC 'CODE'
.FARDATA _DATA DWORD PUBLIC 'DATA'
.FARDATA? _BSS DWORD PUBLIC 'BSS'
.DATA _DATA DWORD PUBLIC 'DATA'
.CONST CONST DWORD PUBLIC 'CONST'
.DATA? _BSS DWORD PUBLIC 'BSS'
.STACK STACK DWORD PUBLIC 'STACK'
* unless the stack type is FARSTACK
See:
| file: /techref/language/masm/masmAPE.htm, 15KB, , updated: 2005/10/13 11:51, local time: 2009/11/22 05:32,
38.107.191.103:LOG IN
|
| ©2009 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? Please DO link to this page! Digg it! <A HREF="http://www.piclist.com/tecHREF/language/masm/masmAPE.htm"> APPENDIX E</A> |
| Did you find what you needed? |
|
o List host: MIT, Site host massmind.org, Top posters @20091122 olin piclist, solarwind, Vitaliy, Tamas Rudnai, Jinx, cdb, Xiaofan Chen, Alan B. Pearce, Gerhard Fiedler, JonnyMac, * Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Shultz Electronics, Timothy Weber, on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
|
Peter Todd has released source and sample projects for his artwork, including his 3d wireframe cube renderer for the PIC 18f6520 This includes examples of hardware developed with free software tools such as gEDA/gschem/PCB, SDCC, gputils and picp all on Linux. http://petertodd.ca/art/source-code/ |
.