home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / code / asm_fedi.sit < prev    next >
Encoding:
Text File  |  1984-10-26  |  10.7 KB  |  305 lines

  1. 26-Oct-84 19:14:57-PDT,11168;000000000001
  2. Return-Path: <tdn@cmu-cs-spice.arpa>
  3. Received: from CMU-CS-SPICE.ARPA by SUMEX-AIM.ARPA with TCP; Fri 26 Oct 84 19:13:55-PDT
  4. Date: Friday, 26 October 1984 22:00:24 EDT
  5. From: Thomas.Newton@cmu-cs-spice.arpa
  6. To: info-mac@sumex-aim.arpa
  7. Subject: FEditR.Asm (TO BE ARCHIVED)
  8. Message-ID: <1984.10.27.1.58.20.Thomas.Newton@cmu-cs-spice.arpa>
  9.  
  10. ;______________________________________________________________________
  11. ;
  12. ;   This program is designed to provide disk information and to
  13. ;   edit disk files on the Macintosh.
  14. ;
  15. ;         Copyright (C) John H. Mitchell, September 1984.
  16. ;
  17. ;                   All rights reserved.
  18. ;
  19. ;   Permission is granted for non commercial usage.  This source
  20. ;   and its associated code file may be copied and distributed
  21. ;   freely, provided that you do not attempt to sell it, use it
  22. ;   as the basis for a commercial program, or otherwise obtain any
  23. ;   financial gain from it.  You may modify it in any way that you
  24. ;   feel appropriate within these limits.
  25. ;
  26. ;______________________________________________________________________
  27.  
  28.         String_Format 2
  29.  
  30. Visible EQU     1
  31. Invisible       EQU     0
  32.  
  33. GoAway  EQU     1
  34. NoGoAway        EQU     0
  35.  
  36. Enabled EQU     0
  37. Disabled        EQU     128
  38.  
  39. MACRO   MakeMENU        Name,ID,Flags =
  40.         RESOURCE        'MENU'{ID} 'z'
  41.         DC.B    {ID}>>8,{ID}
  42.         DC.B    0,0
  43.         DC.B    0,0
  44.         DC.B    0,0
  45.         DC.B    0,0
  46.         LongHex {Flags}
  47.         DC.B    {Name}
  48.         |
  49.  
  50. MACRO   MenuItem        Text,Mark,Key =
  51.         DC.B    {Text}
  52.         DC.B    0
  53.         DC.B    {Key}
  54.         DC.B    {Mark}
  55.         DC.B    0
  56.         |
  57.  
  58. MACRO   MakeSTR ID,Text =
  59.         RESOURCE        'STR ' {ID} 'z'
  60.         DC.B    {Text}
  61.         |
  62.  
  63. MACRO   MakeDLOG        ID,RectTop,RectLeft,RectBottom,RectRight,VisibleFlag,GoawayFlag,Procedure,DITL =
  64.         RESOURCE        'DLOG' {ID} 'z'
  65.         DC.B    {RectTop}>>8,{RectTop},{RectLeft}>>8,{RectLeft}
  66.         DC.B    {RectBottom}>>8,{RectBottom},{RectRight}>>8,{RectRight}
  67.         DC.B    {Procedure}>>8,{Procedure}
  68.         DC.B    {VisibleFlag}
  69.         DC.B    0
  70.         DC.B    {GoawayFlag}
  71.         DC.B    0
  72.         DC.B    0,0,0,0
  73.         DC.B    {DITL}>>8,{DITL}
  74.         DC.B    0,0
  75.         |
  76.  
  77. MACRO   MakeALRT        ID,RectTop,RectLeft,RectBottom,RectRight,DITL,Stages =
  78.         RESOURCE        'ALRT' {ID} 'z'
  79.         DC.B    {RectTop}>>8,{RectTop},{RectLeft}>>8,{RectLeft}
  80.         DC.B    {RectBottom}>>8,{RectBottom},{RectRight}>>8,{RectRight}
  81.         DC.B    {DITL}>>8,{DITL}
  82.         DC.B    {Stages}>>8,{Stages}
  83.         |
  84.  
  85. MACRO   MakeDITL        ID,Count =
  86.         RESOURCE        'DITL' {ID} 'z'
  87.         DC.B    0,{Count}-1
  88.         |
  89.  
  90. MACRO   DITLButn        EnableFlag,RectTop,RectLeft,RectBottom,RectRight,Text =
  91.         DC.B    0,0,0,0
  92.         DC.B    {RectTop}>>8,{RectTop},{RectLeft}>>8,{RectLeft}
  93.         DC.B    {RectBottom}>>8,{RectBottom},{RectRight}>>8,{RectRight}
  94.         DC.B    4+{EnableFlag}
  95.         DC.B    {Text}
  96.         |
  97.  
  98. MACRO   DITLEdit        EnableFlag,RectTop,RectLeft,RectBottom,RectRight =
  99.         DC.B    0,0,0,0
  100.         DC.B    {RectTop}>>8,{RectTop},{RectLeft}>>8,{RectLeft}
  101.         DC.B    {RectBottom}>>8,{RectBottom},{RectRight}>>8,{RectRight}
  102.         DC.B    16+{EnableFlag}
  103.         DC.B    0
  104.         |
  105.  
  106. MACRO   DITLStat        EnableFlag,RectTop,RectLeft,RectBottom,RectRight,Text =
  107.         DC.B    0,0,0,0
  108.         DC.B    {RectTop}>>8,{RectTop},{RectLeft}>>8,{RectLeft}
  109.         DC.B    {RectBottom}>>8,{RectBottom},{RectRight}>>8,{RectRight}
  110.         DC.B    8+{EnableFlag}
  111.         DC.B    {Text}
  112.         |
  113.  
  114. MACRO   DITLIcon        EnableFlag,RectTop,RectLeft,RectBottom,RectRight,ID =
  115.         DC.B    0,0,0,0
  116.         DC.B    {RectTop}>>8,{RectTop},{RectLeft}>>8,{RectLeft}
  117.         DC.B    {RectBottom}>>8,{RectBottom},{RectRight}>>8,{RectRight}
  118.         DC.B    32
  119.         DC.B    2               ; Always enabled
  120.         DC.B    {ID}>>8,{ID}
  121.         |
  122.  
  123. MACRO   MakeICON        ID =
  124.         RESOURCE        'ICON' {ID} 'z'|
  125.  
  126. MACRO   LongHex V =
  127.         DC.B    {V}>>24,{V}>>16,{V}>>8,{V}|
  128.  
  129.         RESOURCE        'MENU' 1 'z'
  130.         DC.B    0,1
  131.         DC.B    0,0
  132.         DC.B    0,0
  133.         DC.B    0,0
  134.         DC.B    0,0
  135.         LongHex $FFFFFFFB
  136.         DC.B    $01,$14
  137.         MenuItem        'About Fedit...',0,0
  138.         MenuItem        '-',0,0
  139.         DC.B    0
  140.         
  141.         MakeMENU        'File',2,$FFFFFFF7
  142.         MenuItem        'Open Volume...',0,0
  143.         MenuItem        'Open File...',0,0
  144.         MenuItem        'Close',0,0
  145.         MenuItem        'Quit',0,$51
  146.         DC.B    0
  147.  
  148.         MakeMENU        'Edit',3,$FFFFFDAF
  149.         MenuItem        'Read Next Block',0,$4E
  150.         MenuItem        'Read Previous Block',0,$50
  151.         MenuItem        'Read Block...',0,$42
  152.         MenuItem        '-',0,0
  153.         MenuItem        'Write Block',0,$57
  154.         MenuItem        '-',0,0
  155.         MenuItem        'ASCII Modify',0,$41
  156.         MenuItem        'Hex Modify',0,$48
  157.         MenuItem        '-',0,0
  158.         MenuItem        'Undo Changes',0,$5A
  159.         DC.B    0
  160.         
  161.         MakeMENU        'Options',4,$FFFFFFF1
  162.         MenuItem        'Resource Fork',0,0
  163.         MenuItem        'Data Fork',0,0
  164.         MenuItem        '-',0,0
  165.         MenuItem        'Display in Hex',0,0
  166.         MenuItem        'Display in ASCII',$12,0
  167.         DC.B    0
  168.  
  169.         MakeMENU        'Display',5,$FFFFFFF9
  170.         MenuItem        'File Information',0,0
  171.         MenuItem        'Disk Information',0,0
  172.         DC.B    0
  173.  
  174.         MakeMENU        '*** ASCII modify command active ***',6,$FFFFFFFD
  175.         MenuItem        '-',0,0
  176.         MenuItem        'End Modifications',0,$43
  177.         DC.B    0
  178.  
  179.         MakeMENU        '*** Hex modify command active ***',7,$FFFFFFFD
  180.         MenuItem        '-',0,0
  181.         MenuItem        'End Modifications',0,$43
  182.         DC.B    0
  183.         
  184.         MakeSTR 257,'Hex:'
  185.         MakeSTR 258,'Position:'
  186.         MakeSTR 259,'Block:'
  187.         MakeSTR 260,'Logical EOF is after position'
  188.         MakeSTR 261,'in this block'
  189.  
  190.         MakeDLOG        51,60,120,220,400,Visible,NoGoAway,1,51
  191.         MakeDLOG        52,100,152,236,360,Visible,NoGoAway,1,52
  192.         MakeDLOG        53,100,55,185,455,Visible,NoGoAway,1,53
  193.  
  194.         MakeALRT        21,100,96,228,416,21,$4444
  195.         MakeALRT        22,100,96,228,416,22,$4444
  196.         MakeALRT        23,100,96,228,416,23,$4444
  197.         MakeALRT        24,100,96,228,416,24,$4444
  198.         MakeALRT        25,100,96,228,416,25,$4444
  199.         MakeALRT        26,100,96,228,416,26,$4444
  200.         MakeALRT        27,100,96,228,416,27,$4444
  201.         MakeALRT        28,100,96,228,416,28,$4444
  202.         MakeALRT        29,100,96,228,416,29,$4444
  203.         
  204.         MakeDITL        21,4
  205.         DITLButn        Enabled,90,50,116,150,'No'
  206.         DITLButn        Enabled,90,180,116,280,'Yes '
  207.         DITLIcon        Enabled,30,20,62,52,1
  208.         DITLStat        Enabled,23,70,84,310,'Do you really want to discard the changes that you have made to this block? '
  209.         
  210.         MakeDITL        22,3
  211.         DITLButn        Enabled,90,180,116,280,'OK'
  212.         DITLIcon        Enabled,22,20,54,52,0
  213.         DITLStat        Enabled,25,70,84,310,'Unable to open that fork because it has no disk blocks allocated. '
  214.         
  215.         MakeDITL        23,3
  216.         DITLButn        Enabled,90,180,116,280,'OK'
  217.         DITLIcon        Enabled,22,20,54,52,0
  218.         DITLStat        Enabled,25,70,84,310,'An error occurred while attempting to open the file on disk.'
  219.         
  220.         MakeDITL        24,3
  221.         DITLButn        Enabled,90,180,116,280,'OK'
  222.         DITLIcon        Enabled,22,20,54,52,0
  223.         DITLStat        Enabled,25,70,84,310,'An error occurred while attempting to read a block from the disk file.'
  224.         
  225.         MakeDITL        25,3
  226.         DITLButn        Enabled,90,180,116,280,'OK'
  227.         DITLIcon        Enabled,22,20,54,52,0
  228.         DITLStat        Enabled,25,70,84,310,'An error occurred while attempting to rewrite this block in the disk file.'
  229.         
  230.         MakeDITL        26,4
  231.         DITLButn        Enabled,90,50,116,150,'Cancel'
  232.         DITLButn        Enabled,90,180,116,280,'OK'
  233.         DITLIcon        Enabled,22,20,54,52,1
  234.         DITLStat        Enabled,25,70,84,310,'Are you sure you want to write this block to disk?'
  235.         
  236.         MakeDITL        27,3
  237.         DITLButn        Enabled,90,180,116,280,'OK'
  238.         DITLIcon        Enabled,22,20,54,52,0
  239.         DITLStat        Enabled,25,70,84,310,'An error occurred while attempting to read a block from the disk volume.'
  240.         
  241.         MakeDITL        28,3
  242.         DITLButn        Enabled,90,180,116,280,'OK'
  243.         DITLIcon        Enabled,22,20,54,52,0
  244.         DITLStat        Enabled,25,70,84,310,'An error occurred while attempting to write this block to disk. '
  245.         
  246.         MakeDITL        29,3
  247.         DITLButn        Enabled,90,180,116,280,'OK'
  248.         DITLIcon        Enabled,22,20,54,52,0
  249.         DITLStat        Enabled,25,70,84,310,'This file cannot be displayed because it contains no data or resource blocks. '
  250.         
  251.         MakeDITL        51,4
  252.         DITLStat        Enabled,30,70,50,270,'File and Volume Edit Program'
  253.         DITLStat        Enabled,100,25,116,260,'This program was written for the'
  254.         DITLStat        Enabled,120,35,136,260,'Macintosh by John H. Mitchell '
  255.         DITLIcon        Enabled,24,20,56,52,511
  256.         
  257.         MakeDITL        52,5
  258.         DITLButn        Enabled,59,12,77,92,'Open'
  259.         DITLButn        Enabled,100,12,118,92,'Cancel'
  260.         DITLButn        Enabled,59,116,77,196,'Eject '
  261.         DITLButn        Enabled,100,116,118,196,'Drive '
  262.         DITLStat        Disabled,20,70,38,196,' '
  263.         
  264.         MakeDITL        53,4
  265.         DITLButn        Enabled,50,250,72,325,'OK'
  266.         DITLButn        Enabled,50,80,72,155,'Cancel'
  267.         DITLStat        Disabled,20,20,36,300,'Enter number of block to read from disk '
  268.         DITLEdit        Disabled,20,320,36,380
  269.         
  270.         MakeICON        511
  271.         LongHex $0007FF80
  272.         LongHex $00080000
  273.         LongHex $00087E20
  274.         LongHex $00080120
  275.         LongHex $00080120
  276.         LongHex $04080120
  277.         LongHex $0C080120
  278.         LongHex $08080120
  279.         LongHex $66080120
  280.         LongHex $99080120
  281.         LongHex $8108FE20
  282.         LongHex $80080020
  283.         LongHex $80080020
  284.         LongHex $4A001F20
  285.         LongHex $34000020
  286.         LongHex $00FC0020
  287.         LongHex $03000000
  288.         LongHex $0401FFF0
  289.         LongHex $04000008
  290.         LongHex $03E01FE4
  291.         LongHex $00100552
  292.         LongHex $001000A9
  293.         LongHex $00200001
  294.         LongHex $002001FE
  295.         LongHex $00180000
  296.         LongHex $00040000
  297.         LongHex $0000C000
  298.         LongHex $00012000
  299.         LongHex $00025000
  300.         LongHex $00008800
  301.         LongHex $00000800
  302.         LongHex $00001000
  303.         
  304.         END
  305.