home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / discs / f / mapmanager / h_Macros_asm < prev    next >
Encoding:
Text File  |  1993-11-14  |  2.0 KB  |  129 lines

  1. ; h.Macros
  2. ;
  3.  
  4.     
  5.     [    debug
  6.     MACRO
  7.     PrintR    $reg
  8.     STMFD    sp!,{r0-r3,r14}
  9.     MOV    r3,$reg
  10.     ADR    r1,SmallBuffer
  11.     MOV    r2,#SmallBufferSize
  12.     Write    " {$reg=&"
  13.     MOV    r0,r3
  14.     SWI    XOS_ConvertHex8
  15.     Write    "} "
  16.     ADR    r0,SmallBuffer
  17.     SWI    XOS_Write0
  18.     LDMFD    sp!,{r0-r3,r14}
  19.     MEND
  20.     ]
  21.  
  22.     MACRO
  23.     RoutiNe    $string
  24.     [    debug
  25.     SWI    XOS_WriteS
  26.     =    "«$string",0
  27.     ALIGN
  28.     ]
  29.     MEND
  30.  
  31.     MACRO
  32.     RoutinEnd
  33.     [    debug
  34.     BL    endofroutinecode
  35.     ]
  36.     MEND
  37.  
  38.     MACRO
  39.     AssemRoutineCode
  40.     [    debug
  41. endofroutinecode
  42.     STMFD    sp!,{r0,lr}
  43.     SWIVS    XOS_WriteI+"®"
  44.     SWI    XOS_WriteI+"»"
  45.     LDMFD    sp!,{r0,pc}^        ; restore pcr bits
  46.     ]
  47.     MEND
  48.  
  49.  
  50.     MACRO
  51. $label    NextBit
  52. ;    -------
  53. ;
  54. ; on entry:
  55. ; r10    bit offset into map
  56. ; r11    MapLocation (or address of zone etc)
  57. ;
  58. ; on exit:
  59. ; r0    =bit
  60. ; Z    set if bit=0
  61. ; r10, r11    preserved
  62.  
  63.     [    debug
  64.     LDR    r0,MapSize
  65.     MOV    r0,r0,ASL #3
  66.     CMP    r10,r0
  67.     BLO    %ft77
  68.     SWI    XOS_WriteS
  69.     =    "« bit offset out of range!! »"
  70.     ALIGN
  71. 77
  72.     ]
  73.  
  74. $label    MOV    r0,r10,ASR #5            ; get word offset
  75.     LDR    r0,[r11,r0,ASL #2]
  76.     MOV    r0,r0,ROR r10
  77.     ANDS    r0,r0,#1
  78.     MEND
  79.  
  80.  
  81.  
  82.     MACRO    
  83.     DictionarySetup
  84. ;    ---------------
  85. SetupDictionaryAddress
  86.     STMFD    sp!,{lr}
  87.     ADR    r14,myDictionary
  88.     STR    r14,Dictionary
  89.     LDMFD    sp!,{pc}
  90.  
  91.  
  92. myDictionary
  93.     Dic    "Disc"          ; 1
  94.     Dic    "disc"          ; 2
  95.     Dic    "name: "        ; 3
  96.     Dic    "size"          ; 4
  97.     Dic    " bytes"        ; 5
  98.     Dic    " bits"        ; 6
  99.     Dic    "harddisc"      ; 7
  100.     Dic    "length"        ; 8
  101.     Dic    "Number of "    ; 9
  102.     Dic    "zone"          ; 10
  103.     Dic    "sector"        ; 11
  104.     Dic    "bit size"    ; 12
  105.     Dic    "granularity"    ; 13
  106.     Dic    "disc map"      ; 14
  107.     Dic    "root"          ; 15
  108.     Dic    "address"       ; 16
  109.     Dic    "memory"        ; 17
  110.     Dic    "IDfield"    ; 18
  111.     Dic    "density: "     ; 19
  112.     Dic    "allocation unit"; 20
  113.     Dic    "checksum"    ; 21
  114.     Dic    " density ("    ; 22
  115.     Dic    "attribute"    ; 23
  116.     DicB    "27,7"                    , 24
  117.     DicB    """single"",27,22,""125"",27,33"    , 25
  118.     DicB    """double"",27,22,""250"",27,33"    , 26
  119.     DicB    """double plus"",27,22,""300"",27,33"    , 27
  120.     DicB    """quad"",27,22,""500"",27,33"        , 28
  121.     DicB    """unknown (?)"""            , 29
  122.     DicB    "27,29"                    , 30
  123.     DicB    "27,29"                    , 31
  124.     DicB    """octal"",27,22,""1000"",27,33"    , 32
  125.     DicB    "31,""Kbps)"""                , 33
  126.     =    0
  127.     MEND
  128.     END
  129.