¾î¼Àºí Áö½Ã¸í·É(Directive Language)

1. ¾î¼Àºí Áö½Ã¸í·ÉÀ̶õ?

¾î¼Àºí·¯´Â ¸¹Àº ±â´ÉÀ» °¡Áö°í ÀÖ´Ù. ±× ±â´ÉÀº ´ëºÎºÐÀÌ ¾î¼Àºí °á°ú¸¦ º¸±â ½±°í, µð¹÷ÇÏ±â Æí¸®Çϵµ·Ï Çϱâ À§ÇÑ °ÍÀÌÁö¸¸, ±×µéÀº »ç¿ëÇÏ´Â »ç¶÷ÀÌ Áö½ÃÇØ ÁÙ Çʿ䰡 ÀÖ´Ù. ±× Áö½Ã¸¦ À§ÇÑ ¸í·É(¸»ÇÏÀÚ¸é ÀÇ»ç¸í·É)ÀÌ ¾î¼Àºí Áö½Ã¸í·É(Directive)ÀÌ´Ù.


2. ¾î¼Àºí Áö½Ã¸í·ÉÀÇ Á¾·ù

¿©·¯ °¡Áö°¡ ÀÖÁö¸¸, Å©°Ô ³ª´©¸é ´ÙÀ½ 5Á¾·ù·Î µÈ´Ù.

1. Contorol Directives
¾î¼Àºí¿¡ °¢Á¾ Á¶°ÇÀ» ÁöÁ¤Çϱâ À§ÇÑ ¸í·É

2. Data Directives
¸Þ¸ð¸® ¹èÄ¡³ª ½É¹ú¸íÀ» Á¤ÀÇÇÏ¿© ÂüÁ¶ÇÏ±â Æí¸®Çϵµ·Ï ÇÏ´Â ¸í·É

3. Listing Directives
¾î¼Àºí ¸®½ºÆ®ÀÇ Ãâ·Â ³»¿ëÀ» Áö½ÃÇÏ´Â ¸í·ÉÀ¸·Î ŸÀÌÆ² ºÎ°¡, °³Çà ÆäÀÌÁö Áö½Ã µîÀÌ ÀÖ´Ù.

4. Macro Directives
¸ÅÅ©·Î ¸í·ÉÀ» Á¤ÀÇÇϱâ À§ÇÑ ¸í·É

5. Object File Directives
¸±·ÎÄÉÀÌÅÍºí ¿ÀºêÁ§Æ®¸¦ Ãâ·ÂÇÒ ¶§¿¡ »ç¿ëÇÏ´Â ¸í·É

3. Directives À϶÷Ç¥

Directives·Î MPASM¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖÁö¸¸ ÀüüÀûÀ¸·Î´Â ¾Æ·¡ Ç¥¿Í °°ÀÌ µÇ¾î ÀÖ´Ù.
À̵é Áß¿¡¼­ ¼±ÅÃÇÏ¿© »ç¿ëÇÑ´Ù.

Ç¥ ÁßÀÇ ±ÔÄ¢Àº ´ÙÀ½°ú °°´Ù
    °¢°ýÈ£([])       :»ý·« °¡´ÉÇÑ ¿É¼Ç
    ¿­¼è°ýÈ£(<>)  :ºÎ°¡ ¿É¼Ç
    ÆÄÀÌÇÁ(|)        :¾î´À °ÍÀΰ¡¸¦ ¼±ÅÃ


Directive

Description

Syntax

BADRAM

Specify invalid RAM locations

__badram <expr>

BANKISEL

Genrate RAM bank selecting code for indirect addressing

bankisel <label>

BANKSEL

Generate RAM bank Selecting code

banksel <label>

CBLOCK

Define a Block of Constants

cblock [<expr>]

CODE

Begins executable code section

[<name>] code [<address>]

__CONFIG

Specify configuration bits

__config <expr>

CONSTANT

Declare Symbol Constant

constant <label>[=<expr>,...,<label>[=<expr>]]

DATA

Create Numeric and Text Data

[<label>] data <expr>,[,<expr>,...,<expr>]
[<label>] data "<text_string>"[,"<text_string>",...]

DB

Declare Data of One Byte

[<label>] db <expr>[,<expr>,...,<expr>]
[<label>] db "<text_string>"[,"<text_string>",...]

DE

Define EEPROM Data

[<label>] de <expr>[,<expr>,...,<expr>]
[<label>] de "<text_string>"[,"<text_string>",...]

#DEFlNE

Define a Text Substitution Label

define <name>[<value>]
define <name>[<arg>,...,<arg>]<value>

DT

Define Table

[<label>] dt <expr>[,<expr>,...,<expr>]
[<label>] dt "<text_string>"[,"<text_string>",...]

DW

Declare Data of One Word

[<label>] dw <expr>[,<expr>,...,<expr>]
[<label>] dw "<text_string>"[,"<text_string>",...]

ELSE

Begin Alternative Assembly Block to lF

else

END

End Program Block

end

ENDC

End an Automatic Constant Block

endc

ENDlF

End conditional Assembly Block

endif

ENDM

End a Macro Definition

endm

ENDW

End a While Loop

endw

EQU

Define an Assembly Constant

<label> equ <expr>

ERROR

lssue an Error Message

expr "<text_string>"

ERRORLEVEL

Set Error Level

errorlevel 0|1|2|<+|-><message number>

EXITM

Exit from a Macro

exitm

EXPAND

Expand Macro Listing

expand

EXTERN

Declares an extenal label

extern <label>[,<label>]

FlLL

Fill Memory

[<label>] fill <expr>,<count>

GLOBAL

Export a defined label

global <label>[,<label>]

IDATA

Begins initialized data section

[<name>] idata [<address>]

__IDLOCS

Specify ID locations

__idlocs <expr>

IF

Begin Conditionally Assembled Code Block

if <expr>

IFDEF

Execute if Symbol has Been Defined

ifdef <label>

IFNDEF

Execute if Symbol has not Been Defined

ifndef <label>

#INCLUDE

include Additional Source File

include <<include_file>>|"<include_file>"

LIST

Listing Options

list [<list_option>,...,<list_option>]

LOCAL

Declare Local Macro Variable

local <label>[,<label>]

MACRO

Declare Macro Definition

<label> macro [<arg>,...,<arg>]

__MAXRAM

Specify maximum RAM address

__maxram <expr>

MESSG

Create User Defined Message

messg <message_text>""

NOEXPAND

Turn off Macro Expansion

noexpand

NOLIST

Turn off Listing Output

nolist

ORG

Set Program Orgin

<label> org <expr>

PAGE

lnsert Listing Page Eject

page

PAGESEL

Generate ROM page selecting code

pagesel <label>

PROCESSOR

Set Processor Type

processor <processor_type>

RADIX

Specify Default Radix

radix <default_radix>

RES

Reserve Memory

[<label>] res <mem_units>

SET

Define an Assembler Variable

<label> set <expr>

SPACE

lnsert Blank Listing Lines

space <expr>

SUBTlTLE

Specify Program Subtitle

subtitle "<sub_text>"

TlTLE

Specify Program Title

title "<title_text>"

UDATA

Begins uninitialized data section

[<name>] udata [<address>]

UDATA_OVR

Begins 0verlayed uninitialized data section

[<name>] udata_ovr [<address>]

UDATA_SHR

Begins Shared uninitialized data Section

[<name>] udata_shr [<address>]

#UNDEFlNE

Delete a Substitution Label

#undefine <label>

VARlABLE

Declare Symbol Variable

variable <label>[=<expr>,...,<label>[=<expr>]]

WHlLE

Perform Loop While Condition is True

while <expr>


      ´ÙÀ½ ÆäÀÌÁö·Î      ¸ñÂ÷ ÆäÀÌÁö·Î