8-Bit Software Online Conversion

Wapping editor viewer - Listing

10MODE 0 20ON ERROR VDU 7:RUN 30PROCassemble 40ON ERROR VDU 7:GOTO 60 50: 60REPEAT 70MODE 0 80RESTORE 85*DIR W 90*CAT 100INPUT'"Filename:"fname$ 110PRINT'"Invert?"; 120REPEAT 130pos=INSTR("NnYy",GET$) 140UNTIL pos>0 150VDU 23;8202;0;0;0; 160pos=(pos-1) DIV 2 170PRINT;MID$("NY",pos+1,1) 180?eor=pos*255 190: 200ch%=OPENIN(fname$) 210X%=&70 220Y%=ch% 230A%=2 240CALL &FFDA 250L%=?&70+(?&71*256) 260L%=L%-8 270: 280FOR loop=0 TO 7 290bytes?loop=BGET# ch% 300NEXT 310Y%=bytes?4+1 320?channel=ch% 330?rows=Y% 340: 350A%=(&3000)+((Y%-1)DIV 8)*640+((Y%-1 )MOD 8) 360?addr=A% MOD 256 370addr?1=A% DIV 256 380P%=((L%/Y%)-INT(L%/Y%))*8 390?extra=(P%-1) AND 7 400base=INT(L%/Y%) 410: 420FOR loop=0 TO ?extra 430FOR loop2=0 TO 7 440READ how 450howmany?loop2=base+how 460NEXT 470FOR loop2=0 TO 7 480READ shifttab?loop2 490NEXT 500NEXT 510IF INT(L%/Y%)=L%/Y% THEN ?endone=L% /Y% ELSE ?endone=INT(L%/Y%+1) 520?endone=?endone-1 530: 540CLS 550CALL &900 560CLOSE #ch% 570*FX 15,0 580key=GET 590UNTIL 0 600END 610: 620DEFPROCassemble 630addr=&70 640number=&72 650shift=&73 660extra=&74 670sub=&75 680rowno=&76 690rows=&77 700endone=&78 710addr2=&79 720channel=&7B 730eor=&7C 740: 750osbget=&FFD7 760osargs=&FFDA 770: 780PRINT'"Assembling Code..." 790: 800FOR pass=0 TO 2 STEP 2 810P%=&900 820[OPT pass 830LDA #0 840STA rowno 850.mainloop 860LDX rowno 870LDA howmany,X 880STA number 890JSR rdbytes 900LDX rowno 910LDA shifttab,X 920STA shift 930JSR grshift 940LDX extra 950LDY endone 960LDA bytes,Y 970AND mask,X 980STA bytes,Y 990JSR display 1000LDA addr 1010AND #7 1020BEQ sub633 1030LDA addr 1040SEC 1050SBC #1 1060STA addr 1070BCS donesub 1080DEC addr+1 1090JMP donesub 1100.sub633 1110LDA addr 1120SEC 1130SBC #633 MOD 256 1140STA addr 1150LDA addr+1 1160SBC #633 DIV 256 1170STA addr+1 1180.donesub 1190LDX #&A8 1200LDY channel 1210LDA #0 1220JSR osargs 1230LDA &A8 1240SEC 1250SBC #1 1260STA &A8 1270LDA &A9 1280SBC #0 1290STA &A9 1300LDX #&A8 1310LDY channel 1320LDA #1 1330JSR osargs 1340LDA rowno 1350CLC 1360ADC #1 1370AND #7 1380STA rowno 1390DEC rows 1400BNE mainloop 1410RTS 1420.shifttab 1430EQUD (0) 1440EQUD (0) 1450.howmany 1460EQUD (0) 1470EQUD (0) 1480.mask 1490EQUB (128):EQUB (192) 1500EQUB (224):EQUB (240) 1510EQUB (248):EQUB (252) 1520EQUB (254):EQUB (255) 1530.bytes 1540EQUS (STRING$(82," ")) 1550.rdbytes 1560LDY channel 1570LDX #0 1580.rdbloop 1590JSR osbget 1600EOR eor 1610STA bytes,X 1620INX 1630CPX number 1640BNE rdbloop 1650RTS 1660.grshift 1670LDA shift 1680BEQ shiftrts 1690LDX #81 1700CLC 1710.grsloop 1720ROL bytes,X 1730DEX 1740BPL grsloop 1750DEC shift 1760BNE grshift 1770.shiftrts 1780RTS 1790.display 1800LDA addr 1810STA addr2 1820LDA addr+1 1830STA addr2+1 1840LDX #255 1850.disploop 1860INX 1870LDA bytes,X 1880LDY #0 1890STA (addr2),Y 1900LDA addr2 1910CLC 1920ADC #8 1930STA addr2 1940BCC dispcc 1950INC addr2+1 1960.dispcc 1970CPX endone 1980BNE disploop 1990RTS 2000] 2010NEXT 2020ENDPROC 2030: 2040DATA 1,1,1,1,1,1,1,2 2050DATA 0,1,2,3,4,5,6,7 2060: 2070DATA 1,1,1,2,1,1,1,2 2080DATA 0,2,4,6,0,2,4,6 2090: 2100DATA 1,1,2,1,1,2,1,2 2110DATA 0,3,6,1,4,7,2,5 2120: 2130DATA 1,2,1,2,1,2,1,2 2140DATA 0,4,0,4,0,4,0,4 2150: 2160DATA 1,2,1,2,2,1,2,2 2170DATA 0,5,2,7,4,1,6,3 2180: 2190DATA 1,2,2,2,1,2,2,2 2200DATA 0,6,4,2,0,6,4,2 2210: 2220DATA 1,2,2,2,2,2,2,2 2230DATA 0,7,6,5,4,3,2,1 2240: 2250DATA 1,1,1,1,1,1,1,1 2260DATA 0,0,0,0,0,0,0,0