mirror of
https://gitlab.os-k.eu/os-k-team/kvisc.git
synced 2023-08-25 14:05:46 +02:00
break
This commit is contained in:
parent
0641094a96
commit
474de0309d
@ -22,6 +22,7 @@ main:
|
||||
;
|
||||
exit:
|
||||
enter
|
||||
break
|
||||
|
||||
mov ax0, .msg
|
||||
call print
|
||||
|
@ -5,7 +5,8 @@ all: k.exe
|
||||
|
||||
src = instrs/instrs.c decd.c main.c regs.c dump.c \
|
||||
instrs/jumps.c except.c disd.c mem.c instrs/logic.c \
|
||||
instrs/stack.c instrs/super.c instrs/arith.c log.c
|
||||
instrs/stack.c instrs/super.c instrs/arith.c log.c \
|
||||
instrs/debug.c
|
||||
|
||||
obj = $(patsubst %.c,%.o,$(src))
|
||||
|
||||
|
@ -16,6 +16,8 @@ void _except(ctx_t *ctx, int code, char *fmt, ...)
|
||||
log("\n");
|
||||
|
||||
dumpregs(ctx);
|
||||
log("\n");
|
||||
|
||||
dumpfwstack(ctx);
|
||||
|
||||
if (ctx->mp)
|
||||
|
@ -160,9 +160,6 @@ xchg m m
|
||||
lea r m
|
||||
lea m m
|
||||
|
||||
# get code segment
|
||||
gcs r m
|
||||
|
||||
#
|
||||
# Stack manipulation instructions
|
||||
#
|
||||
@ -199,8 +196,17 @@ popf
|
||||
cli
|
||||
sti
|
||||
|
||||
#
|
||||
# Misc. instructions
|
||||
#
|
||||
|
||||
# Prints a character on the screen
|
||||
prn r
|
||||
prn i
|
||||
prn m
|
||||
|
||||
#
|
||||
# Debugging instructions
|
||||
#
|
||||
break
|
||||
|
||||
|
15
pc/instrs/debug.c
Normal file
15
pc/instrs/debug.c
Normal file
@ -0,0 +1,15 @@
|
||||
// The OS/K Team licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
#include "instrs.h"
|
||||
#include "arch_i.h"
|
||||
|
||||
IMPL_START_0(break)
|
||||
{
|
||||
log("\nExecuting BREAK INSTR\n");
|
||||
dumpregs(ctx);
|
||||
|
||||
while ((getchar() != '\n'));
|
||||
log("Resuming execution\n");
|
||||
}
|
||||
IMPL_END;
|
@ -88,7 +88,7 @@ void dumpregs(ctx_t *ctx)
|
||||
log("%s%s=0x%-16lX ", r->name,
|
||||
(strlen(r->name) == 2 ? "=" : ""), r->val);
|
||||
}
|
||||
log("\nrip=0x%-16lX rbp=0x%-16lX rsp=0x%-16lX flg=0x%-16lX\n\n",
|
||||
log("\nrip=0x%-16lX rbp=0x%-16lX rsp=0x%-16lX flg=0x%-16lX\n",
|
||||
ctx->r[RIP].val,
|
||||
ctx->r[RBP].val,
|
||||
ctx->r[RSP].val,
|
||||
|
Loading…
Reference in New Issue
Block a user