Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF

429 language in the BBC Microcomputer’s case. (The 6512 is a close relative of the 6502, and uses the same assembly language.) The assembly language statements which would generate the machine code statements shown above are: LDA #129 (=A9 81, ‘load the accumulator with &81 ) LDX #100 (=A2 64, ‘load the X register with &64’) LDY #0 (=A0 00, ‘load the Y register with zero’) JSR &FFF4 (=20 F4 FF, ‘jump to the subroutine at location &FFF4’) Clearly, an instruction like ‘LDX’ looks a lot more like ‘load the X register’ than ‘A2’ does. LDA, LDX, LDY and JSR are all known as ‘assembly code mnemonics’.

6502 assembly language has 56 mnemonics, some of which will be discussed in detail later in this chapter. Uses of assembly language BASIC is a very easy language to use; most of its statements look much like English, and it is very ‘friendly’, since it gives you helpful messages about mistakes that you may have made in your program. The price to be paid for this ‘friendliness’ is in memory usage and speed of execution. Assembly language is used where high speed is vital (such as in an arcade game) or where the minimum amount of memory must be used. BASIC is used where ease of programming is more important than either speed or memory usage.

The main features of 6502 assembly language It is not the purpose of this chapter to teach you how to program in assembly language; you are referred to the large number of books that have been published which are concerned with the BBC Microcomputer and how to program it. This chapter does, however, describe the most important features of assembly language. Below is an example of a simple hybrid BASIC/assembly language program, which you may have already seen in the previous chapter: 10 OSBYTE=&FFF4 20 P%=&3500 30 [ 40 LDA #129 50 LDX #100 60 LDY #0 70 JSR OSBYTE 80 RTS 90 ] 100 CALL &3500