about summary refs log tree commit diff stats
Commit message (Expand)AuthorAgeFilesLines
* 5644 - plan data structures for mulispKartik Agaram2019-09-081-7/+42
* 5643Kartik Agaram2019-09-081-9/+5
* 5642Kartik Agaram2019-09-071-1/+1
* 5641Kartik Agaram2019-09-071-8/+0
* 5640Kartik Agaram2019-09-071-3/+6
* 5639 - tmux support for running a single testKartik Agaram2019-09-071-18/+35
* 5638Kartik Agaram2019-09-071-6/+1
* 5637Kartik Agaram2019-09-074-15/+206
* 5636Kartik Agaram2019-09-073-10/+14
* 5635Kartik Agaram2019-09-073-10/+44
* 5634 - add read/eval/print phasesKartik Agaram2019-09-071-16/+78
* 5633 - start of a toy lisp interpreterKartik Agaram2019-09-071-0/+76
* 5632Kartik Agaram2019-09-061-1084/+1601
* 5631 - syntax for calls starting to work!Kartik Agaram2019-09-065-16/+573
* 5630Kartik Agaram2019-09-0612-5/+57
* 5629Kartik Agaram2019-09-067-2684/+3534
* 5628Kartik Agaram2019-09-061-1/+1
* 5627Kartik Agaram2019-09-061-41/+41
* 5626Kartik Agaram2019-09-061-285/+285
* 5625Kartik Agaram2019-09-052-3407/+3095
* 5624Kartik Agaram2019-09-051-1/+69
* 5623Kartik Agaram2019-09-0415-2720/+3049
* 5622Kartik Agaram2019-09-042-0/+2
* 5621Kartik Agaram2019-09-041-8/+160
* 5620Kartik Agaram2019-09-043-31/+634
* 5619Kartik Agaram2019-09-042-0/+4
* 5618Kartik Agaram2019-09-042-3/+11
* 5617Kartik Agaram2019-09-041-3/+0
* 5616Kartik Agaram2019-09-0413-327/+327
* 5615 - long strings in self-hosted translatorKartik Agaram2019-09-042-2/+27
* 5614Kartik Agaram2019-09-031-1/+168
* 5613Kartik Agaram2019-09-033-17/+200
* 5612Kartik Agaram2019-09-022-2/+2
* 5611Kartik Agaram2019-09-022-6/+6
* 5610Kartik Agaram2019-09-021-0/+183
* 5607 - start of notation for function callsKartik Agaram2019-09-022-0/+495
* 5608 - write int to streamKartik Agaram2019-09-0213-3/+122
* 5607Kartik Agaram2019-09-0120-112/+114
* 5606Kartik Agaram2019-09-012-4521/+4525
* 5605 - sigils: support *disp32Kartik Agaram2019-09-013-4267/+4716
* 5604Kartik Agaram2019-09-012-7/+7
* 5603Kartik Agaram2019-09-013-27/+27
* 5602Kartik Agaram2019-09-013-3191/+3209
* 5601Kartik Agaram2019-08-312-136/+136
* 5600Kartik Agaram2019-08-3132-20755/+20967
* 5599 - sigils: support metadata in %reg and *regKartik Agaram2019-08-312-3/+176
* 5598Kartik Agaram2019-08-312-47/+45
* 5597Kartik Agaram2019-08-311-0/+5
* 5596Kartik Agaram2019-08-313-104/+112
* 5595 - support ebp and esp in sigilsKartik Agaram2019-08-313-3983/+4279
ersist f->write 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 3/r32/EBX 4/disp8 . # copy EBX to *(EDI+4) # . flush(f) # . . push args 57/push-EDI # . . call e8/call flush/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . clear-stream(stream = f+4) # . . push args 8d/copy-address 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 . # copy EDI+4 to EAX 50/push-EAX # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . f->write must now be 0; update its cache at EBX 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . . # clear EBX $write-buffered:to-stream: # write to stream # f->data[f->write] = *in # . AL = *in 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX 8a/copy-byte 0/mod/indirect 6/rm32/ESI . . . 0/r32/AL . . # copy byte at *ESI to AL # . f->data[f->write] = AL 88/copy-byte 1/mod/*+disp8 4/rm32/sib 7/base/EDI 3/index/EBX . 0/r32/AL 0x10/disp8 . # copy AL to *(EDI+EBX+16) # ++f->write 43/increment-EBX # ++in 46/increment-ESI eb/jump $write-buffered:loop/disp8 $write-buffered:loop-end: # persist necessary variables from registers 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 3/r32/EBX 4/disp8 . # copy EBX to *(EDI+4) $write-buffered:end: # . restore registers 5f/pop-to-EDI 5e/pop-to-ESI 5b/pop-to-EBX 5a/pop-to-EDX 59/pop-to-ECX 58/pop-to-EAX # . epilog 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 5d/pop-to-EBP c3/return test-write-buffered: # - check that write-buffered writes to the file # setup # . clear-stream(_test-stream) # . . push args 68/push _test-stream/imm32 # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . clear-stream(_test-buffered-file+4) # . . push args b8/copy-to-EAX _test-buffered-file/imm32 05/add-to-EAX 4/imm32 50/push-EAX # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # write-buffered(_test-buffered-file, "Abc") # . . push args 68/push "Abc"/imm32 68/push _test-buffered-file/imm32 # . . call e8/call write-buffered/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # flush(_test-buffered-file) # . . push args 68/push _test-buffered-file/imm32 # . . call e8/call flush/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-stream-equal(_test-stream, "Abc", msg) # . . push args 68/push "F - test-write-buffered-single"/imm32 68/push "Abc"/imm32 68/push _test-stream/imm32 # . . call e8/call check-stream-equal/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP # . end c3/return test-write-buffered-with-intermediate-flush: # - check that write-buffered flushes in the middle if its buffer fills up # setup # . clear-stream(_test-stream) # . . push args 68/push _test-stream/imm32 # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . clear-stream(_test-buffered-file+4) # . . push args b8/copy-to-EAX _test-buffered-file/imm32 05/add-to-EAX 4/imm32 50/push-EAX # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # _test-stream can hold 8 bytes, but _test-buffered-file can hold only 6. # Try to write 7 bytes. # . write-buffered(_test-buffered-file, "Abcdefg") # . . push args 68/push "Abcdefg"/imm32 68/push _test-buffered-file/imm32 # . . call e8/call write-buffered/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # don't flush # 6 bytes should still have gotten to _test-stream # . check-ints-equal(*_test-stream->write, 6, msg) # . . push args 68/push "F - test-write-buffered-with-intermediate-flush: flushed data"/imm32 68/push 6/imm32 # . . push *_test-stream->write b8/copy-to-EAX _test-stream/imm32 ff 6/subop/push 0/mod/indirect 0/rm32/EAX . . . . . . # push *EAX # . . call e8/call check-ints-equal/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP # and 1 byte should still be in _test-buffered-file # . check-ints-equal(*_test-buffered-file->write, 1, msg) # . . push args 68/push "F - test-write-buffered-with-intermediate-flush: unflushed bytes"/imm32 68/push 1/imm32 # . . push *_test-buffered-file->write b8/copy-to-EAX _test-buffered-file/imm32 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 . # push *(EAX+4) # . . call e8/call check-ints-equal/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP # . end c3/return == data # The buffered file for standard error. Stderr: # file descriptor or (address stream) 2/imm32 # standard error # current write index 0/imm32 # current read index 0/imm32 # length 8/imm32 # data 00 00 00 00 00 00 00 00 # 8 bytes # TODO: 8 bytes is too small. We'll need to grow the buffer for efficiency. But # I don't want to type in 1024 bytes here. # . . vim:nowrap:textwidth=0