10'Z80-Disassembler for SHARP PC-E220
20DIM LI$(0)*48:'GOSUB *LOAD
30*START:CLS
40PRINT "  * Z80 Disassembler *":PRINT USING "######"; FRE ; " BASIC bytes free"
50PRINT "1-LCD, 2-SIO, 4-LPT":INPUT "output mask? ";OM
60IF OM<1 OR OM>7 THEN 50
70INPUT "start address=";AD$:AD= VAL ("&H"+AD$)
80IF (OM AND 1)=0 THEN INPUT "stop address=";ST$:ST= VAL ("&H"+ST$)
85IF (OM AND 2)<>0 THEN OPEN "COM:"
90PRINT "hit any key to start";
100IF INKEY$ ="" THEN 100
110LI=0:CLS
120*LOOP:IF (OM AND 1) =0 AND AD=ST THEN END
130HI= INT (AD/256):LO=AD-HI*256
140DT= PEEK &H010A+256* PEEK &H010B:IN= PEEK &H010E+256* PEEK &H010F:POKE IN,LO:POKE IN+1,HI:POKE DT,&HD0:POKE DT+1,&H77:CALL &H0100:LO= PEEK IN:HI= PEEK (IN+1):AD=HI*256+LO
150IF (OM AND 4) <> 0 THEN LPRINT LI$(0)
160IF (OM AND 2) <> 0 THEN PRINT # 1,LI$(0)
170IF (OM AND 1) <> 0 THEN PRINT LI$(0);:LI=LI+1
180IF LI<>2 THEN *LOOP
190K$= INKEY$ : IF K$="" THEN 190
200IF K$="N" THEN *START
210IF K$="X" THEN END
220CLS :LI=0:GOTO *LOOP
