MSDOS 4.0 (Announce)
> The CRLF hit harder for some reason, so the files like
> chdir.asm will choke with either a hang or spurious errors.
> 
> Using just this disk - ie just the raw DOS 4.0 files -
> I could theoretically write a program to convert
> LF to CRLF etc rather than just copying an unzip
> program across. I already have a crlffix - I could
> copy that across instead and likely compile it.
Both of these [2021] goofy kludges are very simple hacks to workaround a flaw
in [then] current versions of A72 assembler (e.g. 1.03a) where it won't read
properly from *nix-only text files (LF-only ending).
N.B. public domain, free for any use.
crlffile.asm
org 100h ; public domain, nenies proprajho
DOS equ 21h
ARGC equ 80h
ARGV equ 82h
CR equ 13
LF equ 10
OPENFILEREAD equ 3D00h
CREATEFILE equ 3Ch
CLOSEFILE equ 3Eh
Komenco:
  mov si,ARGC
  cmp byte[si+1],CR
  jz Fino
  xor bh,bh
  mov bl,byte[si]
  mov byte[si+bx+1],bh
OpenFiles:
  mov ax,OPENFILEREAD
  mov dx,ARGV
  int DOS
  jc Fino
  mov [inhandle],ax
  mov ah,CREATEFILE
  xor cx,cx
  mov dx,outfile
  int DOS
  jc Fino
  mov [outhandle],ax
  call main
CloseFiles:
  mov ah,CLOSEFILE
  mov bx,[inhandle]
  int DOS
  mov ah,CLOSEFILE
  mov bx,[outhandle]
  int DOS
  dec byte[err]
Fino:
  mov ax,[err]
  int DOS
main:
  call readbyte
  test ax,ax
  jz main_ret
  cmp byte[buf],LF
  jnz main_write
  mov dl,byte[buf]
  push dx
  mov byte[buf],CR
  call writebyte
  pop dx
  mov byte[buf],dl
main_write:
  call writebyte
  jmp short main
main_ret:
  ret
readbyte:
  mov ah,3Fh
  mov bx,[inhandle]
  mov cx,1
  mov dx,buf
  int DOS
readbyte_ret:
  ret
writebyte:
  mov ah,40h
  mov bx,[outhandle]
  mov cx,1
  mov dx,buf
  int DOS
  ret
outfile db 'CRLF.OUT',0
err db 1,4Ch
inhandle dw 0
outhandle dw 0
buf db 0
; EOF
crlf.asm
org 100h ; public domain, nenies proprajho
DOS equ 21h
CR equ 13
LF equ 10
EXIT equ 4C00h
ISKEYPRESS equ 0Bh
READ equ 8
WRITE equ 2
Komenco:
  mov ah,ISKEYPRESS
  int DOS
  test al,al
  jz Fino
  mov ah,READ
  int DOS
  cmp al,LF
  jnz WriteIt
AddCR:
  push ax
  mov dl,CR
  mov ah,WRITE
  int DOS
  pop ax
WriteIt:
  mov dl,al
  mov ah,WRITE
  int DOS
  jmp short Komenco
Fino:
  mov ax,EXIT
  int DOS
; EOF
Complete thread:
- MSDOS 4.0 - kerravon, 26.04.2024, 04:43 (Announce) ![Open in board view [Board]](img/board_d.gif) ![Open in mix view [Mix]](img/mix_d.gif) - MSDOS 4.0 - Guti, 26.04.2024, 14:06
- MSDOS 4.0 - Oso2k, 26.04.2024, 15:38
- MSDOS 4.0 - roytam, 26.04.2024, 17:05- MSDOS 4.0 - Japheth, 26.04.2024, 17:34- MSDOS 4.0 - RayeR, 27.04.2024, 03:05
- MSDOS 4.0 - Ringding, 01.05.2024, 13:34- MSDOS 4.0 - rr, 01.05.2024, 14:37- MSDOS 4.0 - kerravon, 29.04.2025, 06:34- MSDOS 4.0 - kerravon, 29.04.2025, 08:14- MSDOS 4.0 - kerravon, 29.04.2025, 08:47- MSDOS 4.0 - ecm, 29.04.2025, 09:50- MSDOS 4.0 - kerravon, 29.04.2025, 10:40- MSDOS 4.0 - ecm, 29.04.2025, 11:07- MSDOS 4.0 - kerravon, 29.04.2025, 11:50- MSDOS 4.0 -- MASM as standard - Rugxulo, 29.04.2025, 20:40- MSDOS 4.0 -- MASM as standard - kerravon, 29.04.2025, 21:43- MSDOS 4.0 -- MASM as standard - Rugxulo, 30.04.2025, 10:55- MSDOS 4.0 -- MASM as standard - kerravon, 30.04.2025, 16:17
 
 
- MSDOS 4.0 -- MASM as standard - Rugxulo, 30.04.2025, 10:55
- MASM as standard, fixmem example - ecm, 01.05.2025, 12:24- MASM as standard, fixmem example - Japheth, 02.05.2025, 16:10- MASM as standard, fixmem example - bretjohn, 02.05.2025, 17:09- MASM as standard, fixmem example - Rugxulo, 07.05.2025, 03:23
 
- MASM as standard, fixmem example - Rugxulo, 07.05.2025, 03:05
 
- MASM as standard, fixmem example - bretjohn, 02.05.2025, 17:09
 
- MASM as standard, fixmem example - Japheth, 02.05.2025, 16:10
 
- MSDOS 4.0 -- MASM as standard - kerravon, 29.04.2025, 21:43
 
- MSDOS 4.0 -- MASM as standard - Rugxulo, 29.04.2025, 20:40
 
- MSDOS 4.0 - kerravon, 29.04.2025, 11:50
 
- MSDOS 4.0 - ecm, 29.04.2025, 11:07
 
- MSDOS 4.0 - kerravon, 29.04.2025, 10:40
 
- MSDOS 4.0 - ecm, 29.04.2025, 09:50
 
- MSDOS 4.0 - kerravon, 29.04.2025, 08:47
 
- MSDOS 4.0 - kerravon, 29.04.2025, 08:14
 
- MSDOS 4.0 - kerravon, 29.04.2025, 06:34
 
- MSDOS 4.0 - rr, 01.05.2024, 14:37
 
 
- MSDOS 4.0 - Japheth, 26.04.2024, 17:34
- MSDOS 4.0 - rr, 26.04.2024, 22:00
- MSDOS 4.0 - usotsuki, 30.04.2024, 17:41
- MSDOS 4.0 - boeckmann, 30.04.2024, 21:03
 
 Board view
Board view Mix view
Mix view
