Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!agate!ig!uwmcsd1!lakesys!jason From: jason@lakesys.UUCP (Jason) Newsgroups: comp.sys.apple Subject: Re: 65816 Move Bytes Instruction Summary: MVN Stuff Message-ID: <908@lakesys.UUCP> Date: 28 Jul 88 15:38:36 GMT References: <6230014@hpindda.HP.COM> Organization: Lake Systems, Milwaukee Wisconsin Lines: 25 In article <6230014@hpindda.HP.COM>, tribby@hpindda.HP.COM (David Tribby) writes: > [...] via the MVN instruction. Everything was fine > as long as the global block and code segment were in the same data bank. > But last night my program must have grown over the boundary. When the > MVN instruction executed, it set the Data Bank Register (B-reg) to the > bank containing the subroutine. When the subroutine returned to Pascal, > the B-reg pointed to the wrong area...and all sorts of strange things > happened! I fixed the problem by saving the B-reg upon entering the > subroutine and restoring it before returning. > > --Dave Tribby Upon exit, the MVN or MVP instructions leave the DBR containing the bank specified as the target bank. I suppose it might be useful in some cases, but it sure seems like a pain to me - I use PHB & PLB as well (seems to be the only easy way... not like it takes up tons of code space). As far as doing "variable" moves, I think that the self-modifying code is the only possible trick... It seemed sort of annoying to me, but then I thought about how the parameters would be passed (Considering that the A,X, and Y regs are all used), and figured I'd just count my blessings... 7 cycles per byte ain't too bad! -- Jason - Not your average iconoclast | UUCP: uwvax!uwmcsd1!lakesys!jason