I noticed after I hit send at 382Dh it is jumping to 4200h, but there is nothing there. The ROM disassembly says it is "handle hook code in A", well I suppose it can't if there isn't any (samdos?) code at 4200. So how do I get it in there?
Cheers! Andrew From: Andrew Gillen Sent: Friday, May 27, 2011 12:09 AM To: sam-users@nvg.ntnu.no Subject: Loading stuff from machine code with the ROM functions Hi all Wonder if someone can offer some advice? I'm trying to get my program to load in new data during runtime. I can do this at the start of the program by pointing IX to my uifa, loading the header and then pointing IX to the difa and c,d and e to the appropriate place as per the technical manual (although it states the difa is returned 80bytes above my uifa which isn't the case - it seems to be at &4b50 as per the documentation for B-Dos (but I'm not using b-dos, I'm using Samdos (or so I thought!))). Example code that I am using (and works fine when called the machine code from the basic prompt): ld ix,uifa RST &08 DEFB 129 ld ix,&4B50 ld c,(ix+34) ld e,(ix+35) ld d,(ix+36) ld hl,&8000 rst &08 defb 130 uifa: defm 19,'level1.bin' So that works ok, I can load about 15 files in to whatever pages I need and all is well until I then want to load in a bunch more later. I assumed it would be a simple case of paging the ROM back in and running the same code as above only it crashes when I try to read in the header of the file. Am I missing something really obvious that I need to do after I page the ROM in and before I run the code to load the file? I thought it might be the stack pointing to a random location but even after re-pointing to what appears to be a clean place in free memory it still goes haywire Any tips? Cheers!