Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
본문으로 이동

MOS 6502

위키백과, 우리 모두의 백과사전.

MOS 6502
DIP-40에 있는 6502 칩. 4자리 날짜 코드는 1985년 45주차(11월) 생산을 의미함.
생산1975년(49년 전)(1975)
주요 제조사
최대 CPU 클럭 속도1 MHz ~ 3 MHz
명령어 집합MOS 6502
트랜지스터3,510[1], 3,218[2]
데이터 폭8비트
주소 폭16비트
이전 모델
후속 모델
패키지

MOS 6502모스 테크놀로지사의 8비트 MPU이다. 모토로라의 6809계열의 CPU로 분류되며 명칭 또한 인텔 계열이 CPU(중앙 처리 장치)라는 단어를 사용한 데 반해, 모토로라 계열은 MPU(Main Processing Unit)라는 용어를 사용한다.

프로세서 레지스터 개수가 인텔 계열의 CPU에 비해 적으나, 제로 페이지라는 메모리 에리어 중 특수한 영역을 임시 기억공간으로 활용하여 프로세서 레지스터 부족분을 메운다. 입출력을 위한 주소 공간이 별도로 준비되어 있지 않기 때문에 메인 메모리의 일정 부분을 입출력으로 사용하는 메모리 맵 입출력 방식으로 동작한다.

예제 코드

[편집]
; TOLOWER:
;
; Convert a null-terminated character string to all lower case.
; Maximum string length is 255 characters, plus the null term-
; inator.
;
; Parameters:
;
; SRC - Source string address
; DST - Destination string address
;
        ORG $0080
;
0080 00 04 SRC .WORD $0400 ;source string pointer ($40)
0082 00 05 DST .WORD $0500 ;destination string pointer ($42)
;
0600 ORG $0600 ;execution start address
;
0600 A0 00 TOLOWER LDY #$00 ;starting index
;
0602 B1 80 LOOP LDA (SRC),Y ;get from source string
0604 F0 11 BEQ DONE ;end of string
;
0606 C9 41 CMP #'A' ;if lower than UC alphabet...
0608 90 06 BCC SKIP ;copy unchanged
;
060A C9 5B CMP #'Z'+1 ;if greater than UC alphabet...
060C B0 02 BCS SKIP ;copy unchanged
;
060E 09 20 ORA #%00100000 ;convert to lower case
;
0610 91 82 SKIP STA (DST),Y ;store to destination string
0612 C8 INY ;bump index
0613 D0 ED BNE LOOP ;next character
;
; NOTE: If .Y wraps the destination string will be left in an undefined
; state. We set carry to indicate this to the calling function.
;
0615 38 SEC ;report string too long error &...
0616 60 RTS ;return to caller
;
0617 91 82 DONE STA (DST),Y ;terminate destination string
0618 18 CLC ;report conversion completed &...
0619 60 RTS ;return to caller
;
                       .END

각주

[편집]
  1. “The MOS 6502 and the Best Layout Guy in the World”. swtch.com. 2011년 1월 3일. 2014년 9월 8일에 원본 문서에서 보존된 문서. 2014년 8월 9일에 확인함. 
  2. “MOnSter6502 A complete, working discrete transistors (i.e. not integrated all on a single chip) replica of the classic MOS 6502 microprocessor”. monster6502.com. 2017. 2017년 5월 12일에 원본 문서에서 보존된 문서. 2017년 5월 1일에 확인함. 

같이 보기

[편집]
국제국가기타