home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / System / MorphOS / Developer / emulexamples / library / skeleton / lib.s < prev    next >
Encoding:
Text File  |  2000-11-02  |  6.9 KB  |  377 lines

  1.     .file    "lib.c"
  2.  
  3.  # rs6000/powerpc options: -mcpu=604 -msdata=data -G 8
  4.  # GNU C version 2.95.3 19991030 (prerelease/franzo) (ppc-amigaos) compiled by GNU C version 2.95.2 19991024 (release).
  5.  # options passed:  -mstrict-align -mno-prototype -mcpu=604 -mregnames -O2
  6.  # -Wformat -Wunused -Wuninitialized -Wconversion -Wstrict-prototypes
  7.  # -Werror-implicit-function-declaration -fomit-frame-pointer -fverbose-asm
  8.  # options enabled:  -fdefer-pop -fomit-frame-pointer -fcse-follow-jumps
  9.  # -fcse-skip-blocks -fexpensive-optimizations -fthread-jumps
  10.  # -fstrength-reduce -fpeephole -fforce-mem -ffunction-cse -finline
  11.  # -fkeep-static-consts -fcaller-saves -fpcc-struct-return -fgcse
  12.  # -frerun-cse-after-loop -frerun-loop-opt -fschedule-insns
  13.  # -fschedule-insns2 -fsched-interblock -fsched-spec -fbranch-count-reg
  14.  # -fcommon -fverbose-asm -fgnu-linker -fregmove -foptimize-register-move
  15.  # -fargument-alias -fident -mpowerpc -mpowerpc-gfxopt -mnew-mnemonics
  16.  # -mstrict-align -mregnames -mcpu=604 -mcall-sysv -msdata=data
  17.  
  18. gcc2_compiled.:
  19.     .globl LibInitStruct
  20.     .section    ".data"
  21.     .align 2
  22.     .type     LibInitStruct,@object
  23.     .size     LibInitStruct,16
  24. LibInitStruct:
  25.     .long 44
  26.     .long LibFuncTable
  27.     .long 0
  28.     .long LIB_Init
  29.     .globl LibResident
  30.     .align 1
  31.     .type     LibResident,@object
  32.     .size     LibResident,26
  33. LibResident:
  34.     .short 19196
  35.     .long LibResident
  36.     .long LibResident+26
  37.     .byte 136
  38.     .byte 0
  39.     .byte 9
  40.     .byte 0
  41.     .long .LC0
  42.     .long .LC1
  43.     .long LibInitStruct
  44.     .section    ".rodata"
  45.     .align 2
  46. .LC1:
  47.     .string    "ppcexample.library 0.2 (20.2.00) \251 2000 by Ralph Schmidt, written by Ralph Schmidt\r\n"
  48.     .align 2
  49. .LC0:
  50.     .string    "ppcexample.library"
  51.     .globl __amigappc__
  52.     .section    ".sdata","aw"
  53.     .align 2
  54.     .type     __amigappc__,@object
  55.     .size     __amigappc__,4
  56. __amigappc__:
  57.     .long 1
  58.     .section    ".text"
  59.     .align 2
  60.     .globl NoExecute
  61.     .type     NoExecute,@function
  62. NoExecute:
  63.     li %r3,0
  64.     blr
  65. .Lfe1:
  66.     .size     NoExecute,.Lfe1-NoExecute
  67.     .section    ".rodata"
  68.     .align 2
  69. .LC2:
  70.     .string    "LibInit: LibBase 0x%lx SegList 0x%lx SBase 0x%lx\n"
  71.     .section    ".text"
  72.     .align 2
  73.     .globl LIB_Init
  74.     .type     LIB_Init,@function
  75. LIB_Init:
  76.     stwu %r1,-32(%r1)
  77.     mflr %r0
  78.     stw %r27,12(%r1)
  79.     stw %r28,16(%r1)
  80.     stw %r29,20(%r1)
  81.     stw %r30,24(%r1)
  82.     stw %r31,28(%r1)
  83.     stw %r0,36(%r1)
  84.     mr %r29,%r3
  85.     mr %r28,%r4
  86.     lis %r3,.LC2@ha
  87.     mr %r27,%r5
  88.     la %r3,.LC2@l(%r3)
  89.     crxor 6,6,6
  90.     bl dprintf
  91.     stw %r28,36(%r29)
  92.     mr %r3,%r29
  93.     stw %r27,40(%r29)
  94.     lwz %r0,36(%r1)
  95.     mtlr %r0
  96.     lwz %r27,12(%r1)
  97.     lwz %r28,16(%r1)
  98.     lwz %r29,20(%r1)
  99.     lwz %r30,24(%r1)
  100.     lwz %r31,28(%r1)
  101.     la %r1,32(%r1)
  102.     blr
  103. .Lfe2:
  104.     .size     LIB_Init,.Lfe2-LIB_Init
  105.     .section    ".rodata"
  106.     .align 2
  107. .LC3:
  108.     .string    "LIB_Expunge: LibBase 0x%lx <%s> OpenCount %ld\n"
  109.     .align 2
  110. .LC4:
  111.     .string    "LIB_Expunge: set LIBF_DELEXP\n"
  112.     .align 2
  113. .LC5:
  114.     .string    "LIB_Expunge: remove the library\n"
  115.     .align 2
  116. .LC6:
  117.     .string    "LIB_Expunge: free the library\n"
  118.     .align 2
  119. .LC7:
  120.     .string    "LIB_Expunge: return Segment 0x%lx to ramlib\n"
  121.     .section    ".text"
  122.     .align 2
  123.     .globl LibExpunge
  124.     .type     LibExpunge,@function
  125. LibExpunge:
  126.     stwu %r1,-272(%r1)
  127.     mflr %r0
  128.     stw %r30,264(%r1)
  129.     stw %r31,268(%r1)
  130.     stw %r0,276(%r1)
  131.     mr %r31,%r3
  132.     lhz %r5,10(%r31)
  133.     lis %r3,.LC3@ha
  134.     mr %r4,%r31
  135.     lhz %r0,12(%r31)
  136.     la %r3,.LC3@l(%r3)
  137.     slwi %r5,%r5,16
  138.     lhz %r6,32(%r31)
  139.     or %r5,%r0,%r5
  140.     crxor 6,6,6
  141.     bl dprintf
  142.     lhz %r0,32(%r31)
  143.     lwz %r30,36(%r31)
  144.     cmpwi %cr0,%r0,0
  145.     bc 4,2,.L5
  146.     lwz %r9,40(%r31)
  147.     li %r0,-132
  148.     addi %r3,%r1,8
  149.     stw %r0,8(%r1)
  150.     stw %r9,68(%r1)
  151.     lwz %r9,88(%r2)
  152.     mtlr %r9
  153.     blrl
  154.     lis %r3,.LC5@ha
  155.     la %r3,.LC5@l(%r3)
  156.     crxor 6,6,6
  157.     bl dprintf
  158.     lwz %r9,40(%r31)
  159.     li %r0,-252
  160.     addi %r3,%r1,72
  161.     stw %r0,72(%r1)
  162.     stw %r9,132(%r1)
  163.     stw %r31,112(%r1)
  164.     lwz %r9,88(%r2)
  165.     mtlr %r9
  166.     blrl
  167.     lwz %r9,40(%r31)
  168.     li %r0,-138
  169.     addi %r3,%r1,136
  170.     stw %r0,136(%r1)
  171.     stw %r9,196(%r1)
  172.     lwz %r9,88(%r2)
  173.     mtlr %r9
  174.     blrl
  175.     lis %r3,.LC6@ha
  176.     la %r3,.LC6@l(%r3)
  177.     crxor 6,6,6
  178.     bl dprintf
  179.     lhz %r0,16(%r31)
  180.     li %r8,-210
  181.     addi %r3,%r1,200
  182.     lhz %r11,18(%r31)
  183.     lwz %r10,40(%r31)
  184.     subf %r9,%r0,%r31
  185.     add %r0,%r0,%r11
  186.     stw %r9,240(%r1)
  187.     stw %r0,204(%r1)
  188.     stw %r10,260(%r1)
  189.     stw %r8,200(%r1)
  190.     lwz %r9,88(%r2)
  191.     mtlr %r9
  192.     blrl
  193.     lis %r3,.LC7@ha
  194.     mr %r4,%r30
  195.     la %r3,.LC7@l(%r3)
  196.     crxor 6,6,6
  197.     bl dprintf
  198.     mr %r3,%r30
  199.     b .L6
  200. .L5:
  201.     lis %r3,.LC4@ha
  202.     la %r3,.LC4@l(%r3)
  203.     crxor 6,6,6
  204.     bl dprintf
  205.     lbz %r0,14(%r31)
  206.     li %r3,0
  207.     ori %r0,%r0,8
  208.     stb %r0,14(%r31)
  209. .L6:
  210.     lwz %r0,276(%r1)
  211.     mtlr %r0
  212.     lwz %r30,264(%r1)
  213.     lwz %r31,268(%r1)
  214.     la %r1,272(%r1)
  215.     blr
  216. .Lfe3:
  217.     .size     LibExpunge,.Lfe3-LibExpunge
  218.     .section    ".rodata"
  219.     .align 2
  220. .LC8:
  221.     .string    "LIB_Expunge:\n"
  222.     .section    ".text"
  223.     .align 2
  224.     .globl LIB_Expunge
  225.     .type     LIB_Expunge,@function
  226. LIB_Expunge:
  227.     stwu %r1,-32(%r1)
  228.     mflr %r0
  229.     stw %r29,20(%r1)
  230.     stw %r30,24(%r1)
  231.     stw %r31,28(%r1)
  232.     stw %r0,36(%r1)
  233.     lis %r3,.LC8@ha
  234.     lwz %r29,56(%r2)
  235.     la %r3,.LC8@l(%r3)
  236.     crxor 6,6,6
  237.     bl dprintf
  238.     mr %r3,%r29
  239.     bl LibExpunge
  240.     lwz %r0,36(%r1)
  241.     mtlr %r0
  242.     lwz %r29,20(%r1)
  243.     lwz %r30,24(%r1)
  244.     lwz %r31,28(%r1)
  245.     la %r1,32(%r1)
  246.     blr
  247. .Lfe4:
  248.     .size     LIB_Expunge,.Lfe4-LIB_Expunge
  249.     .section    ".rodata"
  250.     .align 2
  251. .LC9:
  252.     .string    "LIB_Open: 0x%lx <%s> OpenCount %ld\n"
  253.     .section    ".text"
  254.     .align 2
  255.     .globl LIB_Open
  256.     .type     LIB_Open,@function
  257. LIB_Open:
  258.     stwu %r1,-32(%r1)
  259.     mflr %r0
  260.     stw %r29,20(%r1)
  261.     stw %r30,24(%r1)
  262.     stw %r31,28(%r1)
  263.     stw %r0,36(%r1)
  264.     lwz %r29,56(%r2)
  265.     lis %r3,.LC9@ha
  266.     la %r3,.LC9@l(%r3)
  267.     lhz %r5,10(%r29)
  268.     mr %r4,%r29
  269.     lhz %r0,12(%r29)
  270.     slwi %r5,%r5,16
  271.     lhz %r6,32(%r29)
  272.     or %r5,%r0,%r5
  273.     crxor 6,6,6
  274.     bl dprintf
  275.     lbz %r0,14(%r29)
  276.     mr %r3,%r29
  277.     lhz %r9,32(%r29)
  278.     andi. %r0,%r0,247
  279.     addi %r9,%r9,1
  280.     stb %r0,14(%r29)
  281.     sth %r9,32(%r29)
  282.     lwz %r0,36(%r1)
  283.     mtlr %r0
  284.     lwz %r29,20(%r1)
  285.     lwz %r30,24(%r1)
  286.     lwz %r31,28(%r1)
  287.     la %r1,32(%r1)
  288.     blr
  289. .Lfe5:
  290.     .size     LIB_Open,.Lfe5-LIB_Open
  291.     .section    ".rodata"
  292.     .align 2
  293. .LC10:
  294.     .string    "LIB_Close: 0x%lx <%s> OpenCount %ld\n"
  295.     .align 2
  296. .LC11:
  297.     .string    "LIB_Close: done\n"
  298.     .align 2
  299. .LC12:
  300.     .string    "LIB_Close: LIBF_DELEXP set\n"
  301.     .section    ".text"
  302.     .align 2
  303.     .globl LIB_Close
  304.     .type     LIB_Close,@function
  305. LIB_Close:
  306.     stwu %r1,-16(%r1)
  307.     mflr %r0
  308.     stw %r31,12(%r1)
  309.     stw %r0,20(%r1)
  310.     lwz %r31,56(%r2)
  311.     lis %r3,.LC10@ha
  312.     la %r3,.LC10@l(%r3)
  313.     lhz %r5,10(%r31)
  314.     mr %r4,%r31
  315.     lhz %r0,12(%r31)
  316.     slwi %r5,%r5,16
  317.     lhz %r6,32(%r31)
  318.     or %r5,%r0,%r5
  319.     crxor 6,6,6
  320.     bl dprintf
  321.     lhz %r9,32(%r31)
  322.     addi %r9,%r9,-1
  323.     rlwinm %r0,%r9,0,0xffff
  324.     sth %r9,32(%r31)
  325.     cmpwi %cr0,%r0,0
  326.     bc 4,2,.L10
  327.     lbz %r0,14(%r31)
  328.     andi. %r9,%r0,8
  329.     bc 12,2,.L11
  330.     lis %r3,.LC12@ha
  331.     la %r3,.LC12@l(%r3)
  332.     crxor 6,6,6
  333.     bl dprintf
  334.     mr %r3,%r31
  335.     bl LibExpunge
  336.     b .L13
  337. .L10:
  338.     lis %r3,.LC11@ha
  339.     la %r3,.LC11@l(%r3)
  340.     crxor 6,6,6
  341.     bl dprintf
  342. .L11:
  343.     li %r3,0
  344. .L13:
  345.     lwz %r0,20(%r1)
  346.     mtlr %r0
  347.     lwz %r31,12(%r1)
  348.     la %r1,16(%r1)
  349.     blr
  350. .Lfe6:
  351.     .size     LIB_Close,.Lfe6-LIB_Close
  352.     .section    ".rodata"
  353.     .align 2
  354. .LC13:
  355.     .string    "LIB_Reserved:\n"
  356.     .section    ".text"
  357.     .align 2
  358.     .globl LIB_Reserved
  359.     .type     LIB_Reserved,@function
  360. LIB_Reserved:
  361.     stwu %r1,-16(%r1)
  362.     mflr %r0
  363.     stw %r0,20(%r1)
  364.     lis %r3,.LC13@ha
  365.     la %r3,.LC13@l(%r3)
  366.     crxor 6,6,6
  367.     bl dprintf
  368.     li %r3,0
  369.     lwz %r0,20(%r1)
  370.     mtlr %r0
  371.     la %r1,16(%r1)
  372.     blr
  373. .Lfe7:
  374.     .size     LIB_Reserved,.Lfe7-LIB_Reserved
  375.     .comm    LibFuncTable,4,4
  376.     .ident    "GCC: (GNU) 2.95.3 19991030 (prerelease/franzo)"
  377.