home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ABBUC Sondermagazin 20A
/
ABBUC_Sondermagazin_20_19xx_ABBUC_Side_A.atr
/
vmlib.mac
< prev
Wrap
Text File
|
2023-02-26
|
5KB
|
1 lines
0100 ; SpartaDOS X equates¢0105 ;¢0110 BUF580 = $0580¢0115 SDFLG = $0700¢0120 SDVER = $0701¢0125 FILEID = $0760¢0130 OPMODE = $0778¢0135 FAUX1 = $0782¢0140 FAUX2 = $0783¢0145 FAUX3 = $0784¢0150 FAUX4 = $0785¢0155 FAUX5 = $0786¢0160 FILE.P = $0C5A¢0165 FOPEN = $AC56¢0170 FCLOSE = $ACC3¢0175 FREAD = $AC14¢0180 FWRITE = $AC17¢0185 FSEEK = $ACCC¢0190 FPUTC = $AD8C¢0195 GETENV = $BA93¢0200 CARTID = $BD7D¢0205 ;¢0210 ; Operating System equates¢0215 ;¢0220 FR0 = $D4¢0225 CIX = $F2¢0230 INBUFP = $F3¢0235 AFP = $D800¢0240 FPI = $D9D2¢0245 ;¢0250 ;-----------------------------¢0255 ; Virtual Memory Library V.1.0¢0260 ; for SpartaDOS X Applications¢0265 ; Last minute updates: 5.IX.95¢0270 ;-----------------------------¢0275 ;VMINIT - inicjowanie¢0280 ;VMCLOSE - koniec pracy¢0285 ;-----------------------------¢0290 ;VMLDA - odczyt bajtu do A¢0295 ;VMSTA - zapis bajtu z A¢0300 ;VMLDAX - odczyt slowa do AX¢0305 ;VMSTAX - zapis slowa do AX¢0310 ;VMGETBL - odczyt bloku¢0315 ;VMPUTBL - zapis bloku¢0320 ;-----------------------------¢0325 ;VMPATH - zmienna srodowiskowa¢0330 ;okreslajaca sciezke dostepu¢0335 ; do pliku pamieci wirtualnej¢0340 ;VMSIZE - zmienna okreslajaca¢0345 ; rozmiar tego pliku w KB.¢0350 ;-----------------------------¢0355 ;¢0360 .MACRO VMINIT ¢0365 JMP @SKIP¢0370 ;¢0375 @VMBUF *= *+$10¢0380 @VMPATH *= *+$40¢0385 @VMFILE *= *+$01¢0390 @VMSIZE .WORD $40¢0395 @NAME1 .BYTE "VMPATH=",$9B¢0400 @NAME2 .BYTE "VMSIZE=",$9B¢0405 @SDXID .BYTE "Cart 4.0"¢0410 ;¢0415 @SDXTEST LDA SDFLG¢0420 CMP #'S¢0425 BNE @NSD¢0430 LDA SDVER¢0435 CMP #$40¢0440 BCC @NSD¢0445 LDY #$07¢0450 @SDL LDA @SDXID,Y¢0455 CMP CARTID,Y¢0460 BNE @NSD¢0465 DEY ¢0470 BPL @SDL¢0475 LDY #$01¢0480 RTS ¢0485 @NSD LDY #$FF¢0490 STY @VMFILE¢0495 RTS ¢0500 @SKIP JSR @SDXTEST¢0505 BMI @NSD¢0510 LDA #$00¢0515 LDY #$50¢0520 @LP0 STA @VMBUF,Y¢0525 DEY ¢0530 BPL @LP0¢0535 LDA # <@NAME1¢0540 LDX # >@NAME1¢0545 JSR GETENV¢0550 BMI @NSD¢0555 LDY #$00¢0560 @LP1 LDA BUF580,Y¢0565 STA @VMPATH,Y¢0570 CMP #$9B¢0575 BEQ @FN¢0580 INY ¢0585 BNE @LP1¢0590 @FN LDA # <@NAME2¢0595 LDX # >@NAME2¢0600 JSR GETENV¢0605 BMI @SK0¢0610 LDY #$00¢0615 @LP2 LDA BUF580,Y¢0620 STA @VMBUF,Y¢0625 CMP #$9B¢0630 BEQ @FN0¢0635 INY ¢0640 CPY #$10¢0645 BNE @LP2¢0650 @FN0 LDA # <@VMBUF¢0655 STA INBUFP¢0660 LDA # >@VMBUF¢0665 STA INBUFP+1¢0670 LDA #$00¢0675 STA CIX¢0680 JSR AFP¢0685 JSR FPI¢0690 LDA FR0¢0695 STA @VMSIZE¢0700 LDA FR0+1¢0705 STA @VMSIZE+1¢0710 @SK0 LDA #$0C¢0715 STA OPMODE¢0720 LDA # <@VMPATH¢0725 STA FILE.P¢0730 LDA # >@VMPATH¢0735 STA FILE.P+1¢0740 JSR FOPEN¢0745 BNE @NSD¢0750 LDA FILEID¢0755 STA @VMFILE¢0760 LDA @VMSIZE¢0765 LDX @VMSIZE+1¢0770 LDY #$01¢0775 RTS ¢0780 .ENDM ¢0785 ;¢0790 .MACRO VMCLOSE ¢0795 LDA @VMFILE¢0800 BMI @SCL¢0805 STA FILEID¢0810 JSR FCLOSE¢0815 @SCL¢0820 .ENDM ¢0825 ;¢0830 ; VMLDA adres¢0835 ;¢0840 .MACRO VMLDA ¢0845 LDA %1¢0850 STA FAUX1¢0855 LDA %1+1¢0860 STA FAUX2¢0865 LDA %1+2¢0870 STA FAUX3¢0875 LDA @VMFILE¢0880 STA FILEID¢0885 JSR FSEEK¢0890 JSR FGETC¢0895 .ENDM ¢0900 ;¢0905 ; VMSTA adres¢0910 ;¢0915 .MACRO VMSTA ¢0920 PHA ¢0925 LDA %1¢0930 STA FAUX1¢0935 LDA %1+1¢0940 STA FAUX2¢0945 LDA %1+2¢0950 STA FAUX3¢0955 LDA @VMFILE¢0960 STA FILEID¢0965 JSR FSEEK¢0970 PLA ¢0975 JSR FPUTC¢0980 .ENDM ¢0985 ;¢0990 ; VMLDAX adres¢0995 ;¢1000 .MACRO VMLDAX ¢1005 LDA %1¢1010 STA FAUX1¢1015 LDA %1+1¢1020 STA FAUX2¢1025 LDA %1+2¢1030 STA FAUX3¢1035 LDA @VMFILE¢1040 STA FILEID¢1045 JSR FSEEK¢1050 JSR FGETC¢1055 PHA ¢1060 JSR FGETC¢1065 TAX ¢1070 PLA ¢1075 .ENDM ¢1080 ;¢1085 ; VMSTAX adres¢1090 ;¢1095 .MACRO VMSTAX ¢1100 TAY ¢1105 TXA ¢1110 PHA ¢1115 TYA ¢1120 PHA ¢1125 LDA %1¢1130 STA FAUX1¢1135 LDA %1+1¢1140 STA FAUX2¢1145 LDA %1+2¢1150 STA FAUX3¢1155 LDA @VMFILE¢1160 STA FILEID¢1165 JSR FSEEK¢1170 PLA ¢1175 JSR FPUTC¢1180 PLA ¢1185 JSR FPUTC¢1190 .ENDM ¢1195 ;¢1200 ; VMGETBL skad,dokad,ile¢1205 ;¢1210 .MACRO VMGETBL ¢1215 LDA %1¢1220 STA FAUX1¢1225 LDA %1+1¢1230 STA FAUX2¢1235 LDA %1+2¢1240 STA FAUX3¢1245 LDA @VMFILE¢1250 STA FILEID¢1255 JSR FSEEK¢1260 LDA %2¢1265 STA FAUX1¢1270 LDA %2+1¢1275 STA FAUX2¢1280 LDA %3¢1285 STA FAUX4¢1290 LDA %3+1¢1295 STA FAUX5¢1300 JSR FREAD¢1305 .ENDM ¢1310 ;¢1315 ; VMPUTBL skad,dokad,ile¢1320 ;¢1325 .MACRO VMPUTBL ¢1330 LDA %2¢1335 STA FAUX1¢1340 LDA %2+1¢1345 STA FAUX2¢1350 LDA %2+2¢1355 STA FAUX3¢1360 LDA @VMFILE¢1365 STA FILEID¢1370 JSR FSEEK¢1375 LDA %1¢1380 STA FAUX1¢1385 LDA %1+1¢1390 STA FAUX2¢1395 LDA %3¢1400 STA FAUX4¢1405 LDA %3+1¢1410 STA FAUX5¢1415 JSR FWRITE¢1420 .ENDM ¢