From: Robert Pengelly Date: Wed, 18 Sep 2024 19:22:05 +0000 (+0100) Subject: More Ctrl+C X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=2773c45b1327103016dcdb971ccbd0188066d7e1;p=chimaera.git More Ctrl+C --- diff --git a/build/chimaera.img b/build/chimaera.img index 06c33d3..ba8e0bf 100644 Binary files a/build/chimaera.img and b/build/chimaera.img differ diff --git a/build/chimaera.vhd b/build/chimaera.vhd index 235eb5c..d02a78b 100644 Binary files a/build/chimaera.vhd and b/build/chimaera.vhd differ diff --git a/src/apps/hello/Makefile.unix b/src/apps/hello/Makefile.unix index 14cc203..df41716 100644 --- a/src/apps/hello/Makefile.unix +++ b/src/apps/hello/Makefile.unix @@ -19,3 +19,6 @@ hello.com: ../../lib/crt/crt0.o crlf.o hello.o writechr.o writehex.o writestr.o %.o: %.asm ../../utils/binutils/sasm -I$(SRCDIR)/../../lib/crt/include -l $*.lst -o $@ $< + +#%.asm: %.c +# ../../utils/cc/scc -S -o $@ $< diff --git a/src/apps/hello/hello.asm b/src/apps/hello/hello.asm index 4ed55a5..66c03e0 100644 --- a/src/apps/hello/hello.asm +++ b/src/apps/hello/hello.asm @@ -24,6 +24,14 @@ _main: mov bx, offset _msg_hello call _writestr +.L1: + + mov ah, HEX (02) + mov dl, 'A' + int HEX (21) + + jmp .L1 + ; mov bp, sp ; ; mov ax, bp @@ -70,10 +78,10 @@ _main: ; call _writehex ; call _crlf - mov ax, HEX (4B01) - mov bx, offset _param_blk - mov dx, offset _app_name - int HEX (21) +; mov ax, HEX (4B01) +; mov bx, offset _param_blk +; mov dx, offset _app_name +; int HEX (21) ; mov ah, HEX (62) ; int HEX (21) diff --git a/src/apps/hello/hello.c b/src/apps/hello/hello.c new file mode 100644 index 0000000..a9a47f7 --- /dev/null +++ b/src/apps/hello/hello.c @@ -0,0 +1,32 @@ +/****************************************************************************** + * @file hello.c + *****************************************************************************/ +/*asm ( + + "_start:\n" + "xor bp, bp\n" + "push bp\n" + "mov bp, sp" + +);*/ + +//asm inline ".ret:\n"; +//asm inline "ret\n"; + +/*asm volatile ( + "push bp\n" + "mov bp, sp\n" +);*/ + +unsigned char a; +unsigned short b; +unsigned int c; + +unsigned char *abc; +//unsigned long d; + +//extern void b (); +static void dead_code () {} + +int main (argc, argv) { +} diff --git a/src/apps/hello/test.c b/src/apps/hello/test.c deleted file mode 100644 index dc8fabd..0000000 --- a/src/apps/hello/test.c +++ /dev/null @@ -1,6 +0,0 @@ -/****************************************************************************** - * @file hello.c - *****************************************************************************/ -int main (int argc, char **argv) { - return 0; -} diff --git a/src/kernel/int21.asm b/src/kernel/int21.asm index e300cf6..f73c893 100644 --- a/src/kernel/int21.asm +++ b/src/kernel/int21.asm @@ -1086,6 +1086,26 @@ _int21_02: push ax + call _check_handle_break + jnc _int21_02.write + + mov al, '^' + call _writechr + + mov al, 'C' + call _writechr + + mov al, HEX (0D) + call _writechr + + mov al, HEX (0A) + call _writechr + + pop ax + jmp _spawn_int23 + +_int21_02.write: + mov al, dl call _writechr @@ -1190,6 +1210,27 @@ _int21_09: _int21_09.loop: + call _check_handle_break + jnc _int21_09.print + + mov al, '^' + call _writechr + + mov al, 'C' + call _writechr + + mov al, HEX (0D) + call _writechr + + mov al, HEX (0A) + call _writechr + + pop si + pop ax + jmp _spawn_int23 + +_int21_09.print: + lodsb cmp al, '$' diff --git a/src/kernel/int23.asm b/src/kernel/int23.asm index b422cbb..1af3838 100644 --- a/src/kernel/int23.asm +++ b/src/kernel/int23.asm @@ -5,6 +5,39 @@ % define HEX(y) 0x##y %endif +;****************************************************************************** +; @function _check_handle_break +;****************************************************************************** +global _check_handle_break +_check_handle_break: + + push es + push bx + push ax + + xor bx, bx + mov es, bx + mov bx, HEX (0471) + + mov al, es:[bx] + + and al, HEX (80) + jnz _check_handle_break.break + + clc + jmp _check_handle_break.done + +_check_handle_break.break: + + stc + +_check_handle_break.done: + + pop ax + pop bx + pop es + ret + ;****************************************************************************** ; @function _regain_control_int23 ;****************************************************************************** diff --git a/src/utils/binutils/as b/src/utils/binutils/as index 1c5f2de..6d9cd8f 160000 --- a/src/utils/binutils/as +++ b/src/utils/binutils/as @@ -1 +1 @@ -Subproject commit 1c5f2de0ea49b930fc16bbf187b1adb64cd01832 +Subproject commit 6d9cd8ff9e955a89b83f3e5fdd0605b6b00a1f26