Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #1555

Re: Some experiments in somewhat uncharted territories

From Benoit0123 <bgilon@free.fr>
Newsgroups comp.sys.apple2.programmer
Subject Re: Some experiments in somewhat uncharted territories
Date 2015-03-10 16:15 +0000
Organization Mac GUI
Message-ID <benoit0123-1426004156@macgui.com> (permalink)
References <benoit0123-1425644055@macgui.com>

Show all headers | View raw


During the last week end, I made some improvements to JAH.
The updated version now allows to select as part of the
"Procedural Function" prepare step, a mode in order to cater
with a completely private memory area (for simple, array and string
storage).
Hence the requirement to backup and restore values of those variables from
the main program flow is gone.
Select this mode (MO% value set to 128) when:
a) you do not require a globally set variable/array within the body of the
PF:
b) you can manage to store all your variable storage needs within 512 bytes.
Howecer this size limit can be increased by reasssembling the ML portion of
the demo.
Select the classic mode (i.e. MO%  value set to 0) otherwise.
Here is the Applesoft part of the demo (edit line 2 and variable MO% setting
at its bedinning) in order to switch between modes. 

0  REM INIT THE ENVIRONMENT
1  PRINT  CHR$ (4)"MAXFILES 1": HIMEM: 37888: PRINT  CHR$ (4)"BLOAD
JAH2.0.2"
2 MO% = 128: ON MO% = 128 GOTO 3: CLEAR :S = 0:I = 0:N% = 0:S0 = 0:N0% =
0:MO% = 0
3 BA = 37888
9  REM EARLY TESTS
10  CALL BA,1000
12  REM N% = 4: CALL BA,2000: PRINT S
19  REM PREPARE STEP
20  CALL BA + 3,MO%,N%,S,2000: POKE 10,76: POKE 11,6: POKE 12,148
21  REM EXECUTE STEP
22  FOR J = 1 TO 8: PRINT J" " USR (J): NEXT : END
1000  PRINT "HELLO": RETURN
1995  REM THE 3 LINES BELOW ARE
1996  REM THE BODY OF THE P.F.
1997  REM S=FUNCTION(N)
1998  REM SUM(I), I FROM 0 TO N
1999  REM CACHE WITH N0%,S0
2000  ON  SGN (N%-N0%) + 2 GOTO 2001,2002:S = S0: FOR I = N0% + 1 TO N%:S =
S + I: NEXT :N0%  = N%:S0 = S: RETURN
2001 S = 0: FOR I = 1 TO N%:S = S + I: NEXT :N0% = N%:S0 = S: RETURN
2002 S = S0: RETURN

URL for donloading the disk image (along with the source code) is
http://bgilon.free.fr/apple2/JAH2.0.2.zip
This is a working copy of Merlin 8 DOS 3.3, the source file is named:
JAH2.0.2.s

Any feedback would be welcome.
BenoƮt


-- 
Growing old is mandatory..
growing up is optional..
But the other way round is as true.

Back to comp.sys.apple2.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Some experiments in somewhat uncharted territories Benoit0123 <bgilon@free.fr> - 2015-03-06 12:13 +0000
  Re: Some experiments in somewhat uncharted territories Benoit0123 <bgilon@free.fr> - 2015-03-10 16:15 +0000
    Re: Some experiments in somewhat uncharted territories D Finnigan <dog_cow@macgui.com> - 2015-03-20 21:12 +0000
      Re: Some experiments in somewhat uncharted territories Benoit0123 <bgilon@free.fr> - 2015-03-22 21:19 +0000
  Re: Some experiments in somewhat uncharted territories Benoit0123 <bgilon@free.fr> - 2015-03-31 22:03 +0000

csiph-web