8051
AVR
EZLab
PIC
80C196KC
DSP
ARM
VHDL
ũθ콺
κ౸
Battle κ
κȸ
޸շκ
Embeded Linux
HW/SW
RTOS
 
 


2. 196

 

II. 196 Assember

II-II. 196

ð Ѵ 196 ɿ зغ .

: ̵

: (addition, subtraction, multiplication, division)

shift : shift

branch : Ϲ б(jump) (compare), б⿡

Stack subroutine system : subroutine call, return, stack , system

II-II-1.

ϴ ũ⿡ byte, word, double word з ִ. (addressing mode) register direct addressing mode, immediate addressing mode, indirect addressing mode, indirect addressing mode with auto increment ִµ, ̴ ۿ ƴ϶ ɵ鿡 ǹǷ Ȯ ˾Ƶξ Ѵ.

̹ , .

<mnemonic> < 1 operand>, < 2 operand>, < 3 operand>

ex) LDB 0F0H, 30H

ɿ 1 operand 2 operand Ѵ.

.

 

mnemonic

byte

state

flagS

76543210

2 operand

1 operand

LD

2+BEA

4+CEA

101000aa

waop

wreg

Z N C V VT ST

LDB

2+BEA

4+CEA

101100aa

boap

breg


ST

2+BEA

4+CEA

110000aa

waop

wreg


STB

2+BEA

4+CEA

110001aa

baop

breg


XCH

3

5+CEA

00000100

waop

wreg


XCHB

3

5+CEA

00010100

baop

breg


LDBSE

2+BEA

4+CEA

101111aa

waop

wreg


LDBZE

2+BEA

4+CEA

101011aa

baop

breg


BMOVI

3

7+8/word

11001101

waop

lreg


 

aa ǹ operand ǹ

 

aa

addressing mode

00

register direct

01

immediate

10

indirect

11

indexed

 

wreg

register file word register

waop

addressing mode Ǵ word operand

breg

register file byte register

baop

addressing mode Ǵ byte operand

lreg

register file long register

BEA

addressing mode ʿ byte

CEA

addressing mode ʿ state

 

* breg, wreg, lreg ϴ boap , wreg ¦, lreg 4 address Ǿ߸ Ѵ.

:

06H

05H

04H

03H

02H

01H

00H

 

table LD(Load Data) 2 operand 1 operand ϴ ̴. ڿ B byte ǹѴ. ST(STore) ݴ ̴. ڿ ϱ ϰ, ɿ ؼ ˾ƺ (addressing mode) ؼ ˾ƺ .

II-II-1-1 data

(1) Byte I

LDB < 1 operand>, < 2 operand>

1 operand byte register, 2 operand byte register Ǵ ؼ Ǵ memory̴.

Ǵ 1 operand ݵ 80196KC register file̾ Ѵ.

(2) Byte II

STB < 1 operand>, < 2 operand>

1 operand byte register, 2 operand byte register Ȥ Ǵ memory̴.

STB 1 operand ݵ register file̾ Ѵ.

(3) Word I

LD < 1 operand>, < 2 operand>

1 operand word register, 2 operand word register Ȥ Ǵ memory̴.

1 operand register file̾ Ѵ.

(4) Word II

ST < 1 operand>, < 2 operand>

1 operand word register, 2 operand word register Ȥ Ǵ memory̴.

1 operand register file̾ Ѵ.

ֵ 196 ٸ CPUʹ ޸ ۿ 1 operand register file memory . CPU ܺ memory accessϱ ؼ Ư register ϰų accumulatorؾ Ѵ. ̴ 196 RALU ̶ ̴. ʹ 196 ˾ƺ.

II-II-1-2 (addressing mode)

(1) (register direct addressing mode)

register register data access ȴ.

ex) LDB 50H, 60H ; 60H byte register 50H byte register Ѵ.

LDB 41H, 0E0H ; 0E0H byte register 41H byte register Ѵ.

STB 77H, 88H ; 77H byte register 88H byte register Ѵ.

LD 50H, 64H ; 64H word regiser 50H word register Ѵ.

ST 0A0H,86H ; 0A0H word register 86H word register Ѵ.

note

ߴ ó word , operand ݵ word register address Ǿ Ѵ. , ¦ ִ. error ȴ.

LD 51H, 60H

ST 6AH, 7FH

׷ byte  address .

(2) immediate

ɾ data ԵǾ ִ addressing register ϴ data ְ ִ. ⿡ Ǵ data տ # ؼ address(variable name) Ѵ.

ex) LDB 81H, #50H ; byte register 81H data 50H ȴ.

LD 4AH, #1024 ; word register 4AH 1024 ȴ.

LDB 0BBH, #'a' ; byte register 0BBH 'a' ASCII code ȴ.

note 1

Ͱ word register Ǵ , ȴ. memory(register file) Ʒ .

              LD 50H, #1234H

              (  )

52H

:


51H

??

byte

50H

??

byte

4FH

:


 

; word register 50H data 1234H Ѵ.

              (   )

52H

:


51H

12H

byte

50H

34H

byte

4FH

:


 

note 2

immediate addressing mode STB, ST . error ȴ.

STB #14, 50H

(3) (indirect addressing mode)

register pointerμ Ѵ. , register memory address ȴ. [ ] ̿Ͽ pointer ǰ Ÿ. [ ] register ݵ word register Ǿ Ѵ( ¦ address register Ǿ Ѵ.). 0000H~0FFFFH memory access ϱ ּҷ DZ ̴.

                         ex) LDB 53H, [60H]

                           (  )

 

ּ

:


61H

56H

byte

60H

33H

byte

:

:


:

:


53H

00H


52H

:


ּ


:


5635H

33H

5634H

22H

5633H

11H

:


:


; word register 60H Ű memory byte register 53H

; Ѵ.

                        (  )

ּ

:


61H

56H

byte

60H

33H

byte

:

:


:

:


53H

11H


52H

:


ּ


:


5635H

33H

5634H

22H

5633H

11H

:


:


                           LD 60H, [70H]

                          (  )

 

ּ

:


71H

56H

high byte

70H

34H

low byte

:

:


:

:


61H

00H

high byte

60H

00H

low byte

5FH

:


ּ


:


5636H

44H

5635H

33H

5634H

22H

5633H

11H

:




word register 70H Ű memory word register

; 60H Ѵ.

                           (  )

ּ

:


61H

56H

high byte

60H

34H

low byte

:

:


:

:


61H

33H

high byte

60H

22H

low byte

5FH

:


ּ


:


5636H

44H

5635H

33H

5634H

22H

5633H

11H

:


:

:

STB 53H, [80H] ; byte register 53H word register 80H Ű memory

; Ѵ.

                           ST 54H, [90H]

                           (  )

ּ

:


91H

00H

high byte

90H

20H

low byte

:

:


:

:


55H

81H

high byte

54H

17H

low byte

53H

:


ּ


:


22H

00H

21H

00H

20H

00H

1FH

00H

:




 ; word register 54H word register 90H Ű

; memory Ѵ.

                         (  )

ּ

:


91H

00H

high byte

90H

20H

low byte

:

:


:

:


55H

81H

high byte

54H

17H

low byte

53H

:


ּ


:


22H

00H

21H

81H

20H

17H

1FH

00H

:


:

:

note 1

ռ , [ ] register ݵ word address register Ǿ Ѵ. , ¦ address Ǿ Ѵ. error.

LD 50H, [51H]

STB 59H, [5BH]

note 2

1 operand . 1 operand ݵ register file address ִ. error̴.

LDB [50H], 70H

ST [4EH], 54H

(4) ڵ (auto increment) ִ

ϴ. ׷, register byte +1, word +2ŭ Ų. ̴ increment ȥ , Ư ϰ ִ. (ex. search, block copy, block fill...) [ ]ڿ + ٿ [ ]+ Ÿ.

                        ex) LD 72H, [62H]+

                           (  )

ּ

:


63H

96H

high byte

62H

24H

low byte

:

:


:

:


73H

81H

high byte

72H

17H

low byte

71H

:



ּ



:

:


9627H

55H


9626H

44H


9625H

33H

>

9624H

22H


9623H

11H


:

:

; 62H Ű memory 72H (word) 62H

; +2ŭ Ų.

                             (  )

ּ

:


63H

96H

high byte

62H

26H

low byte

:

:


:

:


73H

33H

high byte

72H

22H

low byte

71H

:



ּ



:

:


9627H

55H

>

9626H

44H


9625H

33H


9624H

22H


9623H

11H


:

:

LDB 77H, [62H]+ ; 62H Ű memory 77H (byte) 62H

; +1 ŭ Ų.

ST 88H, [90H]+ ; 88H (word) 90H Ű memory 90H

; +2 ŭ Ų.

                          STB 31H, [60H]+

                            (  )

ּ

:


61H

84H

high byte

60H

20H

low byte

:

:


:

:


32H

00H

high byte

31H

FFH

low byte

30H

:



ּ



:

:


8423H

55H


8422H

44H


8421H

33H

>

8420H

22H


841FH

11H


:

:

; 31H (byte) 60H Ű memory 60H

; +1 ŭ Ų.

                             (  )

ּ

:


61H

84H

high byte

60H

21H

low byte

:

:


:

:


32H

00H

high byte

31H

FFH

low byte

30H

:



ּ



:

:


8423H

55H


8422H

44H

>

8421H

33H


8420H

FFH


841FH

11H


:

:

ڵ ϸ inc ʾƵ ǹǷ α׷ ϰ ۼ ִ. ޸ 8000H~9000H 11H ä ʹٸ α׷ϸ ȴ.

LD 60H, #8000H

LDB 50H, #11H

LOOP: STB 50H, [60H]+

CMP 60H, #9000H

JNE LOOP

END



 

ȣ : () κ ڵϹȣ:214-86-56219 ǸžŰ19-2544 ǥ: Ŵ뼷 ȭ:(02)2679-8556 Fax :(02)2679-8557
: ⵵ õ ̱ 뵿 õ ũũ 401 502ȣ     繫 : 4 8-1 4
Copyright(C) 2004, () κ ý All Rights Reserved E-Mail : WebMaster