51 단편기 어셈블러 - 차트

575 단어 단편기
;  MOVCA,@A+PC           ,
;   30H~31H         40H~49H  ,
;30H~39H       1,3,5,7,9,2,4,6,8,10.
	org 0000h
	mov 30h, #1
	mov 31h, #2
	mov 32h, #3
	mov 33h, #4
	mov 34h, #5
	mov 35h, #6
	mov 36h, #7
	mov 37h, #8
	mov 38h, #9
	mov 39h, #10
	call SQRT
	sjmp $
;           。
SQRT:
	MOV R0, #30H
	MOV R1, #40H
	MOV R2, #10
LOOP:
	MOV A, @R0	 ;1 byte
	ADD A, #S_TAB - ($ + 4)	 ;2byte
	MOVC A, @A + PC		  ;1byte
	MOV @R1, A	 ;1byte
	INC R0	   ;1byte
	INC R1	   ;1byte
	DJNZ R2, LOOP ;2byte
	RET	;1byte
S_TAB:
DB 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
end

좋은 웹페이지 즐겨찾기