mirror of
https://github.com/bobbimanners/EightBall.git
synced 2024-05-29 03:41:32 +00:00
v0.67: Source code cleanup, optimizations
- Managed to free up several hundred bytes
This commit is contained in:
parent
115c9e0f72
commit
18942a9ba0
BIN
8ball20.prg
BIN
8ball20.prg
Binary file not shown.
BIN
8ball64.prg
BIN
8ball64.prg
Binary file not shown.
BIN
8ballvm20.prg
BIN
8ballvm20.prg
Binary file not shown.
BIN
8ballvm64.prg
BIN
8ballvm64.prg
Binary file not shown.
BIN
ebvm.system
BIN
ebvm.system
Binary file not shown.
1032
eightball.c
1032
eightball.c
File diff suppressed because it is too large
Load Diff
BIN
eightball.system
BIN
eightball.system
Binary file not shown.
|
@ -37,7 +37,7 @@
|
|||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
#define VERSIONSTR "0.66"
|
||||
#define VERSIONSTR "0.67"
|
||||
|
||||
void print(char *str);
|
||||
|
||||
|
|
BIN
eightballvm
BIN
eightballvm
Binary file not shown.
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user