From bb7730d3ce66eaf7d29caf8f8dcc3452e6fa8eb7 Mon Sep 17 00:00:00 2001 From: julianb0 Date: Thu, 16 May 2019 20:11:17 +0200 Subject: [PATCH] jcxz ftw --- as/Makefile | 2 +- pc/INSTRS | 3 +-- pc/jumps.c | 7 +++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/as/Makefile b/as/Makefile index c72179f..29e151a 100644 --- a/as/Makefile +++ b/as/Makefile @@ -1,4 +1,4 @@ # The OS/K Team licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. -all: k-as.py +k-as: k-as.py diff --git a/pc/INSTRS b/pc/INSTRS index e9b308a..258fc6a 100644 --- a/pc/INSTRS +++ b/pc/INSTRS @@ -133,8 +133,7 @@ jb i jbe r jbe i -# Jump if RCX is 0 -#jcxz +jcxz # # Movement instructions diff --git a/pc/jumps.c b/pc/jumps.c index 5123fe7..607aa4f 100644 --- a/pc/jumps.c +++ b/pc/jumps.c @@ -65,3 +65,10 @@ IMPL_START_1(jbe) ctx->r[RIP].val = v1; } IMPL_END; + +IMPL_START_1(jcxz) +{ + if (!ctx->r[RCX].val) + ctx->r[RIP].val = v1; +} +IMPL_END;