From d0935e041e1a691a121cecc2de72a65b301680ce Mon Sep 17 00:00:00 2001 From: QB64Cobalt <56514693+QB64Cobalt@users.noreply.github.com> Date: Sat, 16 Nov 2019 16:20:22 -0800 Subject: [PATCH 1/2] Update qbx.cpp --- internal/c/qbx.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/internal/c/qbx.cpp b/internal/c/qbx.cpp index 55e5fc8d0..738cb7776 100644 --- a/internal/c/qbx.cpp +++ b/internal/c/qbx.cpp @@ -643,6 +643,10 @@ extern long double string2f(qbs*str); //Cobalt(aka Dave) added the next 2 lines int64 func__shr(int64 a1, int b1); int64 func__shl(int64 a1, int b1); +int64 func__readbit(int64 a1, int b1); +int64 func__setbit(int64 a1, int b1); +int64 func__resetbit(int64 a1, int b1); +int64 func__togglebit(int64 a1, int b1); #ifndef QB64_WINDOWS extern void Sleep(uint32 milliseconds); extern void ZeroMemory(void *ptr,int64 bytes); @@ -977,6 +981,18 @@ inline int64 func__shl(int64 a1,int b1) inline int64 func__shr(int64 a1,int b1) {return a1>>b1;} +inline int64 func__readbit(int64 a1, int b1) +{if (a1 & 1< Date: Sat, 16 Nov 2019 16:21:51 -0800 Subject: [PATCH 2/2] Update subs_functions.bas --- source/subs_functions/subs_functions.bas | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/source/subs_functions/subs_functions.bas b/source/subs_functions/subs_functions.bas index 895cd07ec..015979061 100644 --- a/source/subs_functions/subs_functions.bas +++ b/source/subs_functions/subs_functions.bas @@ -3407,3 +3407,39 @@ id.callname = "func__getconsoleinput" id.args = 0 id.ret = LONGTYPE - ISPOINTER regid + +clearid +id.n = "_READBIT" +id.subfunc = 1 +id.callname = "func__readbit" +id.args = 2 +id.arg = MKL$(INTEGER64TYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) +id.ret = INTEGER64TYPE - ISPOINTER +regid + +clearid +id.n = "_SETBIT" +id.subfunc = 1 +id.callname = "func__setbit" +id.args = 2 +id.arg = MKL$(INTEGER64TYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) +id.ret = INTEGER64TYPE - ISPOINTER +regid + +clearid +id.n = "_RESETBIT" +id.subfunc = 1 +id.callname = "func__resetbit" +id.args = 2 +id.arg = MKL$(INTEGER64TYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) +id.ret = INTEGER64TYPE - ISPOINTER +regid + +clearid +id.n = "_TOGGLEBIT" +id.subfunc = 1 +id.callname = "func__togglebit" +id.args = 2 +id.arg = MKL$(INTEGER64TYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) +id.ret = INTEGER64TYPE - ISPOINTER +regid