Subversion Repositories Spectranet

[/] [trunk/] [modules/] [basext/] [init.asm] - Blame information for rev 288

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 221 winston
;The MIT License
2
;
3
;Copyright (c) 2009 Dylan Smith
4
;
5
;Permission is hereby granted, free of charge, to any person obtaining a copy
6
;of this software and associated documentation files (the "Software"), to deal
7
;in the Software without restriction, including without limitation the rights
8
;to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
;copies of the Software, and to permit persons to whom the Software is
10
;furnished to do so, subject to the following conditions:
11
;
12
;The above copyright notice and this permission notice shall be included in
13
;all copies or substantial portions of the Software.
14
;
15
;THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
;IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
;FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
;AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
;LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
;OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
;THE SOFTWARE.
22
 
23
;------------------------------------------------------------------------
24
; F_init: Initializes the interpreter
25
F_init
26
        ld hl, PARSETABLE
27
        ld b, NUMCMDS
28
.loop
29
        push bc
30
        call ADDBASICEXT
31
        pop bc
32
        jr c, .installerror
33
        djnz .loop
34 239 winston
 
35
        ; Install the default LOAD "" trap.
36
        call F_initbootfile
37
 
38 221 winston
        ld hl, STR_basicinit
39
        call PRINT42
40
        ret
41
.installerror
42
        ld hl, STR_basinsterr
43
        call PRINT42
44
        ret
45
STR_basicinit   defb    "BASIC extensions installed\n",0
46
STR_basinsterr  defb    "Failed to install BASIC extensions\n",0
47
 
48 288 winston
NUMCMDS         equ     13
49 221 winston
PARSETABLE
50
P_mount         defb    0x0b
51
                defw    CMD_MOUNT
52
                defb    TNFS_PAGE
53
                defw    F_tbas_mount    ; Mount routine
54
P_umount        defb    0x0b
55
                defw    CMD_UMOUNT
56
                defb    TNFS_PAGE
57
                defw    F_tbas_umount   ; Umount routine
58
P_chdir         defb    0x0b
59
                defw    CMD_CHDIR
60
                defb    TNFS_PAGE
61
                defw    F_tbas_chdir    ; Chdir routine
62
P_cat           defb    0x0b
63 225 winston
                defw    CMD_LS          ; Display a directory
64 221 winston
                defb    TNFS_PAGE
65
                defw    F_tbas_ls
66
P_aload         defb    0x0b
67
                defw    CMD_ALOAD       ; Arbitrary load
68
                defb    TNFS_PAGE
69
                defw    F_tbas_aload
70
P_load          defb    0x0b
71
                defw    CMD_LOAD        ; Standard LOAD command
72
                defb    TNFS_PAGE
73
                defw    F_tbas_load
74
P_save          defb    0x0b
75 225 winston
                defw    CMD_SAVE        ; Standard SAVE command
76 221 winston
                defb    TNFS_PAGE
77
                defw    F_tbas_save
78 222 winston
P_tapein        defb    0x0b
79 225 winston
                defw    CMD_TAPEIN      ; Set up a tape trap for a TAP file
80 222 winston
                defb    TNFS_PAGE
81
                defw    F_tbas_tapein
82 255 winston
P_info          defb    0x0b
83 225 winston
                defw    CMD_INFO        ; Give information on a file
84
                defb    TNFS_PAGE
85
                defw    F_tbas_info
86 255 winston
P_fs            defb    0x0b
87 238 winston
                defw    CMD_FS
88
                defb    TNFS_PAGE
89
                defw    F_tbas_fs
90 255 winston
P_loadsnap      defb    0x0b
91
                defw    CMD_LOADSNAP
92
                defb    TNFS_PAGE
93
                defw    F_loadsnap
94 288 winston
P_mv            defb    0x0b
95
                defw    CMD_MV          ; Rename a file
96
                defb    TNFS_PAGE
97
                defw    F_tbas_mv
98
P_rm            defb    0x0b
99
                defw    CMD_RM          ; Remove a file
100
                defb    TNFS_PAGE
101
                defw    F_tbas_rm
102 221 winston
 
103
CMD_MOUNT       defb    "%mount",0
104
CMD_UMOUNT      defb    "%umount",0
105
CMD_CHDIR       defb    "%cd",0
106
CMD_LS          defb    "%cat",0
107
CMD_ALOAD       defb    "%aload",0
108
CMD_LOAD        defb    "%load",0
109
CMD_SAVE        defb    "%save",0
110 222 winston
CMD_TAPEIN      defb    "%tapein",0
111 225 winston
CMD_INFO        defb    "%info",0
112 238 winston
CMD_FS          defb    "%fs",0
113 255 winston
CMD_LOADSNAP    defb    "%loadsnap",0
114 288 winston
CMD_MV          defb    "%mv",0
115
CMD_RM          defb    "%rm",0
116 221 winston