model

Name

model --  specifies the memory model

Syntax

classdefaultsyntaxminimal syntax
invocation line onlyROM<=4k

/model =s [mall]

/mod =s [mall]

 

/model =m [edium]

/mod =m [edium]

ROM>4k

/model =l [arge]

/mod =l [arge]

Description

MODEL specifies an alternative memory model to the default specified by the .chip directive. By default, all chips are small memory model, except if ROM size is >4K then LARGE memory model is used.

If program size is <4K, SMALL model should always be used; no 3-byte JMPL or JSRL are generated. If program size is >4K, either MEDIUM or LARGE should be used. MEDIUM requires all ROM sections to not cross 4K boundaries (LNCOP will enforce this). Jumps between ROM sections are 3-byte jumps; jumps within sections are one or two bytes. LARGE places no restrictions on ROM section placement, but all jumps (except 1-byte jumps) are three bytes. You can build all modules with MEDIUM and link, then with LARGE and link, to see which is more efficient program size. In general, many small code sections are more efficient in MEDIUM model; large code sections are more efficient in LARGE model.

Note: All assembly modules should be built with the same model. The memory model is shown at the end of the listing.