Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_24.ADF » F/BYTES1

F/BYTES1

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_24.ADF
Filename: F/BYTES1
Read OK:
File size: 043A bytes
Load address: 42204556
Exec address: 53455459
File contents

! Secrets...6 BYTES OF MEMORY

On startup the 6502A reads the address stored at &FFFF &FFFE which it uses
to point to the address to be jumped to in the event of an IRQ. As it is
in ROM it is fixed by the operating system and so can be read ready for
disassembly.

Next it reads the address at &FFFA &FFFB which is the address to jump to
in the event of an NMI in a similar manner to above.

Thirdly it performs a JMP (&FFFC) which is defined as the address pointing
to the start of the operating system. This also varies from operating
system to operating system but for the 6502 series is ALWAYS at &FFFC.

The result of all this? The familiar(?) CALL !-4 from BASIC makes
sense. It resets the BBC by restarting the operating system. Any *KEY10s
will also work because as far as the OS is concerned the 6502's RST pins
has been taken low.

-4 in two's complement is FFFFFFFC and when using the BASIC CALL statement
the lower 2 bytes (of location FFFC) only are used by BASIC - hence reset 

"PRESS A KEY TO RESET":A=((?&FFFD*256)+?&FFFC)

or CALL !-4 for short

Robert Sprowson
00000000  0d 0d 21 20 53 65 63 72  65 74 73 2e 2e 2e 36 20  |..! Secrets...6 |
00000010  42 59 54 45 53 20 4f 46  20 4d 45 4d 4f 52 59 0d  |BYTES OF MEMORY.|
00000020  0d 4f 6e 20 73 74 61 72  74 75 70 20 74 68 65 20  |.On startup the |
00000030  36 35 30 32 41 20 72 65  61 64 73 20 74 68 65 20  |6502A reads the |
00000040  61 64 64 72 65 73 73 20  73 74 6f 72 65 64 20 61  |address stored a|
00000050  74 20 26 46 46 46 46 20  26 46 46 46 45 20 77 68  |t &FFFF &FFFE wh|
00000060  69 63 68 20 69 74 20 75  73 65 73 0d 74 6f 20 70  |ich it uses.to p|
00000070  6f 69 6e 74 20 74 6f 20  74 68 65 20 61 64 64 72  |oint to the addr|
00000080  65 73 73 20 74 6f 20 62  65 20 6a 75 6d 70 65 64  |ess to be jumped|
00000090  20 74 6f 20 69 6e 20 74  68 65 20 65 76 65 6e 74  | to in the event|
000000a0  20 6f 66 20 61 6e 20 49  52 51 2e 20 41 73 20 69  | of an IRQ. As i|
000000b0  74 20 69 73 0d 69 6e 20  52 4f 4d 20 69 74 20 69  |t is.in ROM it i|
000000c0  73 20 66 69 78 65 64 20  62 79 20 74 68 65 20 6f  |s fixed by the o|
000000d0  70 65 72 61 74 69 6e 67  20 73 79 73 74 65 6d 20  |perating system |
000000e0  61 6e 64 20 73 6f 20 63  61 6e 20 62 65 20 72 65  |and so can be re|
000000f0  61 64 20 72 65 61 64 79  20 66 6f 72 0d 64 69 73  |ad ready for.dis|
00000100  61 73 73 65 6d 62 6c 79  2e 0d 0d 4e 65 78 74 20  |assembly...Next |
00000110  69 74 20 72 65 61 64 73  20 74 68 65 20 61 64 64  |it reads the add|
00000120  72 65 73 73 20 61 74 20  26 46 46 46 41 20 26 46  |ress at &FFFA &F|
00000130  46 46 42 20 77 68 69 63  68 20 69 73 20 74 68 65  |FFB which is the|
00000140  20 61 64 64 72 65 73 73  20 74 6f 20 6a 75 6d 70  | address to jump|
00000150  20 74 6f 0d 69 6e 20 74  68 65 20 65 76 65 6e 74  | to.in the event|
00000160  20 6f 66 20 61 6e 20 4e  4d 49 20 69 6e 20 61 20  | of an NMI in a |
00000170  73 69 6d 69 6c 61 72 20  6d 61 6e 6e 65 72 20 74  |similar manner t|
00000180  6f 20 61 62 6f 76 65 2e  0d 0d 54 68 69 72 64 6c  |o above...Thirdl|
00000190  79 20 69 74 20 70 65 72  66 6f 72 6d 73 20 61 20  |y it performs a |
000001a0  4a 4d 50 20 28 26 46 46  46 43 29 20 77 68 69 63  |JMP (&FFFC) whic|
000001b0  68 20 69 73 20 64 65 66  69 6e 65 64 20 61 73 20  |h is defined as |
000001c0  74 68 65 20 61 64 64 72  65 73 73 20 70 6f 69 6e  |the address poin|
000001d0  74 69 6e 67 0d 74 6f 20  74 68 65 20 73 74 61 72  |ting.to the star|
000001e0  74 20 6f 66 20 74 68 65  20 6f 70 65 72 61 74 69  |t of the operati|
000001f0  6e 67 20 73 79 73 74 65  6d 2e 20 54 68 69 73 20  |ng system. This |
00000200  61 6c 73 6f 20 76 61 72  69 65 73 20 66 72 6f 6d  |also varies from|
00000210  20 6f 70 65 72 61 74 69  6e 67 0d 73 79 73 74 65  | operating.syste|
00000220  6d 20 74 6f 20 6f 70 65  72 61 74 69 6e 67 20 73  |m to operating s|
00000230  79 73 74 65 6d 20 62 75  74 20 66 6f 72 20 74 68  |ystem but for th|
00000240  65 20 36 35 30 32 20 73  65 72 69 65 73 20 69 73  |e 6502 series is|
00000250  20 41 4c 57 41 59 53 20  61 74 20 26 46 46 46 43  | ALWAYS at &FFFC|
00000260  2e 0d 0d 54 68 65 20 72  65 73 75 6c 74 20 6f 66  |...The result of|
00000270  20 61 6c 6c 20 74 68 69  73 3f 20 54 68 65 20 66  | all this? The f|
00000280  61 6d 69 6c 69 61 72 28  3f 29 20 43 41 4c 4c 20  |amiliar(?) CALL |
00000290  21 2d 34 20 66 72 6f 6d  20 42 41 53 49 43 20 6d  |!-4 from BASIC m|
000002a0  61 6b 65 73 0d 73 65 6e  73 65 2e 20 49 74 20 72  |akes.sense. It r|
000002b0  65 73 65 74 73 20 74 68  65 20 42 42 43 20 62 79  |esets the BBC by|
000002c0  20 72 65 73 74 61 72 74  69 6e 67 20 74 68 65 20  | restarting the |
000002d0  6f 70 65 72 61 74 69 6e  67 20 73 79 73 74 65 6d  |operating system|
000002e0  2e 20 41 6e 79 20 2a 4b  45 59 31 30 73 0d 77 69  |. Any *KEY10s.wi|
000002f0  6c 6c 20 61 6c 73 6f 20  77 6f 72 6b 20 62 65 63  |ll also work bec|
00000300  61 75 73 65 20 61 73 20  66 61 72 20 61 73 20 74  |ause as far as t|
00000310  68 65 20 4f 53 20 69 73  20 63 6f 6e 63 65 72 6e  |he OS is concern|
00000320  65 64 20 74 68 65 20 36  35 30 32 27 73 20 52 53  |ed the 6502's RS|
00000330  54 20 70 69 6e 73 0d 68  61 73 20 62 65 65 6e 20  |T pins.has been |
00000340  74 61 6b 65 6e 20 6c 6f  77 2e 0d 0d 2d 34 20 69  |taken low...-4 i|
00000350  6e 20 74 77 6f 27 73 20  63 6f 6d 70 6c 65 6d 65  |n two's compleme|
00000360  6e 74 20 69 73 20 46 46  46 46 46 46 46 43 20 61  |nt is FFFFFFFC a|
00000370  6e 64 20 77 68 65 6e 20  75 73 69 6e 67 20 74 68  |nd when using th|
00000380  65 20 42 41 53 49 43 20  43 41 4c 4c 20 73 74 61  |e BASIC CALL sta|
00000390  74 65 6d 65 6e 74 0d 74  68 65 20 6c 6f 77 65 72  |tement.the lower|
000003a0  20 32 20 62 79 74 65 73  20 28 6f 66 20 6c 6f 63  | 2 bytes (of loc|
000003b0  61 74 69 6f 6e 20 46 46  46 43 29 20 6f 6e 6c 79  |ation FFFC) only|
000003c0  20 61 72 65 20 75 73 65  64 20 62 79 20 42 41 53  | are used by BAS|
000003d0  49 43 20 2d 20 68 65 6e  63 65 20 72 65 73 65 74  |IC - hence reset|
000003e0  20 0d 0d 22 50 52 45 53  53 20 41 20 4b 45 59 20  | .."PRESS A KEY |
000003f0  54 4f 20 52 45 53 45 54  22 3a 41 3d 28 28 3f 26  |TO RESET":A=((?&|
00000400  46 46 46 44 2a 32 35 36  29 2b 3f 26 46 46 46 43  |FFFD*256)+?&FFFC|
00000410  29 0d 0d 6f 72 20 43 41  4c 4c 20 21 2d 34 20 66  |)..or CALL !-4 f|
00000420  6f 72 20 73 68 6f 72 74  0d 0d 52 6f 62 65 72 74  |or short..Robert|
00000430  20 53 70 72 6f 77 73 6f  6e 0d                    | Sprowson.|
0000043a
F/BYTES1.m0
F/BYTES1.m1
F/BYTES1.m2
F/BYTES1.m4
F/BYTES1.m5