Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!uunet!portal!cup.portal.com!JerryK From: JerryK@cup.portal.com (Jerry E Kindall) Newsgroups: comp.sys.apple Subject: Re: Assembler FP routine usage Message-ID: <20515@cup.portal.com> Date: 16 Jul 89 18:10:57 GMT References: <354*rdlanctot@instr.okanagan.bc.ca> <3255@wpi.wpi.edu> Organization: The Portal System (TM) Lines: 32 Gary Gray writes: I got a code fragment from A2PRO.ERIC on GEnie, but the code does nothing helpful. What it does is store the locations of $36 and $37 and replace them with the memory address of one of the labels in the code. It then jumps to $E000. At some point, I imagine, the Applesoft setup routine does a relative jump from locations $36 & $37, which will dump it back into the code fragment. The code then restores the contents of $36 and $37 and ends. I believe that location $E000 is a cold restart. I also tried jumping to location $E003, which is a warm restart. The end result, though, is the same, attepmting to run the code from merlin fails. I am quite sure that this problem is not with merlin, but with the routines themselves. Anybody got any suggestions? (end quote) Gary, the problem IS with Merlin. If you're trying to run this code from within Merlin, you should be aware that when you go into the Monitor from Merlin, the language card memory is switched in. The Applesoft ROM is not available. Try turning it into a SYS file (by ORGing it at $2000 and setting the filetype to SYS using the TYP $FF instruction) and then launch it from a program selector. By the way, locations $36 and $37 are the Monitor's output vector (known as CSW). Whenever Applesoft (or any other program) wants to print a character, it calls the Monitor ROM. The Monitor ROM sends passes control to the routine specified by the CSW. What Eric's code fragment does is to grab control back from Applesoft when it tries to print its prompt character. /\ Jerry Kindall JerryK@cup.portal.com \/ Death to COBOL GEnie: A2.JERRY ALink: A2 Jerry