//svarcom/trunk/history.txt |
---|
8,6 → 8,7 |
- prompt fixed when current drive becomes invalid (eg. empty diskette drive) |
- DIR: fixed /P pagination in wide mode |
- implemented IF command (IF EXIST, IF ERRORLEVEL, IF str==str) |
- added a break handler (running application can be aborted with CTRL+C) |
=== ver 2021.0 (24.11.2021) ================================================== |
//svarcom/trunk/rmod.asm |
---|
1,5 → 1,5 |
; |
; rmod - resident module of the SvarCOM command interpreter |
; rmod - resident module of the SvarCOM command interpreter (NASM code) |
; |
; Copyright (C) 2021 Mateusz Viste |
; MIT license |
54,8 → 54,17 |
REDIR_INFIL dw 0xffff ; +ECh |
REDIR_OUTAPPEND dw 0 ; +EEh |
skipsig: ; +F0h |
; CTRL+BREAK (int 23h) handler |
; According to the TechHelp! Manual: "If you want to abort (exit to the parent |
; process), then set the carry flag and return via a FAR RET. This causes DOS |
; to perform normal cleanup and exit to the parent." (otherwise use iret) |
BREAK_HANDLER: ; +F0h |
stc |
retf |
skipsig: ; +F2h |
; set up CS=DS=SS and point SP to my private stack buffer |
mov ax, cs |
mov ds, ax |
63,6 → 72,11 |
mov ss, ax |
mov sp, STACKPTR |
; set up myself as break handler |
mov ax, 0x2523 ; set int vector 23h |
mov dx, BREAK_HANDLER |
int 0x21 |
; revert stdin/stdout redirections (if any) to their initial state |
call REVERT_REDIR_IF_ANY |
//svarcom/trunk/rmodinit.c |
---|
133,6 → 133,20 |
owner[1] = 0; |
} |
/* set CTRL+BREAK handler to rmod */ |
_asm { |
push ax |
push dx |
push ds |
mov ax, 0x2523 |
mov ds, rmodseg |
mov dx, RMOD_OFFSET_BRKHANDLER |
int 0x21 |
pop ds |
pop dx |
pop ax |
} |
/* prepare result (rmod props) */ |
res = MK_FP(rmodseg, 0x100 + rmodcore_len); |
_fmemset(res, 0, sizeof(*res)); /* zero out */ |
//svarcom/trunk/rmodinit.h |
---|
52,7 → 52,8 |
#define RMOD_OFFSET_STDOUTFILE (0x100 + 0xEA) |
#define RMOD_OFFSET_STDINFILE (0x100 + 0xEC) |
#define RMOD_OFFSET_STDOUTAPP (0x100 + 0xEE) |
#define RMOD_OFFSET_ROUTINE (0x100 + 0xF0) |
#define RMOD_OFFSET_BRKHANDLER (0x100 + 0xF0) |
#define RMOD_OFFSET_ROUTINE (0x100 + 0xF2) |
struct rmod_props far *rmod_install(unsigned short envsize, unsigned char *rmodcore, unsigned short rmodcore_len); |
struct rmod_props far *rmod_find(unsigned short rmodcore_len); |
//svarcom/trunk/todo.txt |
---|
9,7 → 9,6 |
pipes redirections |
DIR /A |
ctrl+break handler |
int 24h handler (abort, retry, fail, ignore) |
advanced batch constructs: CALL, FOR, GOTO |
IF EXIST on an empty drive should not lead to the 'Abort, Retry, Fail' prompt |