Instructions ACALL LCALL RET MOVC INC JZ Department

  • Slides: 6
Download presentation
Instructions: ACALL, LCALL, RET, MOVC, INC, JZ Department of Computer Science and Information Engineering,

Instructions: ACALL, LCALL, RET, MOVC, INC, JZ Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資 系 Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也 道紀章(Chapter 14) 道無形象, 視之不可見者曰夷 Fuw-Yi Yang 1

Instructions: ACALL, RET ACALL 11 -bit Address; absolute call RET ; return from subroutine

Instructions: ACALL, RET ACALL 11 -bit Address; absolute call RET ; return from subroutine ORG 00 H MOV A, #0 FEH Top: MOV 80 H, A MOV R 0, #0 B 4 H L 2: MOV R 1, #0 FFH L 1: DJNZ R 1, L 1 DJNZ R 0, L 2 RR A SJMP Top END ORG 00 H MOV A, #0 FEH Top: MOV 80 H, A ACALL Delay 01 RR A SJMP Top Dealy 01: MOV R 0, #0 B 4 H L 2: MOV R 1, #0 FFH L 1: DJNZ R 1, L 1 DJNZ R 0, L 2 RET END Fuw-Yi Yang 2

Instructions: LCALL 16 -bit Address ; transfer control to a subroutine, long call ORG

Instructions: LCALL 16 -bit Address ; transfer control to a subroutine, long call ORG 00 H MOV A, #0 FEH Top: MOV 80 H, A MOV R 0, #0 B 4 H L 2: MOV R 1, #0 FFH L 1: DJNZ R 1, L 1 DJNZ R 0, L 2 RR A SJMP Top END ORG 00 H MOV A, #0 FEH Top: MOV 80 H, A LCALL Delay 01 RR A SJMP Top Dealy 01: MOV R 0, #0 B 4 H L 2: MOV R 1, #0 FFH L 1: DJNZ R 1, L 1 DJNZ R 0, L 2 RET END Fuw-Yi Yang 3

Instructions: MOV DPTR, #16 -bit value Example: MOV DPTR, #200 H; load data pointer

Instructions: MOV DPTR, #16 -bit value Example: MOV DPTR, #200 H; load data pointer Fuw-Yi Yang 4

Instructions: INC, JZ INC DPTR ; INC byte ; JZ target Example: INC A;

Instructions: INC, JZ INC DPTR ; INC byte ; JZ target Example: INC A; INC Rn; INC direct; INC 30 H INC @R 0; INC @R 1; indirect addresing INC DPTR JZ L 1; Fuw-Yi Yang 5

Instructions: MOVC A, @A+DPTR; index addressing Example: MOV DPTR, #200 H; load data pointer

Instructions: MOVC A, @A+DPTR; index addressing Example: MOV DPTR, #200 H; load data pointer L 1: CLR A ; clear A MOVC A, @A+DPTR ; move data at A+DPTR into A JZ Exit; exit if null character INC DPTR ; next byte SJMP L 1 Exit: ……… ORG 200 H Data: DB “this is an index addressing” ; Fuw-Yi Yang 6