From 86351aafe218a7386f6578be3c4da3edcdcb0c98 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 12 Jun 2020 07:57:27 -0700 Subject: 6513 --- html/apps/ex11.subx.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'html/apps/ex11.subx.html') diff --git a/html/apps/ex11.subx.html b/html/apps/ex11.subx.html index 275a594b..c06d6fe0 100644 --- a/html/apps/ex11.subx.html +++ b/html/apps/ex11.subx.html @@ -15,15 +15,15 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color: a { color:inherit; } * { font-size:12pt; font-size: 1em; } .subxComment { color: #005faf; } +.subxS2Comment { color: #8a8a8a; } +.subxTest { color: #5f8700; } .subxFunction { color: #af5f00; text-decoration: underline; } .LineNr { } .subxS1Comment { color: #0000af; } -.subxTest { color: #5f8700; } .SpecialChar { color: #d70000; } .Normal { color: #000000; background-color: #c6c6c6; padding-bottom: 1px; } .subxMinorFunction { color: #875f5f; } .Constant { color: #008787; } -.subxS2Comment { color: #8a8a8a; } .subxH1Comment { color: #005faf; text-decoration: underline; } --> @@ -60,12 +60,12 @@ if ('onhashchange' in window) { https://github.com/akkartik/mu/blob/master/apps/ex11.subx
-  1 # Null-terminated vs length-prefixed ascii strings.
+  1 # Null-terminated vs size-prefixed ascii strings.
   2 #
-  3 # By default we create strings with a 4-byte length prefix rather than a null suffix.
+  3 # By default we create strings with a 4-byte size prefix rather than a null suffix.
   4 # However we still need null-prefixed strings when interacting with the Linux
   5 # kernel in a few places. This layer implements a function for comparing
-  6 # a null-terminated 'kernel string' with a length-prefixed 'SubX string'.
+  6 # a null-terminated 'kernel string' with a size-prefixed 'SubX string'.
   7 #
   8 # To run:
   9 #   $ ./bootstrap translate init.linux apps/ex11.subx -o apps/ex11
@@ -87,11 +87,11 @@ if ('onhashchange' in window) {
  25     89/copy                         3/mod/direct    3/rm32/ebx    .           .             .           0/r32/eax   .               .                 # copy eax to ebx
  26     e8/call  syscall_exit/disp32
  27 
- 28 # compare a null-terminated ascii string with a more idiomatic length-prefixed byte array
+ 28 # compare a null-terminated ascii string with a more idiomatic size-prefixed byte array
  29 # reason for the name: the only place we should have null-terminated ascii strings is from commandline args
- 30 kernel-string-equal?:  # s: null-terminated ascii string, benchmark: length-prefixed ascii string -> eax: boolean
+ 30 kernel-string-equal?:  # s: null-terminated ascii string, benchmark: size-prefixed ascii string -> eax: boolean
  31     # pseudocode:
- 32     #   n = benchmark->length
+ 32     #   n = benchmark->size
  33     #   s1 = s
  34     #   s2 = benchmark->data
  35     #   i = 0
@@ -122,7 +122,7 @@ if ('onhashchange' in window) {
  60     57/push-edi
  61     # s1/edi = s
  62     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           7/r32/edi   8/disp8         .                 # copy *(ebp+8) to edi
- 63     # n/edx = benchmark->length
+ 63     # n/edx = benchmark->size
  64     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           2/r32/edx   0xc/disp8       .                 # copy *(ebp+12) to edx
  65     8b/copy                         0/mod/indirect  2/rm32/edx    .           .             .           2/r32/edx   .               .                 # copy *edx to edx
  66     # s2/esi = benchmark->data
-- 
cgit 1.4.1-2-gfad0