The Machine Language Monitor
Most PET CBM computers have a simple MLM machine language monitor built in. It may be extended with extra commands. The Commodore PLUS 4 contains a very powerful MLM. The VIC-20 and Commodore 64 do not have a built-in MLM, but one can be added. Such a monitor may be either loaded into RAM or plugged in as a cartridge. Monitors may be purchased or obtained from user clubs. Most machine language monitors work in a similar way, and have about the same commands. To proceed, you'll need an MLM in...
No Address Implied Mode
Instructions such as I NX increment X , BRK break , and TflY transfer A to Y need no address they make no memory reference and are complete in themselves. Such instructions occupy one byte of memory. We might say that such instructions have no address. The precise term is implied address, which seems to say that there is in fact an address but we do not need to state it. Perhaps the word implied is used in this manner an instruction such as I NX implies the use of the address register and an...
Subroutines
We have written programs that are subroutines called by BASIC We have written subroutine calls to built-in operations such as FFD2 or FFE4. Can we also write our own subroutine and arrange to call it Of course we can. RTS return from subroutine does not mean return to BASIC. It means return to whoever called this routine If BASK, called up the machine language routine, RTS takes you back to BASIC. If another machine language program called up the subroutine, RTS will return to the calling...
Why Logical Operations
We use these three commands AND, ORA, and EOR to change or control individual bits within a byte of information. The commands are unusual in that each bit may be manipulated independently of the others. We don't seem to be working with numbers when we use these commands. Rather, we're working with each individual bit, turning it on or off as we wish. Why would we turn individual bits on or off There are several possible reasons. For example, we might wish to control external devices through the...
Interrupts NMI IRQ and BRK
We have mentioned the mechanical aspects of interrupt Now let's look at how to use the interrupt for simple jobs. The IRQ connects through a vector in RAM if we change the address within the vector, we will change the address to which the interrupt goes. The interrupt vector is located as follows. Most PET CBM - 91 decimal 144-145 VIC Commodore 64 D3K-D315 decimal 7AA-7AR Before we change this vector, we should realize something quite important the interrupt does a lot of work sixty times a...
Things You Have Learned Ilv
Flags are used to link instructions together. This might be an activity such as load or compare, followed by a test such as branch on a given condition Some instructions affect one or more flags, and some do not affect flags. Thus, an instruction that sets a flag might not be followed immediately with the instruction that tests or uses that flag There are four testable flags' Z zero, or equals C carry, or greater equal , N negative, or high bit , and V signed arithmetic overflow . The flags...