home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / MAXONC3_6OF8.DMS / in.adf / LIBSRC.LHA / LIBSRC / assert.asm < prev    next >
Encoding:
Assembly Source File  |  1994-04-08  |  810 b   |  50 lines

  1.  
  2. * Maxon C++ Library:
  3. * Modul "assert"
  4. * Jens Gelhar 19.03.93
  5.  
  6.     xdef    do__assert
  7.  
  8.     xref    __Writefile,exit__i,_inttostr,_std__err
  9.  
  10. do__assert:    ; Stack-Parameter: char*, char*, unsigned
  11.     lea    Str1(pc),a1
  12.     bsr.b    .put
  13.     move.l    4(a7),a1    ; Ausdruck
  14.     bsr.b    .put
  15.     lea    Str2(pc),a1
  16.     bsr.b    .put
  17.     move.l    4+4(a7),a1    ; Dateiname
  18.     bsr.b    .put
  19.     lea    Str3(pc),a1
  20.     bsr.b    .put
  21.     move.l    4+8(a7),d0
  22.     lea    -80(a7),a7
  23.     move.w    #10,-(a7)
  24.     pea    2(a7)
  25.     move.l     d0,-(a7)
  26.     jsr    _inttostr
  27.     lea    4+4+2(a7),a1
  28.     bsr.b    .put        ; Zeilennummer
  29.     lea    4+4+2+80(a7),a7
  30.     lea    Str4(pc),a1
  31.     bsr.b    .put
  32.     move.l    #990,-(a7)
  33.     jsr    exit__i
  34.  
  35. .put    ; String a1
  36.     move.l    a1,d2
  37.     moveq    #-1,d3
  38. .cnt    addq.l    #1,d3
  39.     tst.b    (a1)+
  40.     bne.b    .cnt
  41.     lea    _std__err,a0
  42.     jmp    __Writefile
  43.  
  44. Str1:    dc.b 'Assertion failed: ',0
  45. Str2:    dc.b ', file "',0
  46. Str3:    dc.b '", line ',0
  47. Str4:    dc.b '.',10,0
  48.  
  49.     end
  50.