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
ë°±ê³¼ì‚¬ì „)
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
8bit CPU ì—�서 6502를 예로 ë“¤ê² ìŠµë‹ˆë‹¤.
6502 는 16bit addressingì�´ 가능한 CPU 였습니다. 즉, $0000 ~ $FFFF ì˜€ì£ .
6502 는 13가지 메모리 access 방�� 있었는�, 그중 하나가 zero page addressing 입니다.
주소 ì˜�ì—ì�„ 8bit ë§Œ 사용, ìƒ�위 8bit ì�€ 00 으로 ê°€ì •í•˜ê³ addressing ì�„ 하면
$0000~$00FF ê°€ ë�©ë‹ˆë‹¤. ì�´ë ‡ê²Œ ì£¼ì†Œì§€ì • ì�„ 해서 ë�” ë¹ ë¥¸ access ê°€ ê°€ëŠ¥í–ˆë‹¤ê³ í•©ë‹ˆë‹¤.
ì�´ 메모리 주소 ì˜�ì—ì�„ zero page ë�¼ê³ 하는군요.
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으로 ê°€ì •í•˜ê³ ë‹¨ì§€ ë‘�번째 ë°”ì�´íŠ¸ë§Œ ê°€ì ¸ì˜´ìœ¼ë¡œì„œ, ì§§ì�€ 코드와 ì§§ì�€ 수행시간ì�„ ê°€ì ¸ë‹¤ì¤€ë‹¤. 주ì�˜ 깊게 ì œë¡œíŽ˜ì�´ì§€ ëª…ë ¹ì�„ 사용하는 것ì�€ 코드 효율ì—� 확실한 ê°œì„ ì�„ 가능케 한다.)
--혀뉘
ë� 한마디로 컴공과 아니 ì „êµì �으로(세계ì �ì�€ 너무 í�°ê°€ -_-) 탑ì—� 들ìž�는 ì�˜ë¯¸ê°€ ì•„ë‹�까?X
{{|
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ë§Œí�¼ì�˜ 범위를 갖는다)
ì�¼ì°Œê¸° PDP-8ì�„ í�¬í•¨í•œ 컴퓨터ì—�서 ì œë¡œíŽ˜ì�´ì§€ë�¼ëŠ” 것ì�€ 특별히 ë¹ ë¥¸ 메모리 ì–´ë“œë ˆì‹± 모드를 갖는다.
ì�´ëŠ” ë�°ì�´í„°ë¥¼ 임시로 ì €ìž¥í•˜ëŠ”ë�°ì—� 사용하기 ìš©ì�´í•˜ê³ 당시 CPUì�˜ ì �ì�€ ë ˆì§€ìŠ¤í„°ì�˜ ì–‘ì�„ ë³´ì™„í•˜ë ¤ëŠ” 것ì�´ì—ˆë‹¤.
1980년대ì—�는 컴퓨터 사용ìž�들ì�´ 아마 ìƒ�ìƒ�ë�„ í• ìˆ˜ì—†ì�„ ë§Œí�¼ 1970년대ì�˜ CPU ë§Œí�¼ ë¹ ë¥´ê³ ê·¸ 보다 ë�”ë¹ ë¥¸ 메로리가 사용었다. 그러면서 대용품으로 ë©”ì�¸ 메로리를 ì‚¬ìš©í•˜ê³ ì•„ì£¼ ì �ì�€ ì–‘ì�˜ ë ˆì§€ìŠ¤í„°ë¥¼ 갖는 것ì�´ ì�´ì¹˜ì—� 합당했다. 16비트 버스를 갖는 컴퓨터ì�˜ ì œë¡œíŽ˜ì�´ì§€ ë‚´ì�˜ ê°� 메모리가 아마ë�„ 한 ë°”ì�´íŠ¸ë¡œ ì–´ë“œë ˆì‹±ë�˜ê¸° 때문ì—� ì œë¡œíŽ˜ì�´ì§€ë‚´ì�˜ 메모리가 아닌 곳보다 ì œë¡œíŽ˜ì�´ì§€ë‚´ì�˜ 메모리를 ì ‘ê·¼í•˜ëŠ”ë�°, 8비트 ë�°ì�´í„° 버스를 갖는 ë¨¸ì‹ ì—�서보다 ë�”ìš± 빨ëž�었다.
예를 들ìž�ë©´ the MOS Technology 6502 는 오ì§� 6ê°œì�˜ non-general 목ì �ì�„ 가진 ë ˆì§€ìŠ¤í„°ë¥¼ ê°€ì§€ê³ ìžˆì—ˆë‹¤. ê²°ê³¼ì �으로 ì�´ëŠ” 것ì�€ ì œë¡œíŽ˜ì�´ì§€ë�¼ëŠ” ê°œë…�ì�„ í�넓게 사용하였다. ë§Žì�€ ëª…ë ¹ì–´ë“¤ì�´ ì œë¡œíŽ˜ì�´ì§€ì™€ ì œë¡œíŽ˜ì�´ì§€ê°€ 아닌 ì–´ë“œë ˆì”½ì�„ 위해서 다르게 쓰여졌다.
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ë°”ì�´íЏì�˜ 길ì�´ê°€ ë�˜ëŠ” 것ì�´ 가능하다.
ICí…Œí�¬ë†€ë¡œì§€ì�˜ ë°œì „ì�´ ë�”ìš± ì �ì�€ 비용으로 CPUì�˜ ë ˆì§€ìŠ¤í„°ë¥¼ 늘리게 ë�˜ì—ˆê³ ì�´ì—�ë”°ë�¼ì„œ RAMì�„ 액세스하는 것 보다 ë�”ìš± ë¹ ë¥¸ CPUëª…ë ¹ì–´ë¥¼ 처리하게 ë�˜ì—ˆê¸° 때문ì—� ì œë¡œíŽ˜ì�´ì§€ëŠ” ì�´ì œ 대개는 ì—시ì �ì�¸ ì�˜ë¯¸ë¥¼ 갖는다. 그럼ì—�ë�„ ë¶ˆêµ¬í•˜ê³ , ì–´ë–¤ 컴퓨터 아키í…�처는 ì—¬ì „ížˆ 다른 목ì �ì�„ 위해서 ì œë¡œíŽ˜ì�´ì§€ë�¼ëŠ” ê°œë…�ì�„ ì œê³µí•˜ê¸°ëŠ” 한다; 예를 들ìž�ë©´ ì�¸í…”ì�˜ x86ì�€ ì�¸í„°ëŸ½íЏ í…Œì�´ë¸”ì�˜ 사용ì�„ 위해서 512워드ì�˜ 공간ì�„ 사용한다.
|}}









