Commit graph

41 commits

Author SHA1 Message Date
Justine Tunney
1e9c7fca35 Shave another fifteen bytes (now 438 bytes)
%bx wasn't needed in PutChar since we're assuming the machine boots
in a non-graphical mode, i.e. BIOS teletype. In MDA mode BX will be
2 which is dark green on black. The same probably applies with CGA.

Now that BX is always two, we can now use multi-register addressing
when accessing CDR cells. That's a huge savings, since we no longer
need all those displacement bytes; we only need the modrm.

%cx wasn't needed it could be replaced with %si in GetToken thereby
making it possible to remove our use of the %fs register.

Changing the second argument Cons() from %si not %ax helped to save
even more space, since all the things that called it needed to move
the register from %ax to %si.
2021-11-16 10:17:10 -08:00
Justine Tunney
49c538778a Shave another byte and improve asm readability
This changes fixes an issue where clearing the bss could overlap
the stack memory used in the early initialization code.

This change fixes a regression caused by an earlier commit with
nul terminators. Builtins are now automatically numbered.

Comments have been added and labels have been redefined to add
further clarity to how the assembly works. The most beautiful of
which is the code that merges Cadr, Cdr, and Car into one func.
2021-11-16 07:09:58 -08:00
Justine Tunney
532b92688e Fix regression in C code for PrintList()
Fixes #11
2021-11-16 00:05:30 -08:00
Peter Ferrie
522f0a16fd shave two bytes, fix memory init 2021-11-15 21:05:27 -08:00
Justine Tunney
2c760a29e4 Fix extra arg in LISP evaluator
Fixes #12 reported by @derhexenmeister
2021-11-13 15:16:37 -08:00
Peter Ferrie
df9c01c46c back to 386+ CPU 2021-11-08 10:50:15 -08:00
Peter Ferrie
74b20f759e shave one byte 2021-11-08 09:51:36 -08:00
Peter Ferrie
c2a2561366 trim binary 2021-11-08 08:10:54 -08:00
Peter Ferrie
8afbbdd383 shave some bytes 2021-11-08 08:09:12 -08:00
Peter Ferrie
21383822a7 Revert "shave another six bytes"
This reverts commit 8f5f932098.
2021-11-07 22:28:49 -08:00
Peter Ferrie
8f5f932098 shave another six bytes 2021-11-07 21:24:36 -08:00
Justine Tunney
9bb9c6e04c Shave six more bytes 2021-11-07 12:32:23 -08:00
Justine Tunney
9f108b0d60
Merge pull request #10 from peterferrie/main
shave some bytes
2021-11-06 00:59:27 -07:00
Peter Ferrie
98e028d13b restore load address, no need to change after all 2021-11-05 15:21:25 -07:00
Peter Ferrie
0fb8fa3b2a shave one more byte 2021-11-05 15:17:06 -07:00
Peter Ferrie
a0f739da58 shave some bytes 2021-11-05 14:30:46 -07:00
Peter Ferrie
ec2c93295f shave two more bytes 2021-11-05 13:28:00 -07:00
Peter Ferrie
9cde674c1a shave two more bytes 2021-11-05 12:35:03 -07:00
Peter Ferrie
93d01e6932 shave one more byte 2021-11-05 12:23:43 -07:00
Peter Ferrie
50c85199fe shave one more byte 2021-11-05 11:58:36 -07:00
Peter Ferrie
69085d0674 shave two more bytes 2021-11-05 11:22:45 -07:00
Peter Ferrie
3cb4b9743f shave one more byte 2021-11-05 10:47:36 -07:00
Peter Ferrie
bf27f44569 fix typo and avoid stack-race 2021-11-03 21:23:09 -07:00
Peter Ferrie
adb7310d57 shave some bytes 2021-11-02 12:14:10 -07:00
agreppin
1f066da3a1
Merge pull request #9 from peterferrie/main
shave some bytes (credits @peterferrie)
2021-11-02 14:47:02 +01:00
Peter Ferrie
a469910340 shave some bytes 2021-10-31 09:54:36 -07:00
Justine Tunney
05d2bcbfd9 Improve LISP/C/ASM Rosetta Stone consistency 2021-10-30 00:42:55 -07:00
Justine Tunney
e09cdf6619 Remove more non-essential code 2021-10-26 19:53:17 -07:00
Justine Tunney
4233210a86 Remove old code and update documentation 2021-10-08 21:26:31 -07:00
Alain Greppin
cbb4ecc4d5 test files added 2021-10-03 17:03:58 +02:00
Alain Greppin
b77c74543d latest sectorlisp.bin 2021-10-03 16:24:53 +02:00
Alain Greppin
3b26982d9c Eval based on LISP 1.5 manual, 509 bytes 2021-09-28 05:25:24 -07:00
Ilya Kurdyukov
333c5efba4 smaller Intern function 2021-09-28 02:43:05 -07:00
Justine Tunney
2c1ddc26da Fix LICENSE file name 2021-03-05 12:20:03 -08:00
Scott Wolchok
4a045620bb Fix sizeof kSymbols 2021-02-27 22:57:06 -08:00
Scott Wolchok
1058c959d8 remove extra trailing NUL on kSymbols
It wastes a byte this way -- see https://godbolt.org/z/nEj9hc
See diff of hexdump of sectorlisp.bin before/after:

```
*** before.txt  2021-02-27 13:17:47.842081600 -0800
--- after.txt   2021-02-27 13:16:40.789140700 -0800
***************
*** 31,33 ****
  000001e0: 4551 0043 4f4e 4400 4341 5200 4344 5200  EQ.COND.CAR.CDR.
! 000001f0: 434f 4e53 004c 414d 4244 4100 0090 55aa  CONS.LAMBDA...U.
  00000200: f7c7 0100 7509 d1ef 8db5 8641 e9a3 ff53  ....u......A...S
--- 31,33 ----
  000001e0: 4551 0043 4f4e 4400 4341 5200 4344 5200  EQ.COND.CAR.CDR.
! 000001f0: 434f 4e53 004c 414d 4244 4100 6690 55aa  CONS.LAMBDA.f.U.
  00000200: f7c7 0100 7509 d1ef 8db5 8641 e9a3 ff53  ....u......A...S
```

Second zero byte after LAMBDA is now uninitialized.
2021-02-27 22:57:06 -08:00
Justine Tunney
8a29ec3b23 Reduce sectorlisp to 836 bytes 2021-02-04 01:18:34 -08:00
Justine Tunney
b64b27feb8
Merge pull request #1 from moon-chilled/main
Minor tweaks so the assembly builds with clang
2020-10-27 14:40:00 -07:00
Moonchild
d56afe537c minor tweaks so the assembly builds with clang 2020-10-27 14:20:22 -07:00
Justine Tunney
665668a7a0 Reduce sectorlisp from 948 to 856 bytes 2020-10-27 13:45:12 -07:00
Justine Tunney
a561e031ae Initial import 2020-10-26 18:21:15 -07:00