mirror of
https://github.com/nineties/planckforth
synced 2024-12-25 21:58:22 +01:00
/mod must be unsigned
This commit is contained in:
parent
04aa3351ba
commit
bafbf5959a
2 changed files with 4 additions and 4 deletions
|
@ -148,8 +148,8 @@ defcode("f", find_) { push((cell) find(pop())); next(); }
|
|||
defcode("v", argv_) { push((cell) saved_argv); push(saved_argc); next(); }
|
||||
defcode("V", impl) { push((cell) VERSION); next(); }
|
||||
defcode("/", divmod) {
|
||||
intptr_t b = pop();
|
||||
intptr_t a = pop();
|
||||
uintptr_t b = pop();
|
||||
uintptr_t a = pop();
|
||||
push(a%b);
|
||||
push(a/b);
|
||||
next();
|
||||
|
|
|
@ -226,8 +226,8 @@ def litstring(ip, np):
|
|||
return next(np + CELL + read(np))
|
||||
add_operator('S', litstring)
|
||||
def divmod():
|
||||
b = ctypes.c_int(pop()).value
|
||||
a = ctypes.c_int(pop()).value
|
||||
b = pop()
|
||||
a = pop()
|
||||
push(a%b)
|
||||
push(a//b)
|
||||
add_simple_operator('/', divmod)
|
||||
|
|
Loading…
Reference in a new issue