Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro #260

Merged
merged 2 commits into from
Aug 10, 2019
Merged

Macro #260

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 11 additions & 38 deletions forth.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3294,25 +3294,18 @@ BCOMP:
; Compile an integer into
; code dictionary.

; HEADER COMMA ","
.dw LINK

LINK = .
.db 1
.ascii ","
; macro workaround: escape for ","
HEADER COMMA "\054"
COMMA:
DoLitC 2
CALLR OMMA
JP STORE

; C, ( c -- )
; Compile a byte into code dictionary.
; HEADER CCOMMA "C,"
.dw LINK

LINK = .
.db 2
.ascii "C,"
; macro workaround: escape for "C,"
HEADER CCOMMA "C\054"
CCOMMA:
CALL ONE
CALLR OMMA
Expand All @@ -3327,16 +3320,9 @@ OMMA:

; CALL, ( ca -- )
; Compile a subroutine call.
.ifeq BAREBONES
.ifeq UNLINK_JSRC
; HEADER JSRC "CALL,"
.dw LINK

LINK = .
.db 5
.ascii "CALL,"
.endif
.endif
; macro workaround: escape for "CALL,"
HEADER JSRC "CALL\054"
JSRC:
CALL DUPP
CALL HERE
Expand Down Expand Up @@ -3422,14 +3408,9 @@ COMPIO2:
; $," ( -- )
; Compile a literal string
; up to next " .
.ifeq UNLINK_STRCQ
; HEADER STRCQ '$,"'
.dw LINK

LINK = .
.db 3
.ascii '$,"'
.endif
; macro workaround: escape for "$,""
HEADER STRCQ '$\054"'
STRCQ:
DoLitC 34 ; "
CALL PARSE
Expand Down Expand Up @@ -3671,16 +3652,8 @@ UNIQ1: JP DROP
; Build a new dictionary name
; using string at na.

.ifne WORDS_LINKCOMP
.ifeq UNLINK_SNAME
; HEADER SNAME "$,n"
.dw LINK

LINK = .
.db 3
.ascii "$,n"
.endif
.endif
; macro workaround: escape for "$,n"
HEADER SNAME "$\054n"
SNAME:
CALL DUPPCAT ; ?null input
CALL QBRAN
Expand Down Expand Up @@ -4313,8 +4286,8 @@ WIPE:
INCW X
LDW USRCP,X ; done
POPW X
.endif
JP OVERT ; initialize CONTEXT from USRLAST
.endif

;===============================================================

Expand Down
4 changes: 3 additions & 1 deletion inc/defconf.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
; Default settings for all kinds of options
;--------------------------------------------------------
RELVER1 = 2 ; Revision digit 1
RELVER0 = 3 ; Revision digit 0
RELVER0 = 4 ; Revision digit 0

TERM_LINUX = 1 ; LF terminates line

Expand Down Expand Up @@ -236,6 +236,8 @@
UNLINK_EVAL = 1 ; "EVAL"
UNLINK_QUIT = 1 ; "QUIT"
UNLINK_TICK = 0 ; "'"
UNLINK_COMMA = 0 ; ","
UNLINK_CCOMMA = 0 ; "C,"
UNLINK_JSRC = 0 ; "CALL,"
UNLINK_LITER = 0 ; "LITERAL"
UNLINK_BCOMP = 0 ; "[COMPILE]"
Expand Down