home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RBBS in a Box Volume 1 #3.1
/
RBBSIABOX31.cdr
/
mlpc
/
memintel.bas
< prev
next >
Wrap
BASIC Source File
|
1985-08-19
|
1KB
|
50 lines
1 REM "Memory to INTEL (MCS-86) Hex Converter"
10 V$="1.0"
20 CLS
30 DEFINT A-Z
40 LOCATE 1,20
50 PRINT "ROM to Intel Hex (MCS-86) Converter ";V$
60 LOCATE 5,20
70 LINE INPUT "Enter Starting Paragraph. ";ROM$
80 ROM$="&H"+ROM$
90 SEG=VAL(ROM$)
100 DEF SEG=SEG
110 LOCATE 7,20
120 LINE INPUT "File to Contain Hex Code? ";FILE$
130 OPEN "O",#1,FILE$
140 LOCATE 9,20
150 LINE INPUT "Enter Number of Bytes . . ";NUMBYTES$
160 NUMBYTES=VAL(NUMBYTES$)
170 NUMPARAGRAPHS=NUMBYTES/16
180 LOCATE 11,20 : PRINT "Paragraphs to go . . . . ";
190 FOR J=0 TO NUMPARAGRAPHS-1
200 LOCATE 11,45
210 PRINT NUMPARAGRAPHS-(J+1)
220 PRINT #1,
230 PRINT #1,":10";
240 CKSUM=&H10
250 X=((J AND &HFF0)/16) AND &HFF
260 CKSUM=CKSUM+X
270 PRINT #1,RIGHT$("00"+HEX$(X),2);
280 X=(J AND &HF)*16
290 CKSUM=CKSUM+X
300 PRINT #1,RIGHT$("00"+HEX$(X),2);
310 PRINT #1,"00";
320 FOR I=0 TO 15
330 X=PEEK (I+(J*16))
340 PRINT #1,RIGHT$("00"+HEX$(X),2);
350 CKSUM=CKSUM+X
360 NEXT I
370 CKSUM=CKSUM AND &HEF
380 CKSUM=-CKSUM AND &HEF
390 PRINT #1,RIGHT$("00"+HEX$(CKSUM),2);
400 NEXT J
410 PRINT #1, :PRINT #1,":00000001FF"
420 CLOSE
430 LOCATE 13,20 : LINE INPUT "More ROMs to do? ";Y$
440 IF LEFT$(Y$,1)="Y" OR LEFT$(Y$,1)="y" THEN 10
450 LOCATE 15,20
460 LINE INPUT "Exit Basic? ";Y$
470 IF LEFT$(Y$,1)="Y" OR LEFT$(Y$,1)="y" THEN CLS : SYSTEM
480 END