forked from dmsc/fastbasic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.asm
More file actions
46 lines (41 loc) · 1.49 KB
/
Copy patherrors.asm
File metadata and controls
46 lines (41 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
;
; FastBasic - Fast basic interpreter for the Atari 8-bit computers
; Copyright (C) 2017-2025 Daniel Serpell
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program. If not, see <http://www.gnu.org/licenses/>
;
; Parser error messages
; ---------------------
.export error_msg_list
; Keep in line with error definitions
.code
error_msg_list = * - 1
.macro def_error name, msg
::name = <(* - error_msg_list)
.exportzp name
.repeat .strlen(msg)-1, I
.byte .strat(msg, I) * 2
.endrepeat
.byte .strat(msg, .strlen(msg)-1) * 2 + 1
.endmacro
def_error ERR_LABEL, "undef label"
def_error ERR_TOO_LONG, "too long"
def_error ERR_LOOP, "bad loop"
def_error ERR_PARSE, "parse error"
def_error ERR_NO_ELOOP, "no end loop/proc/if"
.if (* - error_msg_list) > 255
.error "Error, too many error messages"
.endif
.code
; vi:syntax=asm_ca65