Added new files to do range checks

This commit is contained in:
ceriel 1987-10-27 11:55:59 +00:00
parent 04f0550f1d
commit 4974cd17eb
5 changed files with 116 additions and 0 deletions

View file

@ -32,3 +32,7 @@ confarray.c
load.c
stackprio.c
EM.e
rcku.e
rcki.e
rckul.e
rckil.e

28
lang/m2/libm2/rcki.e Normal file
View file

@ -0,0 +1,28 @@
#
#include <em_abs.h>
mes 2,EM_WSIZE,EM_PSIZE
exp $rcki
pro $rcki, 0
lal EM_PSIZE
loi EM_WSIZE
lal 0
loi EM_PSIZE
loi EM_WSIZE
cmi EM_WSIZE
zlt *1
lal EM_PSIZE
loi EM_WSIZE
lal 0
loi EM_PSIZE
adp EM_WSIZE
loi EM_WSIZE
cmi EM_WSIZE
zgt *1
ret 0
1
loc ERANGE
trp
ret 0
end 0

28
lang/m2/libm2/rckil.e Normal file
View file

@ -0,0 +1,28 @@
#
#include <em_abs.h>
mes 2,EM_WSIZE,EM_PSIZE
exp $rckil
pro $rckil, 0
lal EM_PSIZE
loi EM_LSIZE
lal 0
loi EM_PSIZE
loi EM_LSIZE
cmi EM_LSIZE
zlt *1
lal EM_PSIZE
loi EM_LSIZE
lal 0
loi EM_PSIZE
adp EM_LSIZE
loi EM_LSIZE
cmi EM_LSIZE
zgt *1
ret 0
1
loc ERANGE
trp
ret 0
end 0

28
lang/m2/libm2/rcku.e Normal file
View file

@ -0,0 +1,28 @@
#
#include <em_abs.h>
mes 2,EM_WSIZE,EM_PSIZE
exp $rcku
pro $rcku, 0
lal EM_PSIZE
loi EM_WSIZE
lal 0
loi EM_PSIZE
loi EM_WSIZE
cmu EM_WSIZE
zlt *1
lal EM_PSIZE
loi EM_WSIZE
lal 0
loi EM_PSIZE
adp EM_WSIZE
loi EM_WSIZE
cmu EM_WSIZE
zgt *1
ret 0
1
loc ERANGE
trp
ret 0
end 0

28
lang/m2/libm2/rckul.e Normal file
View file

@ -0,0 +1,28 @@
#
#include <em_abs.h>
mes 2,EM_WSIZE,EM_PSIZE
exp $rckul
pro $rckul, 0
lal EM_PSIZE
loi EM_LSIZE
lal 0
loi EM_PSIZE
loi EM_LSIZE
cmu EM_LSIZE
zlt *1
lal EM_PSIZE
loi EM_LSIZE
lal 0
loi EM_PSIZE
adp EM_LSIZE
loi EM_LSIZE
cmu EM_LSIZE
zgt *1
ret 0
1
loc ERANGE
trp
ret 0
end 0