Subversion Repositories Kolibri OS

Rev

Rev 5942 | Rev 5945 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5942 Rev 5943
Line 188... Line 188...
188
   name db data
188
   name db data
189
   .size = $-name
189
   .size = $-name
190
  end if
190
  end if
191
}
191
}
Line 192... Line 192...
192
 
192
 
193
macro szZ name,[data] {      ; same as sz, but with 0 at the end of line (ASCIIZ string) [dunkaist]
193
macro szZ name,[data] {      ; same as sz, but for zero terminated string [dunkaist]
194
 common
194
 common
195
  if used name
195
  if used name
196
   name db data,0
196
   name db data,0
197
   .size = $-name-1
197
   .size = $-name-1
Line 270... Line 270...
270
  else
270
  else
271
    if (hsrc eqtype 0) & (~lsrc eqtype 0)
271
    if (hsrc eqtype 0) & (~lsrc eqtype 0)
272
      mov dest, (hsrc) shl 16
272
      mov dest, (hsrc) shl 16
273
      add dest, lsrc
273
      add dest, lsrc
274
    else
274
    else
275
      mov dest, hsrc
275
      movi dest, hsrc
276
      shl dest, 16
276
      shl dest, 16
277
      add dest, lsrc
277
      add dest, lsrc
278
    end if
278
    end if
279
  end if
279
  end if
280
}
280
}
Line 281... Line 281...
281
 
281
 
282
macro __mov reg,a,b {       ; mike.dld
282
macro __mov reg,a,b {       ; mike.dld
283
 if (~a eq)&(~b eq)
283
 if (~a eq)&(~b eq)
284
   mpack reg,a,b
284
   mpack reg,a,b
285
 else if (~a eq)&(b eq)
285
 else if (~a eq)&(b eq)
286
   mov reg,a
286
   movi reg,a
287
 end if
287
 end if
Line 288... Line 288...
288
}
288
}
Line 393... Line 393...
393
   end if
393
   end if
394
  end repeat
394
  end repeat
395
  display 13,10
395
  display 13,10
396
 }
396
 }
Line 397... Line -...
397
 
-
 
398
; optimize the code for size
-
 
Line 399... Line 397...
399
__regs fix 
397
 
400
 
398
 
401
macro mov arg1,arg2
399
macro movi arg1,arg2
402
 {
400
{
403
   if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
401
if (arg1 in ) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
404
      if (arg2) = 0
402
  if (arg2) = 0
405
     xor arg1,arg1
403
    xor arg1,arg1
406
      else if (arg2) = 1
404
  else if (arg2) = 1
407
     xor arg1,arg1
405
    xor arg1,arg1
408
     inc arg1
406
    inc arg1
409
      else if (arg2) = -1
407
  else if (arg2) = -1
410
     or  arg1,-1
408
    or arg1,-1
411
      else if (arg2) > -128 & (arg2) < 128
409
  else if (arg2) >= -128 & (arg2) <= 127
412
     push arg2
410
    push arg2
413
     pop  arg1
411
    pop arg1
414
      else
412
  else