echo set PATH=A:\\DOS >> autoexec.bat
# echo '%PATH%\\temp.bat' >> autoexec.bat
# echo echo 123 >> temp.bat
-# echo echo %PATH% >> temp.bat
+# echo 'echo %PATH% && echo 123' >> temp.bat
# echo temp >> temp.bat
utils/dosfstools/mkdosfs --boot boot/freeldr/bootsect/fat12.bin --sectors 720 -F 12 -n "CHIMAERA OS" $@
push es
push ds
- mov ax, 4
+ mov ax, 6
xor dx, dx
push ax
xor bx, bx
+ mov ax, word ptr [bp + 8]
+ mov es:[bx + 2], ax
+
mov ax, word ptr [bp + 6]
mov es:[bx], ax
_list_push.search:
mov es, ax
- mov ax, es:[bx + 2]
+ mov ax, es:[bx + 4]
and ax, ax
jnz _list_push.search
mov dx, word ptr [bp - 2]
- mov es:[bx + 2], dx
+ mov es:[bx + 4], dx
_list_push.done:
and cx, cx
jz .L109
+
+.L125:
+
+ mov dx, 1
+ push dx
mov ax, es:[di]
-
- push ds
push ax
mov ax, offset _scratch_list
push ax
call _list_push
- add sp, 2
+ add sp, 6
- pop ax
- pop ds
add di, 2
dec cx
cmp word ptr cs:[_echo_line], 0
je .L115
+ cmp word ptr es:[di + 2], 0
+ je .L115
+
call _writestr
call _crlf
pop di
pop ds
- mov ax, word ptr es:[di + 2]
+ mov ax, word ptr es:[di + 4]
push es
call _free
push dx
mov word ptr [bp - 2], 0
- mov si, offset _formatted_command
+ mov si, word ptr [bp + 4]
_get_command.loop:
_get_command.done:
- mov bx, word ptr [bp - 2]
+ mov ax, word ptr [bp - 2]
+
+ and ax, ax
+ jnz _get_command.external
pop dx
pop ax
add sp, 2
clc
+ mov bx, word ptr [bp + 4]
pop bp
- and bx, bx
- jz _get_command.ret
-
- stc
+ ret
-_get_command.ret:
+_get_command.external:
- mov bx, offset _formatted_command
+ pop dx
+ pop ax
+ pop si
+
+ add sp, 2
+ stc
+
+ mov bx, word ptr [bp + 4]
+ pop bp
+
ret
;******************************************************************************
mov ax, cs
mov es, ax
+
+ mov bx, word ptr [bp + 4]
+
+.L121:
+
+ cmp byte ptr [bx], ' '
+ jne .L102
+
+ inc bx
+ jmp .L121
.L102:
mov cx, 255
rep stosb
- mov bx, word ptr [bp + 4]
push bx
call _expand_vars
mov ax, cs
mov ds, ax
+
+.L124:
+
+ mov ax, '&'
+ push ax
+
+ mov si, offset _formatted_command
+ push si
+
+ call _strchr
+ add sp, 4
+
+ and ax, ax
+ jz .L120
+
+ mov di, ax
+
+ xor al, al
+ stosb
+
+ cmp byte ptr [di], '&'
+ jne .L120
+
+ stosb
+
+.L122:
+
+ cmp byte ptr [di], ' '
+ jne .L123
+
+ inc di
+ jmp .L122
+
+.L123:
+
+ push es
+ push di
+
+ call _strlen
+ add sp, 2
+
+ xor dx, dx
+ inc ax
+
+ push ax
+ push dx
+
+ call _xmalloc
+ add sp, 4
+
+ xor dx, dx
+ push dx
+
+ mov es, ax
+ push es
+
+ mov ax, offset _scratch_list
+ push ax
+
+ call _list_push
+ add sp, 6
+
+ push di
+
+ xor ax, ax
+ push ax
+
+ call _strcpy
+ add sp, 4
+
+ pop es
+
+.L120:
+
+ push si
call _get_command
+ add sp, 2
+
jc .L23
mov si, bx
_read_batch.next:
+ inc word ptr cs:[_in_batch]
+
pop ds
pop bx
pop ax