File: exehdr.s

package info (click to toggle)
cc65 2.19-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,268 kB
  • sloc: ansic: 117,151; asm: 66,339; pascal: 4,248; makefile: 1,009; perl: 607
file content (40 lines) | stat: -rw-r--r-- 1,848 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
;
; Oliver Schmidt, 2012-06-10
;
; This module supplies an AppleSingle version 2 file header + entry with
; ID 11 according to https://tools.ietf.org/rfc/rfc1740.txt Appendix A.
;

        .export         __EXEHDR__ : absolute = 1       ; Linker referenced
        .import         __FILETYPE__                    ; Linker generated
        .import         __MAIN_START__, __MAIN_LAST__   ; Linker generated

; ------------------------------------------------------------------------

; Data Fork
ID01_LENGTH = __MAIN_LAST__ - __MAIN_START__
ID01_OFFSET = ID01 - START

; ProDOS File Info
ID11_LENGTH = ID01 - ID11
ID11_OFFSET = ID11 - START

; ------------------------------------------------------------------------

        .segment        "EXEHDR"

START:  .byte           $00, $05, $16, $00                  ; Magic number
        .byte           $00, $02, $00, $00                  ; Version number
        .res            16                                  ; Filler
        .byte           0, 2                                ; Number of entries
        .byte           0, 0, 0, 1                          ; Entry ID 1 - Data Fork
        .byte           0, 0, >ID01_OFFSET, <ID01_OFFSET    ; Offset
        .byte           0, 0, >ID01_LENGTH, <ID01_LENGTH    ; Length
        .byte           0, 0, 0, 11                         ; Entry ID 11 - ProDOS File Info
        .byte           0, 0, >ID11_OFFSET, <ID11_OFFSET    ; Offset
        .byte           0, 0, >ID11_LENGTH, <ID11_LENGTH    ; Length
ID11:   .byte           0, %11000011                        ; Access - Destroy, Rename, Write, Read
        .byte           >__FILETYPE__, <__FILETYPE__        ; File Type
        .byte           0, 0                                ; Auxiliary Type high
        .byte           >__MAIN_START__, <__MAIN_START__    ; Auxiliary Type low
ID01: