created scaffolding for import export code

This commit is contained in:
2023-02-12 01:40:34 +01:00
parent 518e7938d3
commit 9faf9d9046

36
src/bas/mlloader.bas Normal file
View File

@@ -0,0 +1,36 @@
10REM Main menu
20CLEAR:CLS
30PRINT "MACHINE LANGUAGE LOADER"
40N=PEEK(&H7FFF)*256+PEEK(&H7FFE)-1
50GOSUB 1000
60IF N<256 THEN PRINT "user area: NOT RESERVED":GOTO 70
65PRINT "user area: 0100H-";H$
70PRINT "work area: ";FRE;" bytes"
80PRINT "< Load Save Verify >"
90S=0
100K$=INKEY$
110IF K$="L" GOSUB 2000
120IF K$="S" GOSUB 3000
130IF K$="V" GOSUB 4000
140IF S=0 GOTO 100
150GOTO 20
999END
1000REM Converts the value of N into a hex-string and stores the result in N$
1010H$=""
1020FOR I = 3 TO 0 STEP -1
1030A=15:IF I=3 THEN A=7
1040T=(N AND (A*(16^I))) / (16^I)
1050IF T<10 THEN H$=H$+CHR$(T+48):GOTO 1070
1060H$=H$+CHR$(T+55)
1070NEXT I
1080H$=H$+"H"
1090RETURN
2000REM Loads a memory area from file
2010S=2000
2999RETURN
3000REM Saves a memory area to disk
3010S=3000
3999RETURN
4000REM Compares a memory area with the file on disk
4010S=4000
4999RETURN