If I'm reading it right, he's using self-modifying code. On Thu, Sep 8, 2022 at 12:03 PM Stephen Adolph <twospru...@gmail.com> wrote:
> don't you need to reserve the memory location 56301 > right now it would be an opcode LXI? > > Steve > > On Thu, Sep 8, 2022 at 12:59 PM Charlie Hoey <charlie.h...@gmail.com> > wrote: > >> Thanks for that Ken! Nice to have confirmation on taht. >> >> And yeah I found BYTEIT over here on the programming section of the >> club100 archives: http://www.club100.org/library/libprg.html >> >> Just in case it's useful to anybody, so far I've ported over an LFSR >> pseudo-random number generator over from here: >> https://64nops.wordpress.com/2021/02/07/pseudo-random-number-generators/ >> , I went with the short 16bit one. His code is for Z80, but in this case no >> instructions the 8085 doesn't also have. My version adapted for M100 >> BYTEIT is as follows: >> >> ; 64nops galois 16bit lfsr routine >> ORG 56300 >> LFVAR EQU 56301 >> START LXI HL,6128H >> DAD HL >> SBB A >> ANI 83H >> XRA L >> MOV L,A >> SHLD LFVAR >> MOV HL,BC >> MOV M,BC >> RET >> END >> >> After assembling the above, from BASIC I can then run `CALL 56300` to >> generate a new number, and `PEEK(56301)` to retrieve it. >> >> Anyhow, so far so good, but I may check out CMZASM, since it seems like >> if I want to easily share/reuse things, it's handy to have it installable >> through basic. >> >