KMD

KMD file format

KMD is a proprietary ASCII list file type output from assembly/compilation tools which can act both as a list file for documentation and as a template for memory loading for a debugger. It is identifiable by the first line beginning "KMD". Subsequently, records are recognised by the first element on a line.

If a line begins with a hexadecimal number this is interpreted as an address. This is terminated with a ':'. Any subsequent hexadecimal numbers will be read into sequential addresses; the number of digits in the number dictates the size of the loaded quantity, thus "00" is a zero byte, whereas "00000000" is a zero 32-bit word. As many fields as desired may be included, separated by spaces, and they will be loaded successively.

Anything following the first ';' on a line is regarded as a `comment'; this can be used for a source code line.

Lines which do not begin with an address but following a valid address can also be loaded as a `continuation' of a source line.

A line beginning with a ':' is interpreted as a symbol. This comprises a single string (the symbol name), a hexadecimal number (the value) and an optional symbol type. currently four symbol types are defined:

There may be further type information appended.


Example KMD file

KMD
00000000:             ; ;  Check out BCD incrementer
00000000:             ; ;               AREA    wombat, CODE, READONLY
00000000:             ; 
00000000:             ; No_digits       EQU     4
00000000:             ; 
00000000:             ; ;               ENTRY
00000000:             ; 
00000000:             ; repeat
00000000: E3A02004    ;                 mov     r2, #No_digits
00000004: E28F1027    ;                 adr     r1, number + No_digits - 1
00000008: E5510000    ; next_digit      ldrb    r0, [r1]
0000000C: E2800001    ;                 add     r0, r0, #1
00000010: E350003A    ;                 cmp     r0, #'9'+1
00000014: 3A000003    ;                 blo     complete
00000018: E3A00030    ;                 mov     r0, #'0'
0000001C: E4410001    ;                 strb    r0, [r1], #-1
00000020: E2522001    ;                 subs    r2, r2, #1
00000024: 1AFFFFF7    ;                 bne     next_digit
00000028: 15410000    ; complete        strneb  r0, [r1]
0000002C:             ; 
0000002C:             ; 
0000002C: EAFFFFF3    ;                 b       repeat
00000030:             ; 
00000030: 30 30 30 30 ; number          DCB     "0000"
00000034: 00 01 11    ;                 DCB     0,1,17
00000037:             ; 
00000038:             ;                 ALIGN
00000038:             ; 
00000038:             ; ;               END

Symbol Table: Labels
: No_digits                         00000004  Value
: repeat                            00000000  Local
: next_digit                        00000008  Local
: complete                          00000028  Local
: number                            00000030  Local