Hisoft Devpac and the MGT Plus D

I've got (potentially) a bit of an odd one here that might cut across a couple of areas so I thought I would put it in misc.

I am trying to Hisoft's Devpac (v4.1) with the MGT Plus D disk interface. Devpac lets you save text (source) AOK, and even seems to let you both output (and assemble) to disk using 'O,,1:test' and 'A,,1:test'.

The trouble I have is that the resultant object files are of type 'MD.FILE' (a microdrive file) rather than CODE, so I can't work out how to load and execute them.

I know that Devpac is designed to use the microdrive, so it is unsurprising that it puts things in this format, but I love the Plus D and would like to put it to good use.

Does anyone know of a hack to Devpac, a method of converting MD.FILEs to CODE or something else that may help me make better use of this combo? I am willing to take any suggestions.

PS: yes, I know using native tools is a really painful way to write in assembly. However, I just have a love of native coding. For comparion, I have also been typing hex into single boards as well.
Post edited by maguman21 on

Comments

  • edited April 2012
    I did a bit of experimenting, and this is the disk record entry which DevPac creates for the assembly of "LD B,10 : RET":
    preamble = 00 00 00 00 00 00 00 00 00 00 FF FF
    RECFLG   = 06 (MD.FILE)
    RECNUM   = 00
    RECLEN   = 0C 00
    RECNAM   = 54 45 53 54 20 20 20 20 20 20 (TEST)
    DESCHK   = 14
    rectype  = 03 (CODE)
    reclen   = 03 00
    start    = 07 9B (39687)
    proglen  = 00 00
    linenum  = 00 00
    data     = 06 0A C9 (LD B,10 : RET)
    
    The MGT directory code for type CODE in the RECFLG field should be 04; the rest of it's just like a Microdrive file entry. I tried just patching the disk directly with a hex editor, and although the entry looked OK from CAT a LOAD...CODE gave an "Invalid file name" error.

    So then I tried changing it with the Plus D Util program by Jose Manuel Claros, but had the same problem. Using the shorthand "LOAD p5" or whatever would appear to load it, but the CODE wouldn't actually go anywhere; and LOAD d1;"TEST" CODE just gave the "Invalid file name" error again.

    I always have problems using the +D on emulators as the disk directories always get corrupted sooner or later. Maybe JMC's Plus D Util will work OK on a real one. Oh, it's all in Spanish, by the way, but it's easy enough to get the gist of it.
  • edited April 2012
    I did a bit of experimenting, and this is the disk record entry which DevPac creates for the assembly of "LD B,10 : RET":
    preamble = 00 00 00 00 00 00 00 00 00 00 FF FF
    RECFLG   = 06 (MD.FILE)
    RECNUM   = 00
    RECLEN   = 0C 00
    RECNAM   = 54 45 53 54 20 20 20 20 20 20 (TEST)
    DESCHK   = 14
    rectype  = 03 (CODE)
    reclen   = 03 00
    start    = 07 9B (39687)
    proglen  = 00 00
    linenum  = 00 00
    data     = 06 0A C9 (LD B,10 : RET)
    
    The MGT directory code for type CODE in the RECFLG field should be 04; the rest of it's just like a Microdrive file entry. I tried just patching the disk directly with a hex editor, and although the entry looked OK from CAT a LOAD...CODE gave an "Invalid file name" error.

    So then I tried changing it with the Plus D Util program by Jose Manuel Claros, but had the same problem. Using the shorthand "LOAD p5" or whatever would appear to load it, but the CODE wouldn't actually go anywhere; and LOAD d1;"TEST" CODE just gave the "Invalid file name" error again.

    I always have problems using the +D on emulators as the disk directories always get corrupted sooner or later. Maybe JMC's Plus D Util will work OK on a real one. Oh, it's all in Spanish, by the way, but it's easy enough to get the gist of it.

    Thanks for your efforts. Not much further than I got... No matter what I seem to do it doesn't get past the 'invalid file name' error. Will keep trying.

    I found the series of articles in FORMAT magazine where they patched a microdrive version of GENS to work better with the disk. I think it was version 3.2M. Tried that out - didn't seem to do it for me but it is hard to confirm that you have exactly the same version.

    PUTTING and GETTING code from GENS works OK. Just can't assemble to disk or directly output the object file in the right formats. Can go back to BASIC and SAVE D1 "..." CODE XXXXX,YYYY etc so it isn't like it is completely unusable.

    I know what you mean about Plus D on emulators. I thought I was going mad until i realised it was the EMULATOR causing the problems and not me being an idiot. Switched to SpecEmu - lacks some features in other emulators but I have not had a single problem with Plus D disks (that I didn't cause myself).

    Again, many many thanks.
  • edited April 2012
    I've found a way to get the CODE out of the MD.FILE from BASIC, but it's a bit of a palaver so I don't know if it will be of much use. Using the above example:
      10 OPEN #4;d1;"TEST"
      20 LET a$="": LET a$=INKEY$#4
      30 FOR p=0 TO 0 STEP 0: LET a$=a$+INKEY$#4: NEXT p
    
    Line 20 gives an immediate "End of file", which isn't very helpful; but then "GO TO 30" runs for about 30 seconds before "End of file" and a$ is 1020 bytes long with the data shown above at the start followed by a load of zeroes.

    So something like this can be done to save a CODE file from the MD.FILE:
      30 FOR p=1 TO 28: LET a$=INKEY$#4: NEXT p
      40 LET length=CODE INKEY$#4+256*CODE INKEY$#4: PRINT length
      50 FOR p=1 TO 6:  LET a$=INKEY$#4: NEXT p
      60 LET codead=65536-length: PRINT codead
      70 FOR p=codead TO codead+length-1:
           LET byte=CODE INKEY$#4: PRINT byte;" ";: POKE p,byte:
         NEXT p
      80 SAVE d1;"TESTcode" CODE codead,length
    
    The command LOAD d1;"TESTcode" CODE then works OK.

    I don't know what the problem is with the annoying bogus "End of file" though. Also, CLOSE#4 doesn't work either; it hangs up on the HALT at $1303 MAIN-4 because the interrupts have been disabled.
  • edited April 2012
    Thanks. Curious EOF. Oh well, at least I am not the only one getting some weird stuff!

    Will try your approach out and see how I go.

    Cheers
Sign In or Register to comment.