Routine labels - easy mode

Easy ways to find some routine labels

The subroutine loop

There are a couple of places to get easy routine labels. The first is at the beginning of the code. Let's have a look:

...
C224                                 .fill   3291, $FF
CEFF             codeStart           .org    $ceff
CEFF 7E D0 3E                        jmp     reset
CF02             empty2              .fill   254, $FF
D000 02 03 06 07 obdTable            .byte   $02, $03, $06, $07
D004 16 2F 8A CB                     .byte   $16, $2f, $8a, $cb
D008 44 ED 46 EE                     .byte   $44, $ed, $46, $ee
D00C 40 41 42 40                     .byte   $40, $41, $42, $40
D010 D3 D4 CF CE                     .byte   $d3, $d4, $cf, $ce
D014 D0 CD 49 D2                     .byte   $d0, $cd, $49, $d2
D018 40 40 E4 40                     .byte   $40, $40, $e4, $40
D01C E0 A1 E6 9F                     .byte   $e0, $a1, $e6, $9f
D020 DC DD F1 F3                     .byte   $dc, $dd, $f1, $f3
D024 FE FD 8B D7                     .byte   $fe, $fd, $8b, $d7
D028 D8 A7 A8 89                     .byte   $d8, $a7, $a8, $89
D02C 8D 8E A3 A4                     .byte   $8d, $8e, $a3, $a4
D030 4B 57 58 59                     .byte   $4b, $57, $58, $59
D034 5A 5B 9C 9D                     .byte   $5a, $5b, $9c, $9d
D038 4E 4F CC 4C                     .byte   $4e, $4f, $cc, $4c
D03C 4D A2                           .byte   $4d, $a2
D03E 8E 01 BF    reset               lds     #$01bf
D041 8D 19                           bsr     L4003
D043 BD D1 7B                        jsr     $d17b
D046 BD DB 20                        jsr     $db20
D049 BD D9 6C                        jsr     $d96c
D04C BD E1 25                        jsr     somecode
D04F B6 C0 01                        ldaa    $c001
D052 97 9C       ecuInit             staa    $9c
...

Specifically the reset entry point is of interest

...
D03E 8E 01 BF    reset               lds     #$01bf
D041 8D 19                           bsr     L4003
D043 BD D1 7B                        jsr     $d17b
D046 BD DB 20                        jsr     $db20
D049 BD D9 6C                        jsr     $d96c
D04C BD E1 25                        jsr     somecode
D04F B6 C0 01                        ldaa    $c001
...

Each of the Jumps-to-SubRoutine (JSR) here are to the various subroutines. As you can see we already gave the last one a name somecode We can simply change that to subroutine4 add the other three as well.

code  D17B    subroutine1
code  DB20    subroutine2
code  D96C    subroutine3
code  E125    subroutine4

Results in

...
D03E 8E 01 BF    reset               lds     #$01bf
D041 8D 19                           bsr     L4003
D043 BD D1 7B                        jsr     subroutine1
D046 BD DB 20                        jsr     subroutine2
D049 BD D9 6C                        jsr     subroutine3
D04C BD E1 25                        jsr     subroutine4
D04F B6 C0 01                        ldaa    $c001
...

The labels will now also be before the subroutines later in the code.

The vector table

The second place we can look is at the end of the code, the vector table. This is how the vector table is laid out (as is in the E391 listing file)

standard_E931.lst
...
FFE0 EA 0B                   .word   serialRxInt
FFE2 D0 3E                   .word   reset
FFE4 F8 40                   .word   realTimeInt
FFE6 D0 3E                   .word   reset                
FFE8 D0 3E                   .word   reset
FFEA D0 3E                   .word   reset                     
FFEC FA 92                   .word   outCompInt3
FFEE F6 1E                   .word   outCompInt2
FFF0 F6 13                   .word   outCompInt1
FFF2 D0 3E                   .word   reset
FFF4 F7 B9                   .word   inCaptInt2
FFF6 EC 6D                   .word   inCaptInt1
FFF8 D0 3E                   .word   reset
FFFA D0 3E                   .word   reset
FFFC FA E0                   .word   failureInt
FFFE CE FF                   .word   codeStart
...

Make yours look the same, I think by know you know what to do. ;)

Last updated