Here are four small examples of scripts to disassemble some interesting code, to get you started.
1000 *SAVE SCRIPT.F800 1010 *-------------------------------- 1020 I:BIN.F800 1030 O:SRC.F800 1040 L:ZIX F800-F881 1050 *-------------------------------- 1060 =26,GBASL 1070 =27,GBASH 1080 =2C,H2 1090 =2D,V2 1100 =2E,MASK 1110 =30,COLOR 1120 *-------------------------------- 1130 =F800,PLOT 1140 =F80C,.1 1150 =F80E,PLOT1 1160 =F819,HLINE 1170 =F81C,.1 1180 =F826,VLINEZ 1190 =F828,VLINE 1200 =F831,RTS1 1210 =F832,CLRSCR 1220 =F836,CLRTOP 1230 =F838,CLRSC2 1240 =F83C,.3 1250 =F847,GBASCALC 1260 =F856,.1 1270 =F85F,NXT.COLOR 1280 =F864,SET.COLOR 1290 =F871,SCRN 1300 =F879,SCRN2 1310 =F87F,.1 1320 *-------------------------------- 1330 C:F800-F881
1000 *SAVE SCRIPT.MONDEFS 1010 *-------------------------------- 1020 * References: Apple II, //e, and //c Tech. Ref. Manuals 1030 *-------------------------------- 1040 =20,WND.LEFT 1050 =21,WND.WIDTH 1060 =22,WND.TOP 1070 =23,WND.BOTTOM 1080 =24,CH 1090 =25,CV 1120 =28,BASL 1130 =29,BASH 1160 =30,COLOR 1170 =31,MODE 1180 =32,INVFLAG 1190 =33,PROMPT 1200 =36,CSWL 1210 =37,CSWH 1220 =38,KSWL 1230 =39,KSWH 1231 *-------------------------------- 1232 =C000,KEYBOARD 1233 =C010,STROBE 1234 =C030,SPEAKER 1240 *-------------------------------- 1250 =F800,PLOT 1260 =F819,HLINE 1270 =F828,VLINE 1280 =F832,CLRSCR 1290 =F836,CLRTOP 1300 =F85F,NXTCOLOR 1310 =F871,SCRN 1320 *-------------------------------- 1330 =F940,PRINT.YX 1340 =F941,PRINT.AX 1350 =F948,PRBLNK 1360 =F94A,PRBL2 1370 *-------------------------------- 1380 =FB1E,PDL.READ 1390 =FBDD,BELL1 1400 *-------------------------------- 1410 =FC42,CLREOP 1420 =FC58,HOME 1430 =FC9C,CLREOL 1440 =FC9E,CLREOLZ 1450 =FCA8,WAIT 1460 *-------------------------------- 1470 =FD0C,RDKEY 1480 =FD1B,KEYIN 1490 =FD35,RDCHAR 1500 =FD67,GETLNZ 1510 =FD6A,GETLN 1520 =FD6F,GETLN1 1530 =FD8B,CROUT1 1540 =FD8E,CROUT 1550 =FDDA,PRBYTE 1560 =FDE3,PRHEX 1570 =FDED,COUT 1580 =FDF0,COUT1 1590 *-------------------------------- 1600 =FE2C,MOVE 1610 =FE36,VERIFY 1620 *-------------------------------- 1630 =FF2D,PRERR 1640 =FF3A,BELL 1650 =FF3F,IO.RESTORE 1660 =FF4A,IO.SAVE 1670 =FF58,IO.RTS 1680 =FF69,MONITOR 1690 *--------------------------------
The following script will disassemble the Apple disk utility program FILER, and generate a file named SRC.FILER.5E00.
1000 *SAVE SCRIPT.FILER 1010 I:FILER 1020 O:SRC.FILER.5E00 1030 P:5E00 1040 L:ZIX 800-AFF 1050 *-------------------------------- 1060 =22,WINDOW.TOP 1070 =23,WINDOW.BOTTOM 1080 =24,CH 1090 =25,CV 1100 *-------------------------------- 1110 =839,READ.THE.FILE 1120 =856,CLOSE.FILE.A 1130 =873,CALL.MLI 1140 =888,GOTO.XY 1150 =8B3,PRINT.STRING 1160 *-------------------------------- 1170 =BF00,MLI 1180 =BF98,MACHID 1190 =FC22,MON.VTAB 1200 =FC42,MON.CLREOP 1210 =FC58,MON.HOME 1220 =FC9C,MON.CLREOL 1230 =FD8E,MON.CROUT 1240 =FDDA,MON.PRBYTE 1250 =FDED,MON.COUT 1255 *-------------------------------- 1260 C:800-8D3 1270 H:-8E4 1280 C:-9C4 1290 H:-AFF 1300 *--------------------------------
Start by creating a copy of the Sider firmware in a binary file named B.SIDER. Then the following script will create source code for you.
1000 *SAVE SCRIPT.SIDER 1010 *-------------------------------- 1020 L:ZIX C800-CFFF 1030 =2C,PNTL 1040 =2D,PNTH 1050 =36,CSWL 1060 =37,CSWH 1070 =778,SLOT16 1080 =7F8,C.SLOT 1090 =C800,V.BOOT.ENTRY 1100 =C803,V.RWTS.INTERFACE 1110 =C806,V.GENERAL.DRIVER 1120 =C809,V.PASCAL.DRIVER 1130 =C80C,SETUP.SLOT.INFO 1140 =C824,V.S1410.STATUS.REQUEST 1150 =C827,V.CHECK.CODE 1160 =C82A,BOOT.ENTRY 1170 =C84C,RWTS.INTERFACE 1180 =C9AF,RWTS.ERR 1190 =C9B4,RWTS.RETURN 1200 =CA99,GETDOS 1210 =CAC5,GENERAL.DRIVER 1220 =CBF8,S1410.STATUS.REQUEST 1230 =CC41,CHECK.CODE 1240 =CC43,.1 1250 =CC59,.2 1260 =CC72,.3 1270 =CC74,PRODOS.READ 1280 =CC78,PRODOS.WRITE 1290 =CC7A,PRODOS.READ.OR.WRITE 1300 =CD86,PASCAL.DRIVER 1310 =CF00,S.BOOT.ENTRY 1320 =CF11,S.RWTS.INTERFACE 1330 =CF1A,S.GENERAL.DRIVER 1340 =CF23,S.PASCAL.DRIVER 1350 =CF2C,S.S1410.STATUS.REQUEST 1360 =CF4D,S.CHECK.CODE 1370 =CF49,PRODOS.ENTRY 1380 =CFB6,PRODOS.STATUS 1390 =CFFF,CFFF 1400 *-------------------------------- 1410 I:B.SIDER 1420 O:SIDER.MAIN 1430 C:C800-C822 1440 H:-C823 1450 C:-C843 1460 H:-C84B 1470 C:-C8BA 1480 H:-C8BD 1490 C:-CC73 1500 *-------------------------------- 1510 O:SIDER.PRODOS 1520 C:-CD85 1530 *-------------------------------- 1540 O:SIDER.PASCAL 1550 C:-CEF7 1560 H:-CEFF 1570 *-------------------------------- 1580 O:SIDER.SLOT 1590 C:CF00-CF3B 1600 H:-CF4C 1610 C:-CF4F 1620 H:-CF58 1630 C:-CFAD 1640 H:-CFB5 1650 C:-CFEA 1660 H:-CFFF 1670 *--------------------------------
The SCDA script above produces four files: SIDER.MAIN, SIDER.PRODOS, SIDER.PASCAL, and SIDER.SLOT. You could use the following control file for the S-C Macro Assembler could be used to re-assemble the Sider firmware from those four files.
1000 *SAVE SIDER.ACF 1010 .TI 76,SIDER VERSION C FIRMWARE.........................7-23-86........... 1020 *-------------------------------- 1030 .OR $C800 1040 .TA $800 1050 *-------------------------------- 1060 .INB SIDER.MAIN 1070 .PG 1080 .INB SIDER.PRODOS 1090 .PG 1100 .INB SIDER.PASCAL 1110 .PG 1120 .INB SIDER.SLOT 1130 .PG