27.01.2015 Views

titus-larsen-titus-1981-apple-interfacing

titus-larsen-titus-1981-apple-interfacing

titus-larsen-titus-1981-apple-interfacing

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IR.,view<br />

At this point, you should understand that the 6502 transfers and<br />

operates on eight bits of data at a time. Complex calculations and<br />

operations often require multiple groups of eight bits or bytes. The<br />

bytes are transferred to and from the 6502 CPU on an 8-bit bus.<br />

DATA iii.IS D7-DO An 8-bit bidirectional set of lines for transfer of<br />

information beiween the CPU and I/ 0 devices.<br />

A15-A8<br />

A7-AO<br />

Al1.)DR&:!iS i'IUS A15-AO A 16-bit unidirectional address bus used to address<br />

both memory and 1/0 devices.<br />

HI address bus, most-sig nifkan1 eight address<br />

bits.<br />

LO address bus, least-significant eight address<br />

bits.<br />

cmn11.o !ilGNAi R/W Read/write control signal.<br />

NOTES: The "bar" notation, i.e., W, indicates a iogic zero is the "'active°' state, the state that<br />

causes the corresponding action to take place.<br />

In each case in which a signal is enumerated1 the numbers increase as the signiflcance of the<br />

bits increases, i.e., A 15 == most-significant address bit (MSB).<br />

The 6502 uses a 16-bit address bus to address individual memory<br />

location and I/ 0 devices. The address bus is frequently broken into<br />

a HI and LO address bus, of eight bits each. Th single control signal,<br />

R/W, controlls the flow of information to and from the 6502 CPU,<br />

The signals and their designations are noted in Table 1-1.<br />

C@mm@nd;;<br />

sonw P,RE ! I 0 CONTROIL ifi%]STRIJCT!OIMS<br />

The Apple computer has a number of instructions that are used to<br />

control I/0 devices. For the most part, though, these instructions are<br />

used to control specific I/0 devices or to perform functions.<br />

Without realizing it, you are already familiar some, if not all,<br />

of these I/ 0 instructions.<br />

Here are some specific examples of these I/ 0 control instructions,<br />

to refresh your memory.<br />

The INPUT and PRINT commands are probably familiar to<br />

The INPUT command causes a BASIC program to stop and wait<br />

an input from the keyboard. The PRINT command causes an answer<br />

or string of characters to be "printed" on the tv screen.<br />

10 INPUT "VALUE OF )( IS"; )(<br />

20 PRINT " INPUT VALUE WAS"; X<br />

bampie 1-1. A Simpie l{O '"'!!l'"'<br />

15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!