Subversion Repositories Spectranet

[/] [branches/] [gnubinutils/] [modules/] [streams/] [init.asm] - Blame information for rev 380

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 225 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 380 winston
.include        "defs.inc"
23
.include        "spectranet.inc"
24
.text
25 225 winston
;-----------------------------------------------------------------------------
26
; F_init: Initializes the interpreter
27 380 winston
.globl F_init
28
F_init:
29 225 winston
        ld hl, PARSETABLE
30
        ld b, NUMCMDS
31 380 winston
.loop1:
32 225 winston
        push bc
33
        call ADDBASICEXT
34
        pop bc
35 380 winston
        jr c, .installerror1
36
        djnz .loop1
37 225 winston
        ld hl, STR_basicinit
38
        call PRINT42
39
        ret
40 380 winston
.installerror1:
41 225 winston
        ld hl, STR_basinsterr
42
        call PRINT42
43
        ret
44
 
45 308 winston
NUMCMDS         equ 9
46 225 winston
STREAMPAGE      equ 0xFF                ; This ROM
47 380 winston
PARSETABLE:
48
P_connect:      defb    0x0b
49 225 winston
                defw    CMD_CONNECT
50
                defb    STREAMPAGE
51
                defw    F_connect
52
 
53 380 winston
P_close:                defb    0x0b
54 225 winston
                defw    CMD_CLOSE
55
                defb    STREAMPAGE
56
                defw    F_close
57
 
58 380 winston
P_listen:       defb    0x0b
59 228 winston
                defw    CMD_LISTEN
60
                defb    STREAMPAGE
61
                defw    F_listen
62
 
63 380 winston
P_accept:       defb    0x0b
64 228 winston
                defw    CMD_ACCEPT
65
                defb    STREAMPAGE
66
                defw    F_accept
67 243 winston
 
68 380 winston
P_fopen:                defb    0x0b
69 243 winston
                defw    CMD_FOPEN
70
                defb    STREAMPAGE
71
                defw    F_fopen
72 228 winston
 
73 380 winston
P_opendir:      defb    0x0b
74 243 winston
                defw    CMD_OPENDIR
75
                defb    STREAMPAGE
76
                defw    F_opendir
77 228 winston
 
78 380 winston
P_oneof:                defb    0x0b
79 244 winston
                defw    CMD_ONEOF
80
                defb    STREAMPAGE
81
                defw    F_oneof
82
 
83 380 winston
P_reclaim:      defb    0x0b
84 249 winston
                defw    CMD_RECLAIM
85
                defb    STREAMPAGE
86
                defw    F_reclaim
87
 
88 380 winston
P_ctrl:         defb    0x0b
89 308 winston
                defw    CMD_CONTROL
90
                defb    STREAMPAGE
91
                defw    F_ctrl
92
 
93 380 winston
CMD_CONNECT:    defb    "%connect",0
94
CMD_CLOSE:      defb    "%close",0
95
CMD_LISTEN:     defb    "%listen",0
96
CMD_ACCEPT:     defb    "%accept",0
97
CMD_FOPEN:      defb    "%fopen",0
98
CMD_OPENDIR:    defb    "%opendir",0
99
CMD_ONEOF:      defb    "%oneof",0
100
CMD_RECLAIM:    defb    "%reclaim",0
101
CMD_CONTROL:    defb    "%control",0
102 225 winston