v0.67: Source code cleanup, optimizations

- Managed to free up several hundred bytes
This commit is contained in:
Bobbi Webber-Manners 2018-05-11 19:43:27 -04:00 committed by GitHub
parent 115c9e0f72
commit 18942a9ba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 512 additions and 543 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
eightball

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -37,7 +37,7 @@
/* */
/**************************************************************************/
#define VERSIONSTR "0.66"
#define VERSIONSTR "0.67"
void print(char *str);

Binary file not shown.

View File

@ -50,6 +50,9 @@
#define DEBUGSTACK
*/
/* Define STACKCHECKS to enable paranoid stack checking */
#define STACKCHECKS
#include "eightballvm.h"
#include "eightballutils.h"
@ -115,6 +118,8 @@ unsigned char *memory = 0;
* are helpful for debugging!
*/
#ifdef STACKCHECKS
/* Check evaluation stack is not going to underflow */
#define CHECKUNDERFLOW(level) checkunderflow(level)
@ -127,6 +132,15 @@ unsigned char *memory = 0;
/* Check call stack is not going to overflow */
#define CHECKSTACKOVERFLOW(bytes) checkstackoverflow(bytes)
#else
/* For production use, do not do these checks */
#define CHECKUNDERFLOW(level)
#define CHECKOVERFLOW()
#define CHECKSTACKUNDERFLOW(bytes)
#define CHECKSTACKOVERFLOW(bytes)
#endif
/* Handler for unsupported bytecode */
#define UNSUPPORTED() unsupported()
@ -761,6 +775,9 @@ void load()
int main()
{
print("EightBallVM v" VERSIONSTR "\n");
#ifdef STACKCHECKS
print("[Stack Checks ON]\n");
#endif
print("(c)Bobbi, 2018\n\n");
print("Loading bytecode: ");
load();

View File

@ -4,9 +4,9 @@ pr.msg "Sieve of Eratosthenes ..."
const sz=30
const arrsz=sz*sz
byte A[sz*sz] = {}
byte A[arrsz] = {}
word i = 0
for i = 0 : sz*sz-1
for i = 0 : arrsz-1
A[i] = 1
endfor
call doall(sz, A)

BIN
test.d64

Binary file not shown.

BIN
test.dsk

Binary file not shown.