Commit Graph

6690 Commits

Author SHA1 Message Date
Kartik Agaram eb40c70e26 6440
Minor reordering; the hacky flush-stdout is now only needed if we ever
call print-int32-to-screen.
2020-05-29 16:41:51 -07:00
Kartik Agaram d4a7c53519 6439
Make print-byte less error-prone to use. Now none of our screen primitives
are buffered.
2020-05-29 16:39:53 -07:00
Kartik Agaram 1a147cc040 6438 - multiple pages on screen
At the moment the number of pages is hard-coded to my screen width.
2020-05-29 16:36:15 -07:00
Kartik Agaram cb0caab25c 6437 - check screen/window dimensions
This was why I was trying to use a different output register: a second
function to call.

And I managed to mess it up again, changing the output of load-file, but
not how it was computed in the body.
2020-05-29 16:24:31 -07:00
Kartik Agaram 77b43b007f 6436 2020-05-29 16:24:31 -07:00
Kartik Agaram 99558d26d1 6435 2020-05-29 16:24:31 -07:00
Kartik Agaram 05fa1791c5 6434 2020-05-29 15:59:24 -07:00
Kartik Agaram ff2ee75818 6433 - render newlines correctly
There were three confounding issues to get past before this seemed to be
working right:
  - row/col count from 1 rather than 0
  - I was thinking in decimal rather than hex
  - print-byte buffers to stdout, but print-string does not. I didn't think
    this mattered, but it does matter to flush the current line before
    moving cursor again.

Only one of these issues was a bug in the code. The first two were bugs
in my mental model that necessitated no changes to code to be corrected.
2020-05-29 15:56:24 -07:00
Kartik Agaram 2fb656b4f4 6432 - paginator starting to take shape 2020-05-29 15:23:36 -07:00
Kartik Agaram 0a80e66f6e 6431 - Mu function blocks can double as loops 2020-05-29 15:21:56 -07:00
Kartik Agaram d2578eedcf 6430
Perhaps the lack of safety just forces us to make smaller functions, like
Forth.
2020-05-29 15:18:06 -07:00
Kartik Agaram dac00bd943 6429
Baby steps. I managed to mess up even this tiny refactoring of print-file.mu.
Wish output registers were already checked in calls.
2020-05-29 15:09:04 -07:00
Kartik Agaram 0ae8a9f5ad 6428 2020-05-29 14:10:41 -07:00
Kartik Agaram 3fe43bca71 6427 2020-05-29 00:35:21 -07:00
Kartik Agaram aee83e2752 6426 2020-05-28 23:07:56 -07:00
Kartik Agaram 43ce7fdf59 6425 2020-05-28 22:51:43 -07:00
Kartik Agaram 967d11f102 6424 2020-05-28 22:48:40 -07:00
Kartik Agaram b22fa8afd8 6423 - done with sample app 'print-file'
Observations:
  - the orchestration from 'in' to 'addr-in' to '_in-addr' to 'in-addr'
    is quite painful. Once to turn a handle into its address, once to turn
    a handle into the address of its payload, and a third time to switch
    a variable out of the overloaded 'eax' variable to make room for read-byte-buffered.
  - I'm starting to use SubX as an escape hatch for features missing in Mu:
    - access to syscalls (which pass args in registers)
    - access to global variables
2020-05-28 22:41:26 -07:00
Kartik Agaram 583a966d3e 6422 - size-of for handles 2020-05-28 22:31:52 -07:00
Kartik Agaram 429cebf3e4 6421 2020-05-28 21:50:31 -07:00
Kartik Agaram 5cccde6a9c 6420
Starting to feel the need for more static checks, like when I must use a
register, or when a variable has been clobbered.

The good news: I thought I'd found a bug in apps/mu, but I hadn't.
2020-05-28 21:45:27 -07:00
Kartik Agaram 3962ac5959 6419 - new primitive for opening files 2020-05-28 21:33:04 -07:00
Kartik Agaram db9932a9e2 6418 2020-05-28 21:26:03 -07:00
Kartik Agaram 16cf82732a 6417 2020-05-28 21:25:25 -07:00
Kartik Agaram dce349f52c 6416 2020-05-28 10:07:59 -07:00
Kartik Agaram dd6e4bc789 6415 2020-05-27 23:48:27 -07:00
Kartik Agaram 8f4438e526 6414 2020-05-27 20:50:41 -07:00
Kartik Agaram d3bca9dbfe 6413
Fix CI.
2020-05-27 01:53:16 -07:00
Kartik Agaram 6e31354543 6412 2020-05-27 01:49:56 -07:00
Kartik Agaram 9f9aad345d 6410 2020-05-27 01:41:55 -07:00
Kartik Agaram 415354264b 6410 - primitives for raw keyboard input 2020-05-27 01:41:35 -07:00
Kartik Agaram 9511ff5cd7 6409 - primitives for text-mode UIs 2020-05-27 00:09:22 -07:00
Kartik Agaram 985f7f79be 6408 2020-05-27 00:01:12 -07:00
Kartik Agaram 58d866d7a4 6407 2020-05-25 19:43:11 -07:00
Kartik Agaram 3b5b19df66 6406 - primitive 'copy-handle' 2020-05-25 19:26:18 -07:00
Kartik Agaram d796318101 6405 2020-05-25 00:58:12 -07:00
Kartik Agaram a01ddfa22d 6404 2020-05-25 00:49:21 -07:00
Kartik Agaram 3351d83f8b 6403 2020-05-24 23:06:07 -07:00
Kartik Agaram f5c45f8614 6402 2020-05-24 23:03:20 -07:00
Kartik Agaram f4e609c3a7 6401 - have scripts follow the Unix way
Stay silent if all is well.

I don't agree with this, but it's not like the messages I was printing
out were particularly useful.
2020-05-24 22:57:07 -07:00
Kartik Agaram 3ec4bae261 6400 2020-05-24 22:55:57 -07:00
Kartik Agaram fe6d099b78 6399 - make mu.vim work better out of the box
Adding some more colors will improve the experience, but the choices depend
on colorscheme, and first impressions should at least not seem to have
degraded things.
2020-05-24 22:50:24 -07:00
Kartik Agaram bfcbdf0e0a 6398 2020-05-24 22:47:09 -07:00
Kartik Agaram fcc161e705 6397
Drop '---' section boundaries from filenames. I noticed them confusing
tab-completion for certain advanced shell setups.
2020-05-24 22:43:18 -07:00
Kartik Agaram f92836550b 6396 2020-05-24 22:33:51 -07:00
Kartik Agaram 56f3649194 6395 2020-05-24 22:18:21 -07:00
Kartik Agaram d1179723a9 6394 - a catastrophic bug
How did new-literal ever work?! Somehow we had eax silently being clobbered
without affecting behavior over like 5 apps. Unsafe languages suck.

Anyways, factorial.mu is now part of CI.
2020-05-24 20:54:12 -07:00
Kartik Agaram 4d14c3fefd 6393 - start running .mu apps in CI 2020-05-24 20:36:31 -07:00
Kartik Agaram 27b1e19ebe 6392 - 'length' instruction done in all complexity 2020-05-24 19:46:47 -07:00
Kartik Agaram 1eecd0934f 6391 2020-05-24 16:42:26 -07:00