home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
program
/
books
/
68k_book
/
arp_src
/
prg_9ar.doc
< prev
next >
Wrap
Text File
|
1985-11-20
|
4KB
|
74 lines
April 14, 1989
I have designed a software DONGLE for Switch/Back using data obtained
from a disassembly listing of SW_1MEG.PRG. The method I used to decode the
SW_1MEG.PRG listing is as follows:
1. Load SW_1MEG.PRX (or PRG) into the AssemPro debugger.
2. Put a breakpoint at the first DBRA D0 instruction.
3. Click on the Run Program button.
4. Remove the breakpoint.
5. Click the disassembled button off and on. This step is probably
not necessary.
6. Put a breakpoint at the first statement following the first
DBRA D0 instruction.
7. Repeat step 3.
8. Repeat step 4.
9. Repeat step 5.
10. Move the PC cursor to the CLR.L D1 statement that is 8 statements
before the second DBRA D0 instruction.
11. Put a breakpoint at the second DBRA D0 instruction.
12. Repeat step 3.
13. Repeat step 4.
14. Repeat step 5.
15. Put a breakpoint at the first statement following the second
DBRA D0 instruction.
16. Repeat step 3.
17. Repeat step 4.
18. Repeat step 5.
19. Disassemble to file SW_1MEG.DSM. The first statement in the program
as shown in the debugger yields the program end address.
Using the disassembly listing, I was able to spot the MFPINT invocation,
which begins 21st instruction. This routine installs an interrupt handler
for pin 11 of the parallel interface. From looking at the DONGLE board, I
already knew that the DONGLE switch pulses this pin.
Using the AssemPro debugger, I obtained the actual address of the
interrupt handler from address $100. The interrupt handler address stored
there was $D3F6. The rte instruction for the handler was at address $D54A.
I obtained a disassembly listing for the interrupt handler. From it,
I was able to deduce that the instructions which had to be executed to
simulate the hardware dongle were the first 5 and the 14th through the RTE
instruction.
I prepared a custom trap #11 installer called DONGTRAP.S. This program
installs the trap which executes the first 5 instructions of the interrupt
handler, then jumps to the address of the 14th instruction. The RTE
instruction in the interrupt handler serves to return control to the trap #11
invoking program. DONGTRAP.S is assembled in PC-relative mode, given a PRG
extension and copied to the AUTO folder on the C partition of the hard disk.
I then wrote a desk accessory to invoke the custom trap #11. The name
of that program is DONGLE.S; it is assembled in Relocatable mode, given a
PRG extension that is changed to ACC from the desktop. DONGLE.ACC is then
copied to the C partition of the hard disk.
The software dongle seems to work fine. I tested it by booting up,
letting SW_1MEG.PRG divide the system into 2 1 megabyte partitions. I then
executed 1st Word+, loaded in chapter 9, selected DONGLE from the accessory
menu, then pressed the 'c' key to capture. I quit 1st Word+, then from the
desktop, executed the switch back buffer program to save the partition.
I then powered down and back up, executed the buffer program to reinstall
the saved partition.
So far, everything seems to function as it does with the hardware dongle,
except that the software dongle functions much smoother; no need to press a
button 5 or 6 times to effect a capture or alternate.
I have also tested the DONGLE with SW_512K.PRG; it functioned as
required.