TITLE 'MAIN SEQUENCE'›SUBTTL 'File MAIN.AMA'›;›;******************************›;›; DISK DISASSEMBLER Rev 2.2›;›;******************************›;›; Copyright 1982 Ralph Jones.›;›; This program disassembles Atari (tm) machine-language›; programs from binary DOS files, self-booting disks,›; and memory into DOS text files suitable for editing›; and reassembly. All program-internal address references›; are given labels up to a maximum of 1023 locations.›; All references to locations within the Atari Operating›; System are given their documented system labels.›; Example: instruction 20 56 E4 disassembles as JSR CIOV.›; System locations used are defined by appropriate›; equate pseudo-ops and hex values of all references›; are given in comments following the instructions.›;›; This is the mainline program.›; It simply calls the major processing›; modules in sequence (with some looping)›; and wraps up at the end of the disassembly.›; This file should be named in the assembly›; command; it references all the other›; modules via INCLUDE pseudo-ops.›;›;›; Changes this version:›;(1) Line number option›;(2) Modified zero-page equate handling›;(3) Zero-page labels prefixed with "Z"›;(4) Customizing file capability›;›; Changes this sub-version:›;Printer option improved›;›LIST I›INCLUDE D:PROGEQU.AMA›;›; Init code›;›ORG $2500›INITLDA #LOW INIT›STA DOSVEC›HDA #HIGH INIT›STA DOSVEC+1›SEC›LDA MEMTOP›STA MEMLO›STA APPMHI›STA BUFMAX›LDA MEMTOP+1›SBC #1 ;Leave some space above.›STA MEMLO+1›STA APPMHI+1›STA BUFMAX+1›PROC›JSR CUSTOM›JSR VBLANK;Set up console switch monitor›MAINJSR START;Set up tables & pointers›JSR GBINIT;Initialize GETBYT›:BLDLPJSR BUILD; build label & symbol›; tables for one›; object code segment.›LDA MORSEG›BNE :BLDLP; Do the same for the›; next segment.›JSR SYSEQU; Output equates for›; all system labels used.›JSR ZPEQU; Output zero-page equates›JSR GBINIT; Initialize GETBYT.›:DSLPJSR DSMAIN; Disassemble one segment.›LDA MORSEG›BNE :DSLP; Repeat for next segment.›JSR EXTEQU›WRAPLDY #20 ; Output end pseudo-op›WRAP1LDA ENDOP,Y›STA LINEBF,Y›DEY›BPL WRAP1›JSR RECOUT›LDX #$20; Close output file›LDA #CLOSE›STA ICCOM,X›JSR CIOV›LDX #0 ; Display "done" msg›LDA #PUTCHR›STA ICCOM,X›LDA MSG13L›STA ICBLL,X›STX ICBLH›LDA #LOW MSG13›STA ICBAL,X›LDA #HIGH MSG13›STA ICBAH,X›JSR CIOV›JSR GETMSG; Wait for CR›JMP (DOSVEC) ; Start over›EPROC›;›; Processing ends here and can be restarted›; with Sys Reset or .›;›INCLUDE D:CUSTOM.AMA›INCLUDE D:VBLANK.AMA›INCLUDE D:START.AMA›INCLUDE D:BUILD.AMA›INCLUDE D:SYSEQU.AMA›INCLUDE D:ZPEQU.AMA›INCLUDE D:DSMAIN.AMA›INCLUDE D:EXTEQU.AMA›INCLUDE D:DSMINS.AMA›INCLUDE D:SYSLABS.AMA›INCLUDE D:DISTABLE.AMA›INCLUDE D:SUBRS.AMA›INCLUDE D:SCREEN.AMA›INCLUDE D:DISKIO.AMA›;›BIGBUF= * ;Big Buffer starts here›END $2500›