**************************************************************************** * * * Amiga keymap.resource version 33.103 (1 Aug 1986) disassembly * * this version of the resource was contained in Kickstart 1.2 * * * * disassembled and commented by Pavel Zima on 24 Jul 2016 * * * * following text supposes knowledge of 68k assembly language and * * structures of Amiga operating system * * * * this little work was inspired by disassembly of AmigaOS 1.2 Exec by * * Markus Wandel (http://wandel.ca/homepage/execdis/exec_disassembly.txt) * * or downloadable from Aminet (aminet.net) * * structure and appearance is from that reason similar * * * **************************************************************************** ---------------------------------------------------------------------------- keymap.resource base ---------------------------------------------------------------------------- ; this is content of keymap resource base structure as it is in RAM ; standard node $0000 ds.l 1 LN_SUCC $0004 ds.l 1 LN_PRED $0008 ds.b 1 LN_TYPE (NT_RESOURCE) $0009 ds.b 1 LN_PRI (0) $000A ds.l 1 LN_NAME ("keymap.resource") $000E ds.l 1 LH_HEAD list header for the list $0012 ds.l 1 LH_TAIL of keymaps $0016 ds.l 1 LH_TAILPRED $001A ds.b 1 LH_TYPE $001B ds.b 1 LH_pad $001C ds.l 1 LS_SUCC $0020 ds.l 1 LS_PRED $0024 ds.b 1 LN_TYPE (NT_UNKNOWN) $0025 ds.b 1 LN_PRI (0) $0026 ds.l 1 LN_NAME ("usa") $002A ds.l *km_LoKeyMapTypes (00FE846C) $002E ds.l *km_LoKeyMap (00FE84E4) $0032 ds.l *km_LoCapsable (00FE844E) $0036 ds.l *km_LoRepeatable (00FE845D) $003A ds.l *km_HiKeyMapTypes (00FE84AC) $003E ds.l *km_HiKeyMap (00FE85E4) $0042 ds.l *km_HiCapsable (00FE8456) $0046 ds.l *km_HiRepeatable (00FE8465) $004A SIZE ---------------------------------------------------------------------------- keymap.resource ROM tag ---------------------------------------------------------------------------- ; this is the disassembly of Kickstart 1.2 ROM at addresses ; $FE4FE4 - $FE502D, this address range is preceded by ; misc.resource and followed by ramlib.library FE4FE4 4AFC RTC_MATCHWORD (start of ROMTAG marker) FE4FE6 00FE4FE4 RT_MATCHTAG (pointer RTC_MATCHWORD) FE4FEA 00FE502E RT_ENDSKIP (pointer to end of code) FE4FEE 01 RT_FLAGS (RTF_COLDSTART) FE4FEF 21 RT_VERSION (version number) FE4FF0 08 RT_TYPE (NT_RESOURCE) FE4FF1 64 RT_PRI (priority = 100) FE4FF2 00FE4FFE RT_NAME (pointer to name) FE4FF6 00FE500E RT_IDSTRING (pointer to ID string) FE4FFA 00FE83C8 RT_INIT (execution address) ; the priority (100) is high, keymap.resource is the fourth initialized ; resident module, just after exec.library, expansion.library and ; potgo.resource ---------------------------------------------------------------------------- name, version ---------------------------------------------------------------------------- FE4FFE "keymap.resource", 00 FE500E "keymap ri 33.103 (1 Aug 1986)", CR, LF, 00 ---------------------------------------------------------------------------- init routine ---------------------------------------------------------------------------- ; as the RTF_AUTOINIT bit in RT_FLAGS is not set the InitResident calls ; resource's own initialization routine below FE83C8 move.l A2,-(SP) FE83CA moveq #$4A,D0 ; 74 bytes FE83CC move.l #$010000,D1 ; MEMF_CLEAR FE83D2 jsr -$C6(A6) ; AllocMem FE83D6 tst.l D0 ; allocated? FE83D8 beq.s $FE841A ; no => finish FE83DA move.l D0,A2 FE83DC move.b #8,8(A2) ; LN_TYPE = NT_RESOURCE FE83E2 move.l #$FE4FFE,$0A(A2) ; LN_NAME = "keymap.resource" FE83EA lea $FE8420(PC),A0 ; copy from FE83EE lea $1C(A2),A1 ; copy to FE83F2 moveq #$16,D0 ; how many words less one (23 to copy) FE83F4 move.w (A0)+,(A1)+ ; copy word FE83F6 dbra D0,$FE83F4 ; loop FE83FA lea $0E(A2),A0 ; prepares list header at the offset $0E FE83FE lea $1C(A2),A1 ; and adds first node at the offset $1C FE8402 move.l A1,(A0) FE8404 clr.l 4(A0) FE8408 move.l A1,8(A0) FE840C move.l A0,4(A1) FE8410 addq.l #4,A0 FE8412 move.l A0,(A1) FE8414 move.l A2,A1 FE8416 jsr -$01E6(A6) ; AddResource FE841A move.l (SP)+,A2 FE841C rts FE841E 0000 ; padding FE8420 00000000 LN_SUCC FE8424 00000000 LN_PRED FE8428 00 LN_TYPE FE8429 00 LN_PRI FE842A 00FE887E LN_NAME ; "usa" FE842E 00FE846C *km_LoKeyMapTypes FE8432 00FE84E4 *km_LoKeyMap FE8436 00FE844E *km_LoCapsable FE843A 00FE845D *km_LoRepeatable FE843E 00FE84AC *km_HiKeyMapTypes FE8442 00FE85E4 *km_HiKeyMap FE8446 00FE8456 *km_HiCapsable FE844A 00FE8465 *km_HiRepeatable ---------------------------------------------------------------------------- LoCapsable ---------------------------------------------------------------------------- ; LoCapsable raw codes $00-$3F ; which keys can be modified by caps lock ; each key has one bit, lower bit represents lower raw code ; only alphabetical characters are capsable FE844E 0000 FE8450 FF03 ; QWERTYUIOP FE8452 FF01 ; ASDFGHJKL FE8454 FE00 ; ZXCVBNM ---------------------------------------------------------------------------- HiCapsable ---------------------------------------------------------------------------- ; HiCapsable raw codes $40-$77 FE8456 0000 ; no key with code $40-$77 is capsable FE8458 0000 FE845A 0000 FE845C 00 ---------------------------------------------------------------------------- LoRepeatable ---------------------------------------------------------------------------- ; LoRepeatable table has the same format as Lo/HiCapsable table ; bit set means repeatable key - every valid key with code $00-$3F ; is repeatable FE845D FFBF ; `1234567890-=\ 0 FE845F FFEF ; qwertyuiop[] 123 FE8461 FFEF ; asdfghjkl;, 456 FE8463 FFF7 ; « » [30] (<) FE85A8 ACB15A7A ; z Z ± ¬ [31] (Z) FE85AC F7D75878 ; x X × ÷ [32] (X) FE85B0 C7E74363 ; c C ç Ç [33] (C) FE85B4 AAAA5676 ; v V ª ª [34] (V) FE85B8 BABA4262 ; b B º º [35] (B) FE85BC 00FE8768 ; n N - ¯ [36] (N) - deadable key (n n n n ñ n N N N N Ñ N) FE85C0 BFB84D6D ; m M ¸ ¿ [37] (M) FE85C4 3C2C3C2C ; , < , < [38] (,) FE85C8 3E2E3E2E ; . > . > [39] (.) FE85CC 3F2F3F2F ; / ? / ? [3A] (/) FE85D0 00000000 [3B] FE85D4 0000002E ; . [3C] FE85D8 00000037 ; 7 [3D] (7) FE85DC 00000038 ; 8 [3E] (8) FE85E0 00000039 ; 9 [3F] (9) ---------------------------------------------------------------------------- HiKeyMap ---------------------------------------------------------------------------- FE85E4 00FE87D8 ; [40] (Space) - deadable key ( ´ ` ^ ~ ¨) FE85E8 00000008 ; [41] (Backspace) FE85EC 00FE87E2 ; [42] (TAB) FE85F0 0000000D ; [43] (Enter) FE85F4 00000A0D ; [44] (Return) FE85F8 00009B1B ; [45] (ESC) FE85FC 0000007F ; [46] (DEL) FE8600 00000000 ; [47] FE8604 00000000 ; [48] FE8608 00000000 ; [49] FE860C 0000002D ; [4A] (-) FE8610 00000000 ; [4B] FE8614 00FE87E9 ; [4C] (Up) FE8618 00FE87F1 ; [4D] (Down) FE861C 00FE87F9 ; [4E] (Right) FE8620 00FE8802 ; [4F] (Left) FE8624 00FE880B ; [50] (F1) FE8628 00FE8816 ; [51] (F2) FE862C 00FE8821 ; [52] (F3) FE8630 00FE882C ; [53] (F4) FE8634 00FE8837 ; [54] (F5) FE8638 00FE8842 ; [55] (F6) FE863C 00FE884D ; [56] (F7) FE8640 00FE8858 ; [57] (F8) FE8644 00FE8863 ; [58] (F9) FE8648 00FE886E ; [59] (F10) FE864C 00000000 ; [5A] FE8650 00000000 ; [5B] FE8654 00000000 ; [5C] FE8658 00000000 ; [5D] FE865C 00000000 ; [5E] FE8660 00FE8879 ; [5F] (Help) FE8664 00000000 ; [60] (Left Shift) FE8668 00000000 ; [61] (Right Shift) FE866C 00000000 ; [62] (Caps Lock) FE8670 00000000 ; [63] (Ctrl) FE8674 00000000 ; [64] (Left Alt) FE8678 00000000 ; [65] (Right Alt) FE867C 00000000 ; [66] (Left Amiga) FE8680 00000000 ; [67] (Right Amiga) FE8684 00000000 ; [68] FE8688 00000000 ; [69] FE868C 00000000 ; [6A] FE8690 00000000 ; [6B] FE8694 00000000 ; [6C] FE8698 00000000 ; [6D] FE869C 00000000 ; [6E] FE86A0 00000000 ; [6F] FE86A4 00000000 ; [70] FE86A8 00000000 ; [71] FE86AC 00000000 ; [72] FE86B0 00000000 ; [73] FE86B4 00000000 ; [74] FE86B8 00000000 ; [75] FE86BC 00000000 ; [76] FE86C0 00000000 ; [77] ---------------------------------------------------------------------------- dead key codes ---------------------------------------------------------------------------- ; all 5 dead keys are of type KC_VANILLA so there are 8 entries ; for each dead key the order is: ; plain, shift, alt, alt+shift, ctrl, ctrl+shift, ctrl+alt, ctrl+alt+shift ; each entry consists of of pair of bytes, the first byte could be ; 00 or 08 (DPF_DEAD) ; ; if it is 00 the next byte is the key code which is produced ; if it is 08 this combination is a dead key and the next byte contains ; index in table of deadable keys (see next table), here we have total ; 5 different indexes FE86C4 0066 0046 0801 0801 0006 0006 0086 0086 [23] (f F) index 1 acute FE86D4 0067 0047 0802 0802 0007 0007 0087 0087 [24] (g G) index 2 grave FE86E4 0068 0048 0803 0803 0008 0008 0088 0088 [25] (h H) index 3 circumflex FE86F4 006A 004A 0804 0804 000A 000A 008A 008A [26] (j J) index 4 tilde FE8704 006B 004B 0805 0805 000B 000B 008B 008B [27] (k K) index 5 diaeresis ---------------------------------------------------------------------------- deadable key codes ---------------------------------------------------------------------------- ; first 7 deadable keys are of type KC_VANILLA so their entries start with ; 8 byte pairs, the last one (space) has only one modifier (KCF_ALT) so ; its entry starts with 2 byte pairs only, their order is the same as ; in dead key codes section, all non relevant combinations are just omitted ; ; first byte of each two byte entry can be eather 00 or 01 (DPF_MOD) ; if it is 00 the next byte is the key code produced ; if it is 01 the next byte contains offset from the beginning of the key ; entry where the subtable of deadable values starts ; each such subtable contains 6 characters as there is one plain value (not ; modified by dead key) and 5 modified values ordered by respective dead ; key index ; [20] (a A æ Æ) (a á à â ã ä A Á À Â Ã Ä) FE8714 0110 0116 00E6 00C6 0001 0001 0081 0081 61E1E0E2E3E4 41C1C0C2C3C4 ; [12] (e E © ©) (e é è ê e ë E É È Ê E Ë) FE8730 0110 0116 00A9 00A9 0005 0005 0085 0085 65E9E8EA65EB 45C9C8CA45CB ; [17] (i I ¡ ¦) (i í ì î i ï I Í Ì Î I Ï) FE874C 0110 0116 00A1 00A6 0009 0009 0089 0089 69EDECEE69EF 49CDCCCE49CF ; [36] (n N - ¯) - the "-" char is soft hyphen (SHY) ; (n n n n ñ n N N N N Ñ N) FE8768 0110 0116 00AD 00AF 000E 000E 008E 008E 6E6E6E6EF16E 4E4E4E4ED14E ; [18] (o O ø Ø) (o ó ò ô õ ö O Ó Ò Ô Õ Ö) FE8784 0110 0116 00F8 00D8 000F 000F 008F 008F 6FF3F2F4F5F6 4FD3D2D4D5D6 ; [16] (u U µ µ) (u ú ù û u ü U Ú Ù Û U Ü) FE87A0 0110 0116 00B5 00B5 0015 0015 0095 0095 75FAF9FB75FC 55DAD9DB55DC ; [15] (y Y ¤ ¥) (y ý y y y ÿ Y Ý Y Y Y Y) FE87BC 0110 0116 00A4 00A5 0019 0019 0099 0099 79FD797979FF 59DD59595959 ; [40] ( _) the plain character for space is space, the space with ; alt produces non-breaking space (NBSP), here represented by "_" ; ( ´ ` ^ ~ ¨) FE87D8 0104 00A0 20B4605E7EA8 ---------------------------------------------------------------------------- strings ---------------------------------------------------------------------------- ; all keys which produce strings have only one modifier (shift) ; the only exception is Help key which has no modifier ; for every combination of key and modifier(s) there is one byte pair ; the first byte contains number of characters in produced string ; the second byte contains offset from the beginning of the key entry ; where the string begins, note that strings are not zero terminated FE87E2 0104 0205 09 9B5A [42] (TAB) FE87E9 0204 0206 9B41 9B54 [4C] (Up) FE87F1 0204 0206 9B42 9B53 [4D] (Down) FE87F9 0204 0306 9B43 9B2040 [4E] (Right) FE8802 0204 0306 9B44 9B2041 [4F] (Left) FE880B 0304 0407 9B307E 9B31307E [50] (F1) FE8816 0304 0407 9B317E 9B31317E [51] (F2) FE8821 0304 0407 9B327E 9B31327E [52] (F3) FE882C 0304 0407 9B337E 9B31337E [53] (F4) FE8837 0304 0407 9B347E 9B31347E [54] (F5) FE8842 0304 0407 9B357E 9B31357E [55] (F6) FE884D 0304 0407 9B367E 9B31367E [56] (F7) FE8858 0304 0407 9B377E 9B31377E [57] (F8) FE8863 0304 0407 9B387E 9B31387E [58] (F9) FE886E 0304 0407 9B397E 9B31397E [59] (F10) FE8879 0302 9B3F7E [5F] (Help) FE887E "usa", 00 FE8882 0000 ; padding