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

cas input and output formats #141

Merged
merged 1 commit into from Oct 21, 2019

Conversation

larsbrinkhoff
Copy link
Contributor

@larsbrinkhoff larsbrinkhoff commented Oct 21, 2019

Where is an appropriate place to document the input and output formats for the cas program?

@larsbrinkhoff
Copy link
Contributor Author

larsbrinkhoff commented Oct 21, 2019

I believe it's something like this:

  • : means record following string as a label.
  • x means following moves are invisible.
  • v means following moves are visible.
  • r means end, output label=x-b+number.
  • All other commands are character pairs denoting y,x coordinates in a 13x14 character raster. Draw a line to that coordinate. Vertical coordinates are a-n, and horizontal are a-m. aa is upper left and mn is lower right.

@larsbrinkhoff larsbrinkhoff changed the title cas input format cas input and output formats Oct 21, 2019
@larsbrinkhoff
Copy link
Contributor Author

larsbrinkhoff commented Oct 21, 2019

The output is:

  1. The label x:
  2. 18-bit octal words. Each word is three 6-bit incremental moves.
  3. label=x-b+number. Number is 01, six bits saying how many moves, and 10 zeroes.

@larsbrinkhoff
Copy link
Contributor Author

larsbrinkhoff commented Oct 21, 2019

Example input:

:lbk
x
ai
v
af
mf
mj
x
mn
r

Character labelled "lbk" (left bracket). Move invisibly to "ai" near upper right. Draw line left to "af". Draw down to "mf". Draw right to "mj". Invisibly move to "mn" at lower right. End.

Output:

x:
0010101
0010101
0010160
0567474
0747262
lbk=x-b+0236000

01 means move diagonally up and right one step; do this eight times. 60 means move up four steps. 56 means draw left three steps. 74 means draw down four steps. 72 means draw left four steps. 62 means move left four steps.

0236000 means there are 15 moves, or 6-bit bytes.

@sebras
Copy link
Contributor

sebras commented Oct 21, 2019

Where is an appropriate place to document the input and output formats for the cas program?

There is a file documenting PDP-7 assembler in misc/asm_syntax.txt.
Having a misc/cas_syntax.txt with your example above would make sense to me.

@larsbrinkhoff
Copy link
Contributor Author

Thank you. I turned this into a pull request.

I hand checked the output against the input, and there are inconsistencies. I can also see this in the displayed characters. So we don't know everything about this yet.

r means end, output label=x-b+number.

All other commands are character pairs denoting y,x coordinates in a
12x14 character raster. Draw a line to that coordinate. Vertical
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you mention a 12x14 raster (stretching over a-l and a-m), but in the pull request text you describe a 13x14 raster (stretching over a-n and a-m).

Doing some quick checks of the contents of cas.x and scope.x I can see that for cas.x the coordinates are in the ranges a-n and a-n while in scope.x they vary between a-p and a-n respectively. That doesn't match this format.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some statistics over all coordinates used in cas.x and scope.x:

Characters using to the vertical o coordinate are :lj, :ly, :comma, :semcln while characters using to the vertical p coordinate are :lg, :lp and :lq. This seems reasonable since the characters g, j, p, q and y all have descenders that fall below the base line of other characters.

Moreover if the vertical coordinate range is a-p and the horizontal coordinate range is a-n, it means that the character grid is 16x14 coordinates, where 16 is a power of 2, which rather satisfies my computer engineering heart. :)

Doing new pass of statistics over all letters and numbers in cas.x and scope.x but omitting :lg, :lj, :lp, :lq and :ly reveals that characters that do not have descenders have vertical coordinates in the range a-n and horizontal coordinates in the range a-n. This indicates that coordinate n is at the base line, while coordinates o and p fall below the base line. I'm not sure if this helps with placing characters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I updated the text. Characters are normally 12 units wide, a-l. n is only used to advance to the next character, right? Did you include mn in your statistics?

I view m as the base line.

You are right about descenders. I'll update the text.

@philbudne philbudne merged commit 17c9581 into DoctorWkt:master Oct 21, 2019
@larsbrinkhoff larsbrinkhoff deleted the lars/cas_syntax branch October 22, 2019 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants