Skip to content

Commit

Permalink
Merge pull request #107 from skx/add-comment
Browse files Browse the repository at this point in the history
Added "#.com", which allows us to have comments
  • Loading branch information
skx authored May 28, 2024
2 parents 2458e06 + f123011 commit 8d6e320
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fcb/fcb.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func (f *FCB) DoesMatch(name string) bool {

// Repeat for the suffix.
for i, c := range f.Type {
if (tmp.Type[i] != c) && (f.Type[i] != '?') {
if (t[i] != c) && (t[i] != '?') {
return false
}
}
Expand Down
1 change: 1 addition & 0 deletions static/A/#.COM
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5 changes: 4 additions & 1 deletion static/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
#
# The files we wish to generate.
#
all: A/CCP.COM A/CONSOLE.COM A/CTRLC.COM A/QUIET.COM
all: A/\#.COM A/CCP.COM A/CONSOLE.COM A/CTRLC.COM A/QUIET.COM

#
# How to build them all - repetitive.
#
A/\#.COM:
pasmo comment.z80 A/#.COM

A/CCP.COM:
pasmo ccp.z80 A/CCP.COM

Expand Down
3 changes: 3 additions & 0 deletions static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ The embedded resources do not have 100% full functionality, you cannot bundle a

* [ccp.z80](ccp.z80)
* Change the CCP in-use at runtime.
* [comment.z80](comment.z80)
* Source to a program that does nothing, output to "`#.COM`".
* This is used to allow "`# FOO`" to act as a comment inside submit-files.
* [console.z80](console.z80)
* Toggle between ADM-3A and ANSI console output.
* [ctrlc.z80](ctrlc.z80)
Expand Down
26 changes: 26 additions & 0 deletions static/comment.z80
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
;; comment.z80 - A "do nothing" binary.
;;
;; This binary is useful because it allows SUBMIT-files
;; to contain comments. As everything is a binary in
;; CP/M we can implement comments by just creating a command
;; named "#" then the following will do nothing:
;;
;; # FOO BAR
;;
;; In reality the #.COM binary is loaded and "FOO BAR" are passed
;; to it as arguments. But the end result is "nothing" as this
;; binary immediately terminates.
;;


;;
;; CP/M programs start at 0x100.
;;
ORG 100H

;;
;; JP 0x0000, but shorter
;;
rst 0

END

0 comments on commit 8d6e320

Please sign in to comment.