6502 microprocessor for input and output

[88] From now on, however, we are on somewhat shakier ground. There are many different devices that may be attached to the 6502 microprocessor for input and output. The specific sequence of instructions required to transmit information even to so seemingly standard a device as the video display may vary drastically from one computer to the next. Thus, it is impossible for us to lay down absolute rules as to how input and output are performed on your computer. Fortunately, there may already be a program built into your computer-or available on a floppy disk-that can help us circumvent the differences between various computers. This program is called an operating system. Almost every computer has an operating system available, though you might not even be aware of it. In the Commodore computers, for instance, the operating system is called the Kernal. It is built into the computer, in read-only memory (ROM), between addresses $EOOO and $FFFF. Similarly, the Atari computers have an operating system called, simply, the as. It is also in ROM and resides between memory addresses $0800 and $FFFF. The operating system contains built-in subroutines for most of the types of input and output you will want to perform. You may call these subroutines with a JSR instruction, just as though they were part of your program. We are not going to go into detail about all the subroutines offered by your operating system. The manual that came with your computer-or the technical manual that should be available, on request, from the computer’s manufacturer-contains this information. In this book we will concentrate on two specific kinds of operating system routines: those that output ASCII characters to the video display and those that input ASCII characters from the keyboard. Every operating system contains a subroutine to output an ASCII character to the video display. We will use the routine from the Commodore Kernal to demonstrate how Operating system-A series of machine-language subroutines within the internal memory of a computer that can be used for the input and output of data.

get the whole pdf for a few digibyte