what is the largest number that can be stored on a zx81

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Crayon21
Posts: 66
Joined: Sun Nov 04, 2018 2:33 am

what is the largest number that can be stored on a zx81

Post by Crayon21 » Sat Mar 30, 2019 8:10 pm

1: With a 16k ram pack
2: without
zx81: great yet flawed
Zx spectrum: masterpiece that keeps on giving

(wish it weren't so expensive) :o

Moggy
Posts: 1759
Joined: Wed Jun 18, 2008 2:00 pm

Re: what is the largest number that can be stored on a zx81

Post by Moggy » Sat Mar 30, 2019 10:24 pm

Not sure what you're asking here but I would assume the largest number held accurately,stored or whatever is as-per the manual states 2^32 -1 (4,294,967,295) regardless of memory size.

This limitation is not restricted to what the 81 can work out then display.
There is a Toddy Forth Forth program (converted by forum member Kmurta) from the Jupiter ace Forth which will readily display all 12674 digits of the factorial of 4000 for example.

User avatar
XavSnap
Posts: 576
Joined: Sat May 10, 2008 4:23 pm

Re: what is the largest number that can be stored on a zx81

Post by XavSnap » Sun Mar 31, 2019 1:27 am

:lol:
Many, many, many …

Just type:
1 PRINT "{your number}"
And stop to type-ins while the display freeze.

note: it's better with a 16kb rampack.

Type RUN and the "cont" key if you had to display the next screen…
8-)

User avatar
XavSnap
Posts: 576
Joined: Sat May 10, 2008 4:23 pm

Re: what is the largest number that can be stored on a zx81

Post by XavSnap » Sun Mar 31, 2019 1:39 am

1 LET A=11111111111111111111111111111111111111111111111111111111111111111111111111
2 PRINT A

User avatar
RetroTechie
Posts: 365
Joined: Tue Nov 01, 2011 12:16 am
Location: Hengelo, NL
Contact:

Re: what is the largest number that can be stored on a zx81

Post by RetroTechie » Sun Mar 31, 2019 5:55 am

Back when I was learning Z80 machine code on the ZX81 (and later the Spectrum), I came across a subject called Mersenne primes. In short: numbers in the form of 2^n -1 (for some specific values of n), that happen to be prime. Finding big Mersenne primes was of course :lol: the domain of supercomputers. But with some n found, actually calculating all its digits very doable - even on a lowly Z80 machine.

The short of that: 2 digits BCD packed into each memory location, do some doubling and DAA (Decimal Adjust Accumulator) while keeping track of the size of the number, and on a 16K machine you can show the ones up to around 30K digits. On a 48K Spectrum, the ones up to 80K digits or so. Iirc, calculation time scaled with the square of n (so 5x higher n -> 25x calculation time), but in the "doable" range when the inner Z80 code loop is coded well enough. Don't have that code any more, but it isn't rocket science... :D

Checking the Wikipedia article, some that look familiar:
#27: 2^44497 -1 (13395 digits)
#30: 2^132049 -1 (39751 digits, that would have been ZX Spectrum material)

No doubt there's many subjects like this for the big-number-lovers among us.

Moggy
Posts: 1759
Joined: Wed Jun 18, 2008 2:00 pm

Re: what is the largest number that can be stored on a zx81

Post by Moggy » Sun Mar 31, 2019 3:41 pm

RetroTechie wrote:
Sun Mar 31, 2019 5:55 am
Back when I was learning Z80 machine code on the ZX81 (and later the Spectrum), I came across a subject called Mersenne primes. In short: numbers in the form of 2^n -1 (for some specific values of n), that happen to be prime. Finding big Mersenne primes was of course :lol: the domain of supercomputers. But with some n found, actually calculating all its digits very doable - even on a lowly Z80 machine.

The short of that: 2 digits BCD packed into each memory location, do some doubling and DAA (Decimal Adjust Accumulator) while keeping track of the size of the number, and on a 16K machine you can show the ones up to around 30K digits. On a 48K Spectrum, the ones up to 80K digits or so. Iirc, calculation time scaled with the square of n (so 5x higher n -> 25x calculation time), but in the "doable" range when the inner Z80 code loop is coded well enough. Don't have that code any more, but it isn't rocket science... :D

Checking the Wikipedia article, some that look familiar:
#27: 2^44497 -1 (13395 digits)
#30: 2^132049 -1 (39751 digits, that would have been ZX Spectrum material)

No doubt there's many subjects like this for the big-number-lovers among us.
Speaking as a fellow big number lover if you ever rediscover that code I would really love to see it because as I'm not very good code wise something like this is rocket science to me. :oops:

User avatar
Andy Rea
Posts: 1530
Joined: Fri May 09, 2008 2:48 pm
Location: notts UK

Re: what is the largest number that can be stored on a zx81

Post by Andy Rea » Sun Mar 31, 2019 10:18 pm

lets assume we are going to use the whole 16K to store a single whole number dont want ony of the rounding loss business with floating piont numbers and exponents ( although the number you could store would be huge )

so we have 16384 * 8 bits to store our large integer (2^0 + 2^1 + 2^2 .... + 2^131071 ) which = (2^131072) -1

OR if you like big numbers

4014132182036063039166060606038876734377151027041418995582553806466901368729258341160522025816124993789993695822370688304664951507188547123423222707028462645744504495099771236039772731479526109211090004311794404240339124784547422345216014091269896242057728789320308388075464535693734707938810361158822889129810698160881991361391615727898487922111925954357866231992015566112008236187570239498407927683927919775842288663953197267327615522763990546974302225808428095414868354189887477547130070092514353241631780155439824875566969089406890190453301219401944755635782011004657947505574085800780957240830989405542027471697598070708223889360327246648360250590423193485405740024818660966396088809547901243541112991057294564493176030196570968415627054119386294217737236705829632322635830102002662416478438021760275473366229548390019965427781460843016919698486005106981924856484135189126309511355753691653992328843645226535251273257107207655144521985279194687670618137133365061767680692604326802596487142424879424052336554494321865741845750005414127789039482660494669119722147859831209117695710217533300873521325189619906400613838224465802145638763375814734209939839362619843254361854200935168819098750162527330741262315680533040564205957680744473526587521186729552763984974171967043329744088725132917968485124011517373906219196506452837501009780475231936674958303684325425540235711585231786086215390697180427689333406191129678187071298761090238199532583274628668255539551286659571639463666278761674873780891713295358304373630381316642367910442138797034280478845037624720681884127045266971966132114983342843060225291800998287388520216891035412250834037533732042360063710863391716379631799881707736609524346067431213693134871211594265410252790425524534272056805082763168832785380055839924774513993312872314696842207051788925531326197927999177991421171128255733182296142518727575876101593203121573373469932821398066544389206962941141912977252572232867135437096743144409526348896093972589490165188215640760729511639332407683269230949843736635138894075691687022126305813977840524433219874210358515920200231755056725620223215331388220131477362331119420435167846194881185458654851583930079821808678398456988892271572381964480265039471649297678899125791655447634896125360321191630695480343247812206582942215664613839158662648407403549691008421277331933733296802727847751289740183232533826912134138874411587537072148434489199610825499112354149659416715243020346182605006236549464809827596184003972133641052969706618571561687011704990178047065972378213930473698742510372763853852826260631953919612454996794566066156884728715668680906027006860236291939118231676592907769781022362456768586214151241004159221927524018370878848684658164187227120264996078166702143742949273872723291189478841760522549189798371468818876307021543260191247813116898406629847737387213350101952387350770822381283290336805039909429093246363236388892554180007123150803933422140214159097502754441156418937483080165530589247735955574364496286938362823593135322482901755392013176188071632369230705598053524807232330332244850755770773086552102546479856865241592742983108951587550272842151337427500985790733257446974778514717423322164753741064203343873911505959859894843401346764198084574888570021582049897987375412534723203744213413544913921005682952291246029696644695148625577845540165449161494518865963573605166219797587702952678929547091472170854505976772092211830161122361692991516152705668722970188580451007767844433986239967364518420942072166146801482167949547691800161112961158906423261625463823863487993193561114681790843138704920497219883815661976658831769131758793119824969001836745498182398838340648927301879152764226110118671378678796232654817311851742957558547201689875931549991515035340972187105911864648544236836260504847533198372681672129543186083369951735634161845926675644115399774010625408990786348280910523027081645203785639678961312201192456238696520344039542130839856702031559650739069883838674250667916543006817208656138057336626345130349434110433864479062478550035029469824739027938916240527879813120208815523515779675977148726193656755629019016267380677895569115426761646230900288879599082370222089623761745116821667630909113297053145987339042926308730773608693851954656779816437471443388320939306664827788631871296953668897075687483930099227986839760048957379131637875344314107802027446160539266234293408604986954900983474482565227972953603366716227879694033469601687058461710870334469254188547991362387356445617844755230507550536963112039082535792838287188699545369099960024542135080095877346531176357217501893061794845596185695372386978011683132185583747282044356978640614686144305148838937966059778731252315662517317356452764543529368758499128496173025949468596830641128630126982569680227673151994682929383128359400800730647033009742194969397867732106855292305985907659610050250864697979637508638430748544527754238950354389404571972113035427133452477480922100499433629582296479031248198113154187002474014136277395295167051445941127918696437363960957340926932413952086407326427815908876047942365777403903909229226252129092284179163733102953047969448532689603563619318243124090419945712029201139189832010659468563854681499997644274767030324988966550143346180490169487404817781232236796354488293240003979784459018374622874519797289160250924013077191644744667079831907446016014675047387387849879634538532924759700314058964008310063071179192227444805709827095742202129386405849272260737870769456295985734252291272707948263365184386038334687999156723323731035874348731014319014672359686757028278160882218782815645825735630974163177508691319192847566774051552945532503104644040097190905665204611410283248812046204637327671846235824873113373034123535851718551400885999338937594799593962005964839702111477601581045672064416926126176740128698981250198894737842534454809505075861201705184249049902802765451776105523827736706727962349617080352862427145533868638674647621635903522376531004186274084864319795690579816037144710982537578574501401964606734516938171383983632188696122779521156237080602734546665241462878930312520760735314268127853512114206413184372047800360825636519029106214813659202770513059287824118965441521216286434750082511096818238637831486072817169107328121066318430424141551101448255356027051112429885809472561769503290478901969977310426678486943015192324838295069433027716466240050601698187879827464980534758753486354416047446209361934916329537938495521099464116817873898064615746425334307993580485350546795688460002265981773421773567346574241551369109003764817123662223617694812212158169860165209587231204816186164040908062427057433374354333512098587837751590927585021517620279297240368736722183517705003024583189908598536152163526107431442854174391559901463745686622770317539213510723170810141972866483922634430545450911424091655970619224266853425281308205026202294271525889978948848786451889351657070521050683440519622278045532953343858160953573822408291017268710562303350845615817951524349026567175895021778929616302540029650084377784855751579600269157963675920313876164533388292536102158206357715729658280040433132612140272022103947915774047681394936859812993227042855516834600928710152852398138594784429182314097140687415536884945999890119934480542332095414567022677110183124088577034207184035223269746212524708320333384846963664614426420999338980357883890451385386203823384441967107049845111443729321714754258385305719682104264623984894166226966604533114583914334886768314527778332346443260144764225200780823816350140331007279882497628037111262945933483440250886848466844285259801201047044164028789036672797521410884417114481113064890410508926775148007503192306944872367174516769239565732199135780783025193750190215687733235002528390196251747313108762067901840785138565711849300657314346796967787701918147432435368880447718801737606561365196160911276454420767194347998793760385338214424990342842862610858256411298097379924586198393594857153193649535420869601733255913603748735108955767125860412798934582791136590805835437006214619180833467538076124961206622745210375182783108944606061279552864482480673711218660245187076021181567794358666390037640555141608240333854073338043534429832182940110490657817714431406115312869550131360990262744133923687718517425890292711139888287121121169572479514569137506538532660065609376222907442241190395156802180983994401113294687869686532511825311652162444723355095362226595495851115378621729550619060175934795677858252326354523788281947715246424141202934670245380209752183345079219497823320697779797568188823897392439665907151941584911252454491393065641220012500307075134569170546657950628513232706438968999472833971666066853821669755513289360283904818899339170381382830023193685137019576555367344397397500345907203142598676169121614999422779372579464626191089018971078076898761801244103195495210458801583769766231991406931405001468005925383399201077190857244032943731898662908108327191861690909470351138983031879129637914513608632467782348730881613284583111745366299071443307263549292599904843844855174554634025101202206924639936318383190055108648734604528810643754584159097664780111072742553271812943448210019770733791851140909523998843075407964209315192369659421520580000397483091476492606940468048281634901478780014425466903183012195313405040260181937874135100391211424280568522832217343218449566212577839857429517773391325234970123982710656842132962072713670531585628640580476302740569446074057129250670136192085185275185779311649428558491838627836713048047320570250150645544212994809623734780024674994219129671408354527116135589032292260877830511009195805857592537799609204241901732311725470142447799886353484515819626358794478314752255102283719737644618375299683266816023955504186817402439459985266551465059469043798811380521824185863846994738759453069525025684128069242698184909729161080931680706454988296074915640851308149520496483541940056350562485344038487968200442973606174886536585643269441491537565521167279510356916025121335081257328911536240083436352408573331163048584890056692764867498736724967285937871063837364337621755449191928472249494309408397935142908533639574359432700608342105925301578912251377855985573358344672634864198752515613452910223366635904982715715461770104747504089416677887790075318553635109801839887000776413486686719326133277853012682629220681412084427939358117833274566986711663155710308663779187708049545831766986000316809626987410586036153344353518702949856385414013504665443220335274655069539917576038076933068673399231542660016785346281934674190287133321393865039012585301516288471252445626727183613790287375264863440341382950289536738341081070823467072641662638160920689079423415565415544093523000909042459655499558347303116788318768790020786196449106937448960496335000065625994308769918218117532397756112154058514439232714731547625428029301926759401192751887850518150985316736590769370275349296845281095433853324460820026096959856238442741949740512644749005458158427886614712986993755017155932619085888623668510044429325611225280467072107378374969832028261176123924402988656792912890438942424881406263936739195642564927755818346129962830564952862008315127847743704432224501586614191621134121414084766616850004752855737790449381521488307878119389635677152517700443598625113019383248895522656924874676078083365846741835696039642087136059892798010612944067324441233534104611388434095357600417585086903206201518724858670506731668441063355877998945850297008155748109516501339708308398677435237718856664102366195317472530863499414804202191902618201135135419339881515962422512857025124530919065190851292486672103057931987171154027738347902521013817932635496408110387972031749255469418772947038989633740538053684839862500994756773716881213362483372906037927970516028503893249938370998090355966343379594543393857619439969073876416575475031357342100897959643626247141091139113346430912218421332426397617431021590033646367648111866473215333561424765576016929343958665819514782393467237369306387879965393961506126345841089840597707284135690717573248058222433716097790974306041013186967353434100413872393337984581403537366546678381981115735252874653295049715936996306827362887519103246761552934739345207395509749551977003395029962758237343028420333856980432072114541711649988833361686311038725610601607452260800276604537588086629832393662151908732471530331390503598243861105289349754646633675165958622507210044676919618551144191211291948005031985175482748170959930115956149816059343618725964259144545635518370891105083518566650346326164332880670949594501221008865226782171403017037306385834766757756908497060699036637472403967682742063471456284052859300793318493890600834155472228151930479075648450763095792020687833295869010571410169415467895893923766234397059568374301410196033568385224669534494422044604529886447812303243369815606920089024378304637233100419682131167147683138237103836396146863068481497571075313218664281831894773101811973809037521256466043980717523127265465567042185267821091598837152282635562943239683700658828560977961472165705594943816999433425426766733718476472367893845215684320740612582945401570535852174911754718954037420050461252619221549665725031769139664740112317369998809909948202566349256451101570496666251245369829370047942181073261802638686307812145729359707078844999721963284844362680955941477223282704692602722551714620971927977590786466216404705670985017117826604611455959782225613566586016236155091134079620941423490044733734944396550570831455615770556197519856885379072617046894057442615170419480314764677588198245805514991110708278940489929815984675675250952479312601790676807548216870577371326887521518616329453883171165575520660362288398780799764281234277833869649816926108430437360963685319738454724877162529834153355494976546785024962619724067057664631770594248598642761728500729576216980475739090008569984843050074693176669966849426076793075347697354084406617389968364623754360445986017960849084658844161935174736658188484708144038671414964986538071697177283348104836430965020294109632015437996877591862615018792846939194762191455847664016969317280909644729562757288803470163283362836582801704682422551223524506336412190781232068031185091769869744931436653174905514147761661795615257091424626870921426153772807334619515077604027952734976964435745649982854244359572650204443485611522379011929767598037111863487441562070878839417195534319655201269956226091676001307080771515175957150512405356532822536302497166554993412071224143949961699966003179640440528339832860296716347191119277100624886651043402734594260451659728157939427399723866960225757348939016841178417724932792842710235644959285595810814178897596521733762549230792922096541997316437207126341990215143563343225996579081761345505417456543760556902238498414192686706350887441417030898964773106560825204937573907394584813121610631479220095886125576521265559115853565408661656648710665753742826354099309715810718586688386166739695360105153732730810856363115705196930450948164992978356889200164509197423055011582422464983146526410945082677782335972739021354538247235307628778236390018163762505814714880859010783891710645715508502642865818878885105510899076614850325368534907284181813661027044834773040190276150126054961895874190384311374655847147296725596621786811776219607455852197837077254961182259087277750214673688771038775480187275571252382373713598978744791329047432403983932004244483211652502611752940211118201058337234584034864574227810200730590127781709506138200593936779546014630761206017320716612138785694203059538064755958660196119388582888366460140254991004358012838108699804776204688584225575662975980043946364442061016378143365057147725242731478437916914945007628740732858651528582124707039037955659921200984589653967290356671822766500551504147096062559238712097470401466568328488127128944142333691791644053321208072117162615223122987279758153437976713979494564324839309455758207968141493094108989459309112061797912505115997599779734316634642787662861730837554573462339745191748434848718212564814399088890050558563286079628077673083829772294639480998765110246644620219192425600828996562323995526174157897858707146118489491816556359795756236851923837194287030905959361479970840400143320428366606885025067331691738040202055787012703056951782823888375506208988341157408228503942543079543770940443923976231093230318814331402474723753800935580269149469917368514574090096348578363321547574189770258467807477633852131070551000640054998215176863242889754758529656993218524750841275204785416446508661614647568979170309980255454798241426276915609241289998999441374750551762499989889776202922935559056865380485853520295522188744880920554250457015419395009003698380752089875202158738238319050876794599845412793967035367858531763921137171562917168105470402413558860177750713812621593283779321401400233370444782744252825896616155710291863815870331853585385758668507067576817342453134743338486664001732164359176960876199706001844975434858293165037162767244454671714475115808657642963552747840387966052546961337581079959622912645265343467678764190406571477253426299736077244260618237119651858084687036618695794075478789311587417059711343431227303350973799387878820501939565505465074594025436036966165326241011378797146265125327338463869344259066761066708758833017239984197008948737740667243072361128617406867859023220628124060993563955305881007343422807152945373290736658535872277975738221441943388251274447917399816259299528136009365562772905944119535864755915645636481389721332489402998780438636631270258475271207701504449959513826917567118882270665697324654384539229093273515371145657367473351701477176058287971525132123630231302192818809015653271446364720664677553548552591939892622312036148679132676222630440973623016172572796318062245769564016065503400855132972119620506711200765168117939786675101936469765690013861859011813740916497238562803149602498800743366839594464102222803276025264020852530869628324622203235960629552097202049867177844618660210541628779338833715233540816837614040165594121213747804550323106645804853319343703095281130779452288398474053206030303124075718699502769043354788987366303158458622216238559388852586287397244823587628905287478185055937738386553460517964970178405297818574001552698590403422567780250925573684712440051738280186677970204727172629630250807588480950618513205146384314670376008562962889264152845320978121184751157549620353870769614740394880734501759269207166413065178816343866013426191134590442802370423292149028056236608844109615255164543338823924604724010260098700884832237411150539327434122637626938602730735567837232664475826678490431572548909373831937962691028377457710962109223347737888551476979770134673578428196780307228525530719932119728519681020056415065579357762138062341940715505658351032187943326481465363443863803288110372057213933086575266979834114281470948733317432538033803753683322267351759794373856980502790076050489035615460200962483659715876640167205197093480143268848588887523572869448200676376187943746855377974486709054344584706188400881524241541391111150657380625806644492114953522924820276748689110132199293929664946288230813053178306354648926761437335954106994213287933139740635598749442553854302259023579655742203516047488166774689447569867936622820611204174605992950298769916077128982710510288196427378103368565164358036180004462488782696183306161348948232055760805161621292732118579698583726535923141524929496406363413864269242809640344703501492582452690207020817139987977758629694318006602700285855738200063021223919333172965177631394627287558397039465292625282839307496623059783681956962283709629525150084752829826413171823267961454311822679808362195466731957355942359238281197674840013554610317457007073447347555573247289794213606244753195388483334301123060067869123641067367400662684880401594438208468350024707708829070222659764366228295547652120614526659158515804151065386675507811098963031107165735090412267764271530335591618530735740446073375852583244380837916461995678501069928298475649775376625135157948147430845819708807270087123568447382546399604201642056708879576050534869014874330086255052538159839286402227545108717169973795449513568196146492612661017844433986693504400636793705628179607690520396302365359326058011744993452664586783672366992937395096218263188368979803013281224849637296442141604562461162491487916232984232571386163189599947711025232461545410107189286669897464249267488386815630421031187491074169125825170807382257645180821743080058968318717203308067308430306008719215999449549275186652855329514480288672236238137561214814466389304839692226820467175658389499720385721411105875447062795842543723282133190827930422906881951079517628186936042926475582499991844669144045926786553864972953423185548601733151216289576168751452442756075554834451826997459883888370003537652029989534356334645187913576065296792644524200824584132664698775130541572175057149540461321494098316209986410309373087546472581337568958627121819007771825027522508287259305852577876388306401427150201948576417401656477372167355512124351307696967324497195496192739279215969258543281938589966654331010867898501990694317165024492189477378166203114027287886864811921598100732112244472230470554383307370299418471731149022017754359690346403013127778918768231606030509998499642148046196935810238064412531126176156308402893998480786811137872744116447605557524431862992124455086194694346958998213418949062771097472347167350139668646981167262664987259407795730228841737389025744020061321542917633986016330050107026361576525861361343063325677323542710062288653622008100246365528887395634280352106633520268540358179909328076856361340557918726583703265608526215873247374438128953980193021781235856634443870531703734512403790773617204413172216046274108987822929386890747041850246872279320141016139210667033177852792102956417783343165185457063261014219019520235689446075505595529429106951281454091113243566908586495716555268930016123745659467401133529140474108004345232048212474448247768159489601013130975476694099832314918715403248611252016649922870384793692622229702610106986985893119003277409080679262329717165143031612328332615183711602787127836569009303906567838743875732384487702190656722551392684192185152900208659556329503223694369365936502102766611755792835591109286320654357979406231288936371342647544766199694127510725974843267121938848266208727537109341946427283767460259820749824899325101096764583474599804744627964518125872088655466147810233418924212562023675468901778045807940836323107298408868655304836421435151585464449138540150345465287526413345767386761993053273799594296798277380929249849357227606453580704529153148918715666037355647559732620792511746446385929050322349254324570411407740388768669446180113069843465434315221996105127890401599662006197214161055084961947355022344753536314097871510439160892202614670191975302380638766097843290952324948930552090545562940368121762216843274341603413427737554334409079094656810056060243733369584954911218729530084716394133205309124662246096755881559721492929181900212738251392916283098708192082807933814206925026586812173246109020886948080388323334532916853674293858738746575892137769457705381830230677106564567006150503545480458411511998028515408053429026809142780692764408220248254464937173642843127962447327355407015168381094802887654612384524560495973919708044119957466092904213848780764642494233732293224036130949318033995088929763380074431871523703593426236859383367085483569982629686960150819843615701884209216590737774519614344445579276002239274776296217803220678929087832467329479669456393936850538058021066265509788330120339443730684041783493433403368660115853967277552792249908020009855627048227361655544622682459131193333057521100975332158433023062932561369835916252724835530963063956451775313220617962849596175095470955736265891458562873902748194876719191960799278465072154943455540417890854465225477767693389605168449190478542196589501573826166025865606146645171339224009294572597815717484786765737153288478556654851482881403515032894695820372415060115302875192073646119765406141480092567413252348512968515582746901168207643774717589960607598404329437564395139994329635730111110633681700603685437336109634272210103033418054450224938083739879836153523722555040316183597103138650374921578649988715021842250779725214483676183162913274020607114407980836315188919652318618301784597885748980354018002765408849399964518595757380248305671577492554441816003221000192908285620784557292986217457457008937003087353143312855574041832420112317625519541622257673910321225464856548382355266230023024517109008815119619894335099424334371497881198051261886997463187492354570040820824145462052230431910145690364685647900970770134523462958114721686909957771284518586588615757296975240405197323461312166300837418411100951691362769269009598174972554545066600282223191709144658531113305195792079519199933519361197220534355669335573638622367318682415058083685744459089503504693694026138488909769903440659982352197168694607468610546527603693350254013923871222214907366013402318469821065219011342887014544279931938226403296808841138321268966015543190588816680865180553680311946308586320183367554216227804022237489563325384863487502698263215652914982484331951463332308738138198850029274360944596748910049423934828422357287796788094130695149200540222035121940850938877624298622532954796851896147160661437050220616565271922732552946446710677232516460729461776038659142224476257345847794450942373578079859499485126730131326576524516304890314331913177850990987024168111201230369088888814690398172882036590299111655540010027485735699714746027888996894491074636860280327147225823944248442261836656573904886459040779317311388300746153183682936598566496118810851117210155851497355418607451942417218342405303407466882340739425972867428295651119808720504249639132122862955038307890969493994195104113046524043749160794961436697257609684147927251684959704460610863296104831651532986040825318902300447440658625380101877503980395998227932398085723381177857528436566512859064891923925275343188259160781978747236009670847930228634801078413556144904608590374066578382162840734094704556882588766886646505226864738082307119224613333238133939596846371751338552884133868538305671501850677644701334294545522736725909403627900425428575515256280775226097449131464565340866109649126743632594122749398221333024430536383625578216179820036875258724363654014144693138078275083473221516269734620056229410319211192339379373705969871361716416377679106916388237216722287776659174301797860870108669335310887042573584964084549830853806105001556741627463785217549742961939001285500174633919141246947357557108556599045483102378087992187545103227928717679344616781130238768651483461192743956507585364231475371294215456739427454883014263789532061322035968793855933561987325692227761095404352330484826414411503719090531177372003299897016197626979927395457229994791267749526153303628872678038332800066583619933258004913183349079048604629414316357319191327195558231837077806252686775830347316627050885149851971577583062612869863587283067660531257911700069173571826354880947317637083284349872412544075913402708943189703819014885007669840239278005529613445594638832571533109906638102771308609778307918887972144572710048156727332459584973070036821333151613153819961560585678263712112030470268059876228517029425596227162809113710893297470852860095341562560503380819402738344574108370654720306234445795829592390942617361234054693439157976577350694947971977807804891223325574434005726664365864102644111316060149623095131182327136402417631294301589329195653465200427192696211199078526072648627433162854506513539229770773150234458156216226928518387866328495285429966654858464869353026956392941429258494349958271486167595912715257764828267182760461364253896726815111881010426744887647580456490504967345425456474016622973826347763934613338287211436182257186176588003701140172055173997504727844175707668889600207567306051631200903890130181471560130625198949120552559448558746812629141017684709710427004048742389198612176603676356004472896668928059680765558510094787743457924782484751630770082376667308234073330513906096857478178233683870995690359783554071103130624719949126370238910969540603249868402536861477476283095376112069159050062207820661304599450914308949364720434475443492964833264370780845446960946001797745772495904818876793482774452693415669479497667787475534772460122493492137810993808000151111691566207109773752171706281820506088282730034274961444848649370619977405543694383494372828173907950266259467252174774397940298169228566724046348868983056956512001432266855278032438198722850314961928002201732958195918019411712018092436685408928571063807663069906690683161055648082570690897534741031264692365697991501782530491220185233054814248544978607008450497309502054372363671000481526486566864005283493893364400968868076536108775865121526619434205088620757585531968138561890894217464218137576596629621478833379373398964800435850437577640968460377641335406648327717013081773794010794014952875540770031810880177389097917673211290120018726648863589367709501261388823514002523445274937813308340503316275556971834095957070311151685663096650735368840013991029460386047281639940987620333442175681255921413498908635648547978900644835092929548172477565064649311738623373240808627814703749594470924250253523961355950685704430632687972782682608805157573492086682988610293226161060994095786201637476231248277843213382720254902308399876150114954386985250400461709342977255489015322283778501777263653261611258177983369074785018325317279141863782640024236415716586455649381512343173971977193215178101228014653700412479738519336676622766507435407640526480204490442902692196646910526472471764603114393090554086553127756176783454160035662301219800609443889189639503729673575343707967975070419543470415317588945540317651342669175155501366866991136532252978456931698975357335541024815635056389334249470576140186655637589083443486141479466860843188722766352909711195732712796762394563304967709413436958934023108929991080515716005090622028689543836100237553062641924208312610445690723253952243872122829998636223014392769452303784254871986926656774292506382959408998515669855260604591417042824181753974969549598117789414318297442937172941430209155229749282461303079594444929813302739394766566525697098691402533281916843264333759399142217857657800583323560684781493900290697958129276960694733882334672163494056850950141579853354856735690088854960442960294027198017859950777639407901068888088712399238217925269809500311232705165587641320754998776731203952540771780852157239190565359903762414761448208478958513982081094679040994558395347872876020222383814294343590776799037308083155653657107998627712323242404749063269476117901423559246446246049043875239453357276008842608058146113940343526263311302027595586177944864081379933037042171087385719199524237547368354426768791245302511373540084062608180152747935881087224444118033523826554478381262051914523602485027600874489145801713632787713497584751472006327570249613430553152241216076230132010422320276409137336534770453910403780621671522392365990692185624618798127690726849905698065462190562548843867811239017679715179217870401334571969427022770776317456491630491922052986374561038895211523979527427416760633732814942980365064600870622485988343876070384800055371145004676234932204325781711685395163200160695744715969286104365799253691170283772945984214730340355595947699698099014443315017119481178618492015118130740993696491711908414895922891067254054340531857393960808153425278566229517436788370382552922294592734092702611580967299358770050314659048255709559925129488294676708030505260000072877607457539673939927320349188082988967058165417599841852725089899200883920793567706237354669531323071242303361987718500437774770836733074952878390038891081494672745424420160412738654295861782690124679189579057467108678949518611668443667084341533197526296153404267552816832061728386036482614796835743851679123120074530857086709990170706464291074762677725912366546486070021273493408424692371122397873634380087044920399569414776671962284365618374494404783009454907098151420965665235024860054584674458829994719840088578484926907349049795048661188990225467479501168878164556044747702179375760301749116431544796543423102855910576078960509904137472289682236128170228966241929030873619387884286498641050901436813025342891314442008308026895818520425411382325363996463203822969014960406971167617803490743246959796489176709522670239269012944596424741201659344241742588809441910058483052316791067695730906881611834731035613909961818300238959553674977192273324582263936445381352462640344317152685672375636106063538302866212782300594878262565506262507016585942350299700482594486537247614137407731144094911598703420964140653507907973000042395425123178245693161546538944817163474529961240214053746847925700387598211104540059955453332404207376202292184231507885591109535596794571000113817633180093490914619710272097789262841684102208298399555207745134500720393760778388467657647832652533774955213115034905031331170372907717242425891871787083064105096470470807217453134164901845190381303646624497955153487250601970472944597069341107901218626561752688823236509798434123508741666811161583229221522141134524591417586902457552653169145320821793704344419502972752134467994934869096407841923356492882008114296882064839353539886265242831143174995160762690880593232309324669792464735759361400066588228775630758091397420766422347053339669946408397898479748702174241725385759515809588332981191183232863126414025028855857625276026871740845329254485736651573547968942396001683261003382924583419836405578403022925041315498400193585323516044788132412164872883956764107603580761015608253210334039670084993337626961638658264147568821163860874793294101103518067608262144888951715539977598455880517499923088750685836655515716367990472782289753588289643252576984143053751695117510520372288167030240744170016627428431866080813209936498367200961001217572321533582911525242084857121897399133912838543725576002777205065137875354041868752613190374824508337624872736746075527919904054365009325447965772617868469787526900954662228938151701419250336137578079213918409114453283963284518704329695562584886018310263047577013189386033198634495681666587191729216364260315068566525433195460645621272540637136201750601801280350987654877503290379842996692304871979737361237005004450111017209863421434448142080922058731517285624486661835457169958250859601191760247804917587030250960118942516181532668642908379165546572246588236181452870059164059291834098650100893185050300749827811324812752780635973751170231793524648742605639519261065842348084780078197623044666908304947840322375238921647068490029703328925224630287711874385761906275853624862447995733481952579457361161723698658868601102154939831901682740902639859568215016543057699249042977532851613233475279198188446078303777764933793897598006364490095043111364019162853307148803445148714481253986183475235409501451199658719852163307602237212857517328324954494638744581412459025744214264604305408829548141050865942584202478886159597134834055563783789931764838601652428918764415643317948502222059711181053351828207618627913195923795822057302474405998878770616459666538646685572019993889307039142440734270135086457562108234055555913602152888317026235605805447403780314423093360140310738052221104158155449012986496338389532742495169987871687962131277199254025275976117059067166378905169772703115868726807285909921002990680153114176973572430721426455006622038399407192717389485597717430090700963070646135905401723517178560389162691795785833726826368236732660871254754437950905868026860040340401366364436635582586576320987349504904768756226289709224527496531073627879634192454883225759117756134433519663815666388742633604712659979989937746235144098665378461260105924345684318065367788517213904114086891434976034802130574195431083921990953774040907906287164994177909873401433541401406281055944976806366738199196301246628425039477700999584927413239653022006401820331668136835304320862451446420568841630605717804812802517138613388353327527224213450160244942641523828884896780006961744412491117507024662800007956065079359572506235985413451355939632323084876933410583780998867789105653437541591182243656510664393423174423513282895091974044604025713441956635265666081664340113582242832446270925321986436636522995921352610302765934147247681239731855805017623392487563837956337980740647643258859259625230968166051374546932818593962922126306950302112224088870480350891943437215741441855212365932127415525357096827287867943215371873982557655890505256276438799243174077765235070642189254085980721618799647345053650888725401936469806052224188055382756611213257843744940816681770265825784014212608576257356134558715010464453147873634657049530995900860251300368631097592822266898046690705758214212040260587867843995752972455054166387060338521223203534544057498013093445693457199722427763876742236301319402507069545999249384877104695916545027807772467657018619860020828516804627461416534256181881280343208607886177969725316473276995379689412004699194032637410762029497719056835213138650072080295239993255516147171615294023290810597837885201934456664948583259896437704235526839153177878227781877522693174171993336453452050588505768631373387093831751846908443618641574847737753198886730852451782615672785238559503699166184109989475413644759088959291864469293601685700989840873477790483712933516853540988879876691953083772843738010931900826214618175555453671792496843479184959158753655785508410179144331715650847643903821042480226896684782295815749440163147413334944594136460082846748144188409391473422207520617588508610707264101538667653966477921939715922123508830124397049331940593216432845859736931979042092526037821186592843691795635380307576664123718289563347610171048717452247269745322673025738183653056369137030817543511840883567616269178877715702684682190762738439841101367629049613105677104357025677819148511813743087943572307059694143041857016616090920629207137120293080951224799013902087430936964531424771387224605271712394656792951401368133375304662485933127812299850490866890006627921273025453571831182453606726322191198851514821830006179920236866719614945157540193073071059029243928716806066986661745930649013493720457426416759547001036479949983232186950068072545318925600134489641539080502465063196759686205863933348252226827948448786945594506227633824991438061606112010641705478589713365261833710839481822514036991180735281005731150240138695153195639379922197685245849723704580849473986791339573714845783220497423105067071787512857119523806835886839723435656244732180788098126274270975050350319628682405469001773598347856825372536550018928016247538635999112637584873671673810004186533820777439275174703078694582022014840957205857731786850095893923052384394230612850272582984531441037446961202447936669331101648380773106691320617177061861323519654225570263051930591865874337327543075655360160373622977305945734477519210788855269935472318112232779399101592519558252467149084114518621740613293716930129261051303165246811458541017379343302392231344541558403725830432995219203720573437678829112607567232912841276423846446917501077375612727454000827786281412121825259006542529277939897815231636500332847040481095233386397000667544071303013369884726442536693319934157425008544450572343068081204804361117582244301891415246895239142374977327742276519573650394798160420938696928927504422600899900578460921357302715960126670268613664406309255898668806195870578996366536709926807407399180325362544275565838974676261850665812318570934173695

Regards Andy
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

User avatar
RetroTechie
Posts: 365
Joined: Tue Nov 01, 2011 12:16 am
Location: Hengelo, NL
Contact:

Re: what is the largest number that can be stored on a zx81

Post by RetroTechie » Mon Apr 01, 2019 2:38 am

Andy Rea wrote:so we have 16384 * 8 bits to store our large integer (..)
Ah, so you put your code in ROM, do away with screen output (or interrupts for that matter :? :?: ), AND keep all your counters in Z80 registers. That's pretty hardcore! :lol:

User avatar
XavSnap
Posts: 576
Joined: Sat May 10, 2008 4:23 pm

Re: what is the largest number that can be stored on a zx81

Post by XavSnap » Mon Apr 01, 2019 3:51 am

Pretty Ascii-Art, thanks Andy...

User avatar
1024MAK
Posts: 2315
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: what is the largest number that can be stored on a zx81

Post by 1024MAK » Mon Apr 01, 2019 1:27 pm

Certainly makes the expression “wall of numbers” take on a different meaning...

@RetroTechie and @Andy Rea - and no calls to subroutines as no space for a stack...

Mark

Post Reply