Subversion Repositories SvarDOS

Rev

Rev 352 | Rev 388 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 352 Rev 369
Line 29... Line 29...
29
    s1++;
29
    s1++;
30
    s2++;
30
    s2++;
31
  }
31
  }
32
  return(0);
32
  return(0);
33
}
33
}
-
 
34
 
-
 
35
 
-
 
36
/* outputs a NULL-terminated string to stdout */
-
 
37
void output_internal(const char *s, unsigned short nl) {
-
 
38
  _asm {
-
 
39
    mov ah, 0x02 /* AH=9 - write character in DL to stdout */
-
 
40
    mov si, s
-
 
41
    cld          /* clear DF so lodsb increments SI */
-
 
42
    NEXTBYTE:
-
 
43
    lodsb /* load byte from DS:SI into AL, SI++ */
-
 
44
    mov dl, al
-
 
45
    or al, 0  /* is al == 0? */
-
 
46
    jz DONE
-
 
47
    int 0x21
-
 
48
    jmp NEXTBYTE
-
 
49
    DONE:
-
 
50
    or nl, 0
-
 
51
    jz FINITO
-
 
52
    /* print out a CR/LF trailer if nl set */
-
 
53
    mov dl, 0x0D /* CR */
-
 
54
    int 0x21
-
 
55
    mov dl, 0x0A /* LF */
-
 
56
    int 0x21
-
 
57
    FINITO:
-
 
58
  }
-
 
59
}