E D R , A S I H C RSS

기술적인의미에서의Zero Page

extracted from ZeroPage

인터넷 돌아다니며 찾아왔습니다.
8bit CPU 에서 6502를 예로 들겠습니다.
6502 는 16bit addressing이 가능한 CPU 였습니다. 즉, $0000 ~ $FFFF 였죠.
6502 는 13가지 메모리 access 방식이 있었는데, 그중 하나가 zero page addressing 입니다.
주소 영역을 8bit 만 사용, 상위 8bit 은 00 으로 가정하고 addressing 을 하면
$0000~$00FF 가 됩니다. 이렇게 주소지정 을 해서 더 빠른 access 가 가능했다고 합니다.
이 메모리 주소 영역을 zero page 라고 하는군요.

다음은 참조한 문서입니다.

The zero page instructions allow for shorter code and excution times by only feching the
second byte of the instruction and assumming a zero high address byte.
Careful use of the zero page can result in significant increase in code efficient.
(제로페이지 명령어들은 명령어의 첫번째 주소 바이트를 0으로 가정하고 단지 두번째 바이트만 가져옴으로서, 짧은 코드와 짧은 수행시간을 가져다준다. 주의 깊게 제로페이지 명령을 사용하는 것은 코드 효율에 확실한 개선을 가능케 한다.)

발췌 : http://www.6502.org/datasheets/csg6500.pdf
뭐 한마디로 컴공과 아니 전국적으로(세계적은 너무 큰가 -_-) 탑에 들자는 의미가 아닐까?

X

ZeroPage 그래픽 기법이라는 것과도 연관이 있는 건 아닐까요. 『해커, 그 광기와 비밀의 기록』에서 나오더군요.--Leonardong

백과사전) WikiPedia:Zero_page
{{|
The zero page is the memory address page at the absolute beginning of a computer's address space (the lowermost page, covered by the memory address range 0 ... page size1).
제로페이지는 컴퓨터 메로리 공간상의 가장 처음에 존재하는 메모리 주소 페이지이다. (가장 아래에 존재하는 페이지로서 메포리 번지 0부터 전체 페이지 사이즈의 -1만큼의 범위를 갖는다)

In early computers, including the PDP-8, the zero page had a special fast addressing mode, which facilitated its use for temporary storage of data and compensated for the relative shortage of CPU registers. The PDP-8 had only one register, so zero page addressing was essential.
일찌기 PDP-8을 포함한 컴퓨터에서 제로페이지라는 것은 특별히 빠른 메모리 어드레싱 모드를 갖는다.
이는 데이터를 임시로 저장하는데에 사용하기 용이하고 당시 CPU의 적은 레지스터의 양을 보완하려는 것이었다.

Possibly unimaginable by computer users after the 1980s, the RAM of a computer used to be faster than or as fast as the CPU during the 1970s. Thus it made sense to have few registers and use the main memory as substitutes. Since each memory location within the zero page of a 16-bit address bus computer may be addressed by a single byte, it was faster, in 8-bit data bus machines, to access such a location rather than a non-zero page one.
1980년대에는 컴퓨터 사용자들이 아마 상상도 할수없을 만큼 1970년대의 CPU 만큼 빠르고 그 보다 더빠른 메로리가 사용었다. 그러면서 대용품으로 메인 메로리를 사용하고 아주 적은 양의 레지스터를 갖는 것이 이치에 합당했다. 16비트 버스를 갖는 컴퓨터의 제로페이지 내의 각 메모리가 아마도 한 바이트로 어드레싱되기 때문에 제로페이지내의 메모리가 아닌 곳보다 제로페이지내의 메모리를 접근하는데, 8비트 데이터 버스를 갖는 머신에서보다 더욱 빨랐었다.

For example, the MOS Technology 6502 has only six non-general purpose registers. As a result, it used the zero page extensively. Many instructions are coded differently for zero page and non-zero page addresses:
예를 들자면 the MOS Technology 6502 는 오직 6개의 non-general 목적을 가진 레지스터를 가지고 있었다. 결과적으로 이는 것은 제로페이지라는 개념을 폭넓게 사용하였다. 많은 명령어들이 제로페이지와 제로페이지가 아닌 어드레씽을 위해서 다르게 쓰여졌다.

LDA $00 ; zero page
LDA $0000 ; non-zero page
The above two instructions both do the same thing; they load the value of $00 into the A register. However, the first instruction is only two bytes long and also faster than the second instruction. Unlike today's RISC processors, the 6502's instructions can be from one byte to three bytes long.
상기의 2개의 명령어 모두 동일한 일을 한다; 이것들은 A레지스터에 $00라는 값을 로드한다. 하지만 첫번째 명령어는 단지 2바이트길이 이고 두번째 명령어보다 더욱 빠르다. 오늘날의 RISC 프로세서와 다르게 the 6502의 명령어들은 1바이트에서 부터 3바이트의 길이가 되는 것이 가능하다.

Zero page addressing now has mostly historical significance, since the developments in integrated circuit technology have made adding more registers to a CPU less expensive, and have made CPU operations much faster than RAM accesses. Some computer architectures still reserve the beginning of address space for other purposes, though; for instance, the Intel x86 systems reserve the first 512 words of address space for the interrupt table.
IC테크놀로지의 발전이 더욱 적은 비용으로 CPU의 레지스터를 늘리게 되었고 이에따라서 RAM을 액세스하는 것 보다 더욱 빠른 CPU명령어를 처리하게 되었기 때문에 제로페이지는 이제 대개는 역시적인 의미를 갖는다. 그럼에도 불구하고, 어떤 컴퓨터 아키텍처는 여전히 다른 목적을 위해서 제로페이지라는 개념을 제공하기는 한다; 예를 들자면 인텔의 x86은 인터럽트 테이블의 사용을 위해서 512워드의 공간을 사용한다.
|}}

http://lxr.linux.no/source/Documentation/i386/zero-page.txt
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:47
Processing time 0.0254 sec