
FB II Compiler
PG PRO
Debugging
Memory
System
Mathematics
Resources
Disk I/O
Windows
Controls
Menus
Mouse
Keyboard
Text
Fonts
Drawing
Sound
Clipboard
Printing
Communication
ASM
|
DISK I/O
Bypass the DILoad's bug
The program I'm writing can format volumes, and before calling DIFormat, DIVerify, and DIZero, you're supposed to call DILoad to make sure the routines are loaded, and you can call DIUnload when you're done.
FutureBasic's versions of those commands are "CALL DILOAD" and "CALL DIUNLOAD". When I use these statements in my program, it crashes with a bus error, an illegal instruction error, or some other error. Formatting works fine if I leave the statements out. :-)
But when I implement DILoad and DIUnload in assembly, via the following program, everything works fine:
COMPILE 0,_caseInsensitive_strResource_dimmedVarsOnly_macsbuglabels_noRedimVars
DIM dummy&
END GLOBALS
LOCAL FN MyDILoad
` MOVE.W #$0002,-(sp)
` DC.W $A9E9
END FN
LOCAL FN MyDIUnload
` MOVE.W #$0004,-(sp)
` DC.W $A9E9
END FN
WINDOW 1
PRINT "hello."
INPUT dummy&
FN MyDILoad
FN MyDIUnload
INPUT dummy&
Using these routines in place of the FutureBasic calls in the application I am writing works as well.
|