Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. macro forward_list_builder name {
  3.         local c
  4.         macro .#name a& \{
  5.                 \local m
  6.                 c equ m
  7.                 macro m a
  8.         \}
  9.         macro name#List \{
  10.                 irpv v,c \\{
  11.                        ;\\forward
  12.                         v
  13.                 \\}
  14.         \}
  15. }
  16.  
  17. macro reverse_list_builder name {
  18.         local c
  19.         macro .#name a& \{
  20.                 \local m
  21.                 c equ m
  22.                 macro m a
  23.         \}
  24.         macro name#List \{
  25.                 irpv v,c \\{
  26.                         \\reverse
  27.                         v
  28.                 \\}
  29.         \}
  30. }
  31.  
  32. forward_list_builder IGlobalBlock
  33. forward_list_builder SGlobalBlock
  34. forward_list_builder TGlobalBlock
  35. forward_list_builder UGlobalBlock
  36. forward_list_builder VGlobalBlock
  37. forward_list_builder XGlobalBlock
  38.  
  39. ;------------------------------------------------------------------
  40. ; use "tglobal" for inserting TLS definitions.
  41. ;------------------------------------------------------------------
  42. macro tglobal {
  43.   .TGlobalBlock { }
  44.  
  45. macro tglobal_nested {
  46.   .TGlobalBlock \{ }
  47.  
  48. ;------------------------------------------------------------------
  49. ; use "vglobal" for inserting virtual definitions.
  50. ;------------------------------------------------------------------
  51. macro vglobal {
  52.   .VGlobalBlock { }
  53.  
  54. macro vglobal_nested {
  55.   .VGlobalBlock \{ }
  56.  
  57. ;------------------------------------------------------------------
  58. ; use "iglobal" for inserting initialized global data definitions.
  59. ;------------------------------------------------------------------
  60. macro iglobal {
  61.   .IGlobalBlock { }
  62.  
  63. macro iglobal_nested {
  64.   .IGlobalBlock \{ }
  65.  
  66. ;------------------------------------------------------------------
  67. ; use "sglobal" for inserting strings definitions.
  68. ;------------------------------------------------------------------
  69. macro sglobal {
  70.   .SGlobalBlock { }
  71.  
  72. macro sglobal_nested {
  73.   .SGlobalBlock \{ }
  74.  
  75. ;-------------------------------------------------------------
  76. ; use 'uglobal' for inserting uninitialized global definitions.
  77. ; even when you define some data values, these variables
  78. ; will be stored as uninitialized data.
  79. ;-------------------------------------------------------------
  80. macro uglobal {
  81.   .UGlobalBlock { }
  82.  
  83. macro uglobal_nested {
  84.   .UGlobalBlock \{ }
  85.  
  86. ;-------------------------------------------------------------
  87. ; use 'xglobal' for inserting uninitialized global definitions.
  88. ; even when you define some data values, these variables
  89. ; will be stored as uninitialized data.
  90. ;-------------------------------------------------------------
  91. macro xglobal {
  92.   .XGlobalBlock { }
  93.  
  94. macro xglobal_nested {
  95.   .XGlobalBlock \{ }
  96.  
  97. endg fix }              ; Use endg for ending iglobal and uglobal blocks.
  98. endg_nested fix \}
  99.  
  100. macro IncludeGlobals MacroName
  101. {
  102.   local Begin,Size
  103.   virtual at $
  104.     Begin = $
  105.     MacroName
  106.     Size = $-Begin
  107.   end virtual
  108.   rb Size
  109. }
  110.  
  111. macro IncludeAllGlobals {
  112.   IGlobalBlockList
  113.   SGlobalBlockList
  114. UDataStr:
  115.   IncludeGlobals UGlobalBlockList       ;will be zeroed
  116. UDataEnd:
  117.   IncludeGlobals XGlobalBlockList       ;will be undefined
  118. }
  119.