home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / new / dev / misc / flexcat / aztecas_asm.sd next >
Text File  |  1993-12-21  |  2KB  |  123 lines

  1. ##stringtype assembler
  2. ##shortstrings
  3. *****************************************************************
  4. *   This file was created automatically by `FlexCat V1.0'       *
  5. *   Do NOT edit by hand!                    *
  6. *****************************************************************
  7.  
  8. *   Includefiles
  9.     include "exec/types.i"
  10.     include "utility/tagitem.i"
  11.     include "libraries/locale.i"
  12.  
  13. *   Function declarations
  14.     xdef    Open%bCatalog
  15.     xdef    Close%bCatalog
  16.     xdef    Get%bString
  17.  
  18. *   Referenced data
  19.     xref    _LocaleBase
  20.  
  21. *   Referenced functions
  22.     xref    _LVOOpenCatalogA
  23.     xref    _LVOCloseCatalog
  24.     xref    _LVOGetCatalogStr
  25.  
  26. *   Data definitions
  27.     dseg
  28. %iSTR:\n%s,0\n
  29.  
  30. CatStringTab:
  31.     dc.l    %d,%iSTR
  32.  
  33. %b_BuiltInLanguage:
  34.     %l,0
  35.  
  36. CatalogName:
  37.     dc.b    '%b.catalog',0
  38.  
  39. OpenCatalogTags:
  40.     dc.l    OC_Language,0
  41.     dc.l    OC_BuiltInLanguage,%b_BuiltInLanguage
  42.     dc.l    OC_Version,%v
  43.     dc.l    TAG_DONE,0
  44.  
  45.     bss.l    %b_Catalog,4
  46.  
  47. *   Code definitions
  48.     cseg
  49.  
  50. Open%bCatalog:
  51. *   a0 = Locale
  52. *   a1 = Language
  53.     movem.l a2/a6,-(sp)             ;   Save Regs
  54.  
  55.     lea    OpenCatalogTags,a2    ;   Store Language
  56.     move.l    a1,4(a2)
  57.     bne    Open%bCatalog1
  58.     lea    8(a2),a2
  59. Open%bCatalog1:
  60.     move.l    _LocaleBase,a6        ;   Call locale.OpenCatalog
  61.     move.l    a6,d0            ;   Locale opened?
  62.     beq    Open%bCatalogEnd    ;   No, skip
  63.     tst.l    %b_Catalog        ;   Catalog opened?
  64.     bne    Open%bCatalogEnd    ;   Yes, skip
  65.     lea    CatalogName,a1
  66.     jsr    _LVOOpenCatalogA(a6)
  67.     move.l    d0,%b_Catalog
  68. Open%bCatalogEnd:
  69.     movem.l (sp)+,a2/a6
  70.     rts
  71.  
  72.  
  73. Close%bCatalog:
  74.     move.l    a6,-(sp)
  75.     move.l    %b_Catalog,a0        ;   Close the Catalog, if needed
  76.     move.l    #0,%b_Catalog
  77.     move.l    _LocaleBase,a6
  78.     move.l    a6,d0            ;   Locale.library opened?
  79.     beq    Close%bCatalogEnd    ;   No, skip
  80.     jsr    _LVOCloseCatalog(a6)
  81. Close%bCatalogEnd:
  82.     move.l    (sp)+,a6
  83.     rts
  84.  
  85.  
  86. Get%bString:
  87. *   d0 = ID
  88.     move.l    a6,-(sp)                ;   Save regs
  89.  
  90.     lea    CatStringTab-8,a0    ;   Get default string
  91.     move.l    #%n,d1            ;   Any strings present?
  92.     beq    Get%bString1        ;   No, skip
  93.  
  94. Get%bStringLoop:            ;   Look for ID in Loop
  95.     add.l    #8,a0
  96.     cmp.l    (a0),d0
  97.     beq    Get%bString2
  98.     sub.l    #1,d1
  99.     bne    Get%bStringLoop
  100. Get%bString1:
  101.     move.l    #0,a1
  102.     jmp    Get%bString3
  103. Get%bString2:
  104.     move.l    4(a0),a1
  105.  
  106. Get%bString3:
  107.     move.l    _LocaleBase,a6        ;   Locale.library present?
  108.     move.l    a6,d1
  109.     beq    Get%bStringNoLoc    ;   No, skip
  110.     move.l    %b_Catalog,a0        ;   Catalog opened?
  111.     move.l    a0,d1
  112.     beq    Get%bStringNoLoc    ;   No, skip
  113.  
  114.     jsr    _LVOGetCatalogStr(a6)
  115. Get%bStringEnd:
  116.     move.l    (sp)+,a6
  117.     rts
  118. Get%bStringNoLoc:
  119.     move.l    a1,d0
  120.     jmp    Get%bStringEnd
  121.  
  122.     end
  123.