From 925fc490d2ce8b8d411de87bd0af5b3a8a704213 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 8 Jul 2019 01:05:23 -0700 Subject: . Be more consistent about names of ends of a slice. --- subx/056trace.subx | 2 +- subx/072slice.subx | 16 ++++++++-------- subx/073next-token.subx | 20 ++++++++++---------- subx/075array-equal.subx | 2 +- subx/apps/assort.subx | 2 +- subx/apps/dquotes.subx | 44 ++++++++++++++++++++++---------------------- subx/apps/pack.subx | 42 +++++++++++++++++++++--------------------- subx/apps/subx-common.subx | 16 ++++++++-------- subx/apps/survey.subx | 16 ++++++++-------- 9 files changed, 80 insertions(+), 80 deletions(-) diff --git a/subx/056trace.subx b/subx/056trace.subx index 417c24ce..b63476fa 100644 --- a/subx/056trace.subx +++ b/subx/056trace.subx @@ -20,7 +20,7 @@ Trace-stream: Trace-segment: 0/imm32/curr - 0/imm32/end + 0/imm32/limit # Fake trace-stream for tests. # Also illustrates the layout of the real trace-stream (segment). diff --git a/subx/072slice.subx b/subx/072slice.subx index e568fbae..82c512e9 100644 --- a/subx/072slice.subx +++ b/subx/072slice.subx @@ -35,8 +35,8 @@ test-slice-empty-true: 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # var slice/ECX = {34, 34} - 68/push 34/imm32/end - 68/push 34/imm32/start + 68/push 34/imm32/limit + 68/push 34/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # slice-empty?(slice) # . . push args @@ -64,8 +64,8 @@ test-slice-empty-false: 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # var slice/ECX = {34, 23} - 68/push 23/imm32/end - 68/push 34/imm32/start + 68/push 23/imm32/limit + 68/push 34/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # slice-empty?(slice) # . . push args @@ -326,8 +326,8 @@ test-slice-equal-empty: 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # var slice/ECX - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # EAX = slice-equal?(ECX, "Abc") # . . push args @@ -393,8 +393,8 @@ test-slice-equal-empty-with-empty: 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # var slice/ECX - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # EAX = slice-equal?(ECX, "") # . . push args diff --git a/subx/073next-token.subx b/subx/073next-token.subx index 942d9878..363be416 100644 --- a/subx/073next-token.subx +++ b/subx/073next-token.subx @@ -67,8 +67,8 @@ test-next-token: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # var slice/ECX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # write(_test-stream, " ab") # . . push args @@ -131,8 +131,8 @@ test-next-token-Eof: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # var slice/ECX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # write nothing to _test-stream # next-token(_test-stream, 0x20/space, slice) @@ -217,8 +217,8 @@ test-next-token-from-slice: 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 . # copy EAX+ECX+4 to ECX 05/add-to-EAX 4/imm32 # var out/EDI : (address slice) = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . . # copy ESP to EDI # next-token-from-slice(EAX, ECX, 0x20/space, out) # . . push args @@ -266,8 +266,8 @@ test-next-token-from-slice-Eof: 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # var out/EDI : (address slice) = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . . # copy ESP to EDI # next-token-from-slice(0, 0, 0x20/space, out) # . . push args @@ -307,8 +307,8 @@ test-next-token-from-slice-nothing: 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 . # copy EAX+ECX+4 to ECX 05/add-to-EAX 4/imm32 # var out/EDI : (address slice) = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . . # copy ESP to EDI # next-token-from-slice(in, 0x20/space, out) # . . push args diff --git a/subx/075array-equal.subx b/subx/075array-equal.subx index 0623dab2..b12e23c3 100644 --- a/subx/075array-equal.subx +++ b/subx/075array-equal.subx @@ -344,7 +344,7 @@ $parse-array-of-ints:break1: $parse-array-of-ints:pass2: # var slice/ECX = {s->data, 0} # . push 0 - 68/push 0/imm32/end + 68/push 0/imm32/limit # . push s->data 8d/copy-address 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 . # copy ESI+4 to ECX 51/push-ECX diff --git a/subx/apps/assort.subx b/subx/apps/assort.subx index fdab9bf4..5e3cba8c 100644 --- a/subx/apps/assort.subx +++ b/subx/apps/assort.subx @@ -485,7 +485,7 @@ read-segments: # in : (address buffered-file), table : (address stream {string, 68/push 0/imm32/write 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # var word-slice/EDX = {0, 0} - 68/push 0/imm32/end + 68/push 0/imm32/limit 68/push 0/imm32/curr 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . . # copy ESP to EDX $read-segments:loop: diff --git a/subx/apps/dquotes.subx b/subx/apps/dquotes.subx index d4a1ae86..a4c146a1 100644 --- a/subx/apps/dquotes.subx +++ b/subx/apps/dquotes.subx @@ -121,7 +121,7 @@ convert: # in : (address buffered-file), out : (address buffered-file) -> 51/push-ECX 52/push-EDX # var word-slice/ECX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX #? # dump line {{{ #? # . write(2/stderr, "LL: ") @@ -1873,8 +1873,8 @@ convert-instruction: # line : (address stream byte), out : (address buffered-fi 51/push-ECX 52/push-EDX # var word-slice/ECX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # next-word(line, word-slice) # . . push args @@ -2030,12 +2030,12 @@ emit-opcodes: # line : (address stream byte), out : (address buffered-file) -> 52/push-EDX 53/push-EBX # var op1/ECX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # var op2/EDX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . . # copy ESP to EDX # rewind-stream(line) # . . push args @@ -2321,8 +2321,8 @@ emit-modrm: # line : (address stream byte), out : (address buffered-file) -> < # ESI = word 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 . # copy *(EBP+12) to ESI # var name/EDI : (address slice) = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . . # copy ESP to EDI # datum = next-token-from-slice(word->start, word->end, '/') # . . push args @@ -6835,8 +6835,8 @@ parse-datum-of-word: # word : (address slice) -> value/EAX # ESI = word 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 . # copy *(EBP+8) to ESI # var slice/ECX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # slice = next-token-from-slice(word->start, word->end, '/') # . . push args diff --git a/subx/apps/subx-common.subx b/subx/apps/subx-common.subx index d2eba587..b65ad2ca 100644 --- a/subx/apps/subx-common.subx +++ b/subx/apps/subx-common.subx @@ -612,8 +612,8 @@ test-next-word: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # var slice/ECX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # write(_test-stream, " ab") # . . push args @@ -675,8 +675,8 @@ test-next-word-returns-whole-comment: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # var slice/ECX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # write(_test-stream, " # a") # . . push args @@ -738,8 +738,8 @@ test-next-word-returns-empty-string-on-eof: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # var slice/ECX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # write nothing to _test-stream # next-word(_test-stream, slice) @@ -902,8 +902,8 @@ has-metadata?: # word : (address slice), s : (address string) -> EAX : boolean # EDX = word->end 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 2/r32/EDX 4/disp8 . # copy *(ESI+4) to EDX # var twig/EDI : (address slice) = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . . # copy ESP to EDI # next-token-from-slice(word->start, word->end, '/', twig) # . . push args diff --git a/subx/apps/survey.subx b/subx/apps/survey.subx index 59318aea..bc1b6650 100644 --- a/subx/apps/survey.subx +++ b/subx/apps/survey.subx @@ -2124,8 +2124,8 @@ num-bytes: # line : (address stream) -> EAX : int # var result/EAX = 0 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . . # clear EAX # var word-slice/ECX = {0, 0} - 68/push 0/imm32/end - 68/push 0/imm32/start + 68/push 0/imm32/limit + 68/push 0/imm32/curr 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX #? # dump line {{{ #? # . write(2/stderr, "LL: ") @@ -2698,13 +2698,13 @@ $p_align: # compute the starting address for each segment 0x1000/imm32 -compute-offsets:curr-segment-name: 0/imm32/start -compute-offsets:curr-segment-name:end: 0/imm32/end +compute-offsets:curr-segment-name: 0/imm32/curr +compute-offsets:curr-segment-name:end: 0/imm32/limit compute-offsets:file-offset: 0/imm32 compute-offsets:segment-offset: 0/imm32 -compute-offsets:word-slice: 0/imm32/start -compute-offsets:word-slice:end: 0/imm32/end -compute-offsets:heap: 0/imm32/start -compute-offsets:heap:end: 0/imm32/end +compute-offsets:word-slice: 0/imm32/curr +compute-offsets:word-slice:end: 0/imm32/limit +compute-offsets:heap: 0/imm32/curr +compute-offsets:heap:end: 0/imm32/limit # . . vim:nowrap:textwidth=0 -- cgit 1.4.1-2-gfad0