PICÀÇ ¸í·É ±¸Á¶

[¸í·ÉÀÇ ±¸Á¶]

PICÀÇ ¸í·ÉÀº ´ÙÀ½ 4Á¾·ù·Î ´ëº°µÈ´Ù. ´ÙÀ½¿¡ °¢ ¸í·É¾îÀÇ ±¸Á¶¸¦ ¼³¸íÇÑ´Ù.
¹ÙÀÌÆ® ó¸® ¸í·É
ºñÆ® ó¸® ¸í·É
¸®ÅÍ·²(literal) ó¸® ¸í·É
Á¡ÇÁ ¸í·É
 

 (1) ¹ÙÀÌÆ® ó¸® ¸í·É



'¸í·É ÄÚµå': ¸ðµç ¸í·ÉÀ» ±¸º°Çϱâ À§ÇÑ °ÍÀ¸·Î ¸í·É¸¶´Ù ÇϳªÀÇ Äڵ尡 ´ëÀÀÇÏ°í ÀÖ´Ù.
f: file registerÀÇ ¾àÀÚ·Î ¸í·ÉÀÇ ´ë»óÀÌ µÇ´Â º¯¼ö ·¹Áö½ºÅÍÀÇ ¾îµå·¹½º¸¦ ÁöÁ¤ÇÑ´Ù.
ÀÌ f´Â 7ºñÆ®À̱⠶§¹®¿¡ ¾îµå·¹½º·Î¼­´Â 00ºÎÅÍ 7F·Î, 128°³±îÁö ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.
ÀÌ ·¹Áö½ºÅÍÀÇ ÁöÁ¤ ¹æ¹ý¿¡´Â ÇÁ·Î±×·¥ °¡¿îµ¥¼­ ¼³Á¤ÇÑ º¯¼öÀÇ ·¹À̺íÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù.

(¿¹)
INCF             COUNTER,F                (COUNTER°¡ º¯¼ö¸í)
MOVF           FLAG,W                      (FLAG°¡ º¯¼ö¸í)

d: desitination selectÀÇ ¾àÀÚÀ̸ç, ¸í·ÉÀÇ ½ÇÇà °á°ú¸¦ ¾îµð¿¡ ÀúÀåÇÒ °ÍÀΰ¡¸¦ ÁöÁ¤ÇÑ´Ù.
d=0ÀÏ ¶§´Â working register(Wreg)¿¡ ÀúÀå
d=1ÀÏ ¶§´Â f¿¡¼­ ÁöÁ¤µÇ¾î ÀÖ´Â file register¿¡ ÀúÀå
ÀÌ dÀÇ ¼­½ÄÀº W ¶Ç´Â F·Î ¾´´Ù.

(¿¹)
DECF            INTERVAL,F                 (f¸¦ F·Î ¾²¸é d=1)
RLF              POSITION,W                 (f¸¦ W·Î ¾²¸é d=0)
 

  (2) ºñÆ® ó¸® ¸í·É  



f: file registerÀÇ ¾àÀÚ·Î »ó±â¿Í ¿ÏÀüÈ÷ °°Àº °ÍÀÌ´Ù.
b: bit address¸¦ ³ªÅ¸³»´Â °ÍÀ¸·Î, 3ºñÆ®À̹ǷΠ0ºÎÅÍ 7±îÁö 8ºñÆ®¸¦ ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.
¿©±âÀÇ ¼­½Ä¿¡µµ ÇÁ·Î±×·¥À¸·Î ÁöÁ¤ÇÑ ·¹À̺íÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù.

(¿¹)
BTFSS          STATUS,Z                    (Z=2·Î ÁöÁ¤µÇ¾î ÀÖ´Ù)
BSF              PORTA,RA3                  (RA3=3À¸·Î ÁöÁ¤µÇ¾î ÀÖ´Ù)
 

  (3) ¸®ÅÍ·² °ü·Ã ¸í·É



k: LiteralÀÇ Àǹ̷Î, Á¤¼ö¸¦ Á÷Á¢ »ç¿ëÇÒ ¶§¿¡ ÁöÁ¤ÇÑ´Ù.
8ºñÆ®(1¹ÙÀÌÆ®)ÀÇ Á¤¼ö¸¦ ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù.
µû¶ó¼­ Åë»óÀûÀÎ 1¹ÙÀÌÆ® ¹®ÀÚ Äڵ带 Á÷Á¢ Ãë±ÞÇÒ ¼ö ÀÖ´Ù.

(¿¹)
MOVLW        'A'                               (¹®ÀÚ ÄÚµå(3A)¸¦ Wreg¿¡)
ADDLW         0FH                              (16Áø¼ö 0F¸¦ Wreg¿¡ °¡»ê)


  (4) Á¡ÇÁ ¸í·É



k: Address literalÀÌ µé¾î°£´Ù. 11ºñÆ®±îÁöÀÇ ¾îµå·¹½º¸¦ Á÷Á¢ ÁöÁ¤ÇÒ ¼ö ÀÖ°Ô µÈ´Ù.
µû¶ó¼­ ÃÖ´ë 2k¹ÙÀÌÆ®±îÁö »ç¿ëÇÒ ¼ö ÀÖ´Â °ÍÀÌ´Ù.
ÀϹÝÀûÀ¸·Î ÀÌ k¿¡´Â Á¡ÇÁóÀÇ ·¹À̺íÀ» ¾´´Ù.

(¿¹)
GOTO          LOOP                         (LOOP°¡ ·¹À̺í)
CALL           INPUT                         (INPUTÀÌ ·¹À̺í)

 


[STATUS REGISTER]

Status Register¶õ, °¢ ¸í·ÉÀÇ ½ÇÇà °á°ú°¡ ¹Ý¿µµÇ´Â Ç÷¡±×·ù°¡ ¸ð¿© ÀÖ´Â ·¹Áö½ºÅÍÀÌ´Ù.
³»¿ëÀº ¾Æ·§ ±×¸²°ú °°ÀÌ µÇ¾î ÀÖÀ¸¸ç, °¢°¢ÀÇ Àǹ̴ ´ÙÀ½°ú °°´Ù.


IRP

RP1

RP0

TO

PD

Z

DC

C


IRP: °£Á¢ ¾îµå·¹½º½Ã ·¹Áö½ºÅÍÀÇ Bank ¼±Åà Á¦¾î¿ë
       0: Bank0           (00-FF)
       1: Bnak1           (100-1FF)
                              (ÁÖ: PIC16F84¿¡¼­´Â »ç¿ëÇÏÁö ¾ÊÀ½)

RP0, RP1: Á÷Á¢ ¾îµå·¹½º½Ã ·¹Áö½ºÅÍÀÇ Bnak ¼±Åà Á¦¾î¿ë
       00: Bank0         (00-7F)
       01: Bank1         (80-FF)      °¢ BankÀº 128¹ÙÀÌÆ®¾¿
       10: Bank2         (100-17F)
       11: Bnak3         (180-1FF)
                              (ÁÖ: PIC16F84¿¡¼­´Â RP0¸¸ »ç¿ëÇÑ´Ù)

TO: ½Ã½ºÅÛ ³»ºÎÀÇ ±âµ¿ ŸÀ̸ÓÀÇ »óŸ¦ Ç¥½ÃÇÑ´Ù
        1: Àü¿ø ÅõÀÔÈÄ, CLRWDT ¸í·É, SLEEP ¸í·É ½ÇÇàÈÄ
        0: watchdog timer°¡ time upÇßÀ» ¶§

PD: Àü¿ø Àý´Ü Ç÷¡±×
        1: Àü¿ø ÅõÀÔÈÄ ¶Ç´Â CLRWDT ¸í·É ½ÇÇàÈÄ
        0: SLEEP ¸í·É ½ÇÇàÈÄ

Z: zero flag
        1: »ê¼ú, ³í¸®¿¬»ê ¸í·É ½ÇÇàÈÄ°¡ 0ÀÏ ¶§
        0: »ê¼ú, ³í¸®¿¬»ê ¸í·É ½ÇÇàÈÄ°¡ 0ÀÌ ¾Æ´Ò ¶§

DC: ÀÚ¸®ÀÇ carry flag
        (ADDWF, ADDLW, SUBWF, SUBLW ¸í·ÉÀ¸·Î »ç¿ë)
        1: ¸í·É ½ÇÇàÈÄ ÇÏÀ§ 4ºñÆ®°¡ overflow ÇßÀ» ¶§
        0: ¸í·É ½ÇÇàÈÄ ÇÏÀ§ 4ºñÆ®°¡ overflow ÇÏÁö ¾Ê¾ÒÀ» ¶§

C: carry flag
        1:»ê¼ú, ³í¸®¿¬»ê ¸í·É ½ÇÇàÈÄ 8ºñÆ®°¡ overflow ÇßÀ» ¶§
        0:»ê¼ú, ³í¸®¿¬»ê ¸í·É ½ÇÇàÈÄ overflow ÇÏÁö ¾Ê¾ÒÀ» ¶§


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