about summary refs log tree commit diff stats
path: root/070new-stream.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-08-26 11:55:26 -0700
committerKartik Agaram <vc@akkartik.com>2019-08-26 11:59:21 -0700
commit333525360b22f3d3ea31db46a4d2f1b4edbfebdb (patch)
treeed255f308542ba28a99d862d54d4992dcf749622 /070new-stream.subx
parent22fb844ba4edf14eb85245a35f42e721658c4f8e (diff)
downloadmu-333525360b22f3d3ea31db46a4d2f1b4edbfebdb.tar.gz
5592 - switch register names to lowercase
Diffstat (limited to '070new-stream.subx')
-rw-r--r--070new-stream.subx96
1 files changed, 48 insertions, 48 deletions
diff --git a/070new-stream.subx b/070new-stream.subx
index b6934b1e..c3f204d2 100644
--- a/070new-stream.subx
+++ b/070new-stream.subx
@@ -5,48 +5,48 @@
 # . op          subop               mod             rm32          base        index         scale       r32
 # . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes
 
-new-stream:  # ad : (address allocation-descriptor), length : int, elemsize : int -> address/EAX
+new-stream:  # ad : (address allocation-descriptor), length : int, elemsize : int -> address/eax
     # . prolog
-    55/push-EBP
-    89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
+    55/push-ebp
+    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
     # . save registers
-    52/push-EDX
+    52/push-edx
     # n = elemsize * length + 12 (for read, write and length)
-    # . EAX = elemsize
-    8b/copy                         1/mod/*+disp8   5/rm32/EBP    .           .             .           0/r32/EAX   0x10/disp8      .                 # copy *(EBP+16) to EAX
-    # . EAX *= length
-    31/xor                          3/mod/direct    2/rm32/EDX    .           .             .           2/r32/EDX   .               .                 # clear EDX
-    f7          4/subop/multiply    1/mod/*+disp8   5/rm32/EBP    .           .                                     0xc/disp8       .                 # multiply *(EBP+12) into EAX
+    # . eax = elemsize
+    8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   0x10/disp8      .                 # copy *(ebp+16) to eax
+    # . eax *= length
+    31/xor                          3/mod/direct    2/rm32/edx    .           .             .           2/r32/edx   .               .                 # clear edx
+    f7          4/subop/multiply    1/mod/*+disp8   5/rm32/ebp    .           .                                     0xc/disp8       .                 # multiply *(ebp+12) into eax
     # . if overflow abort
-    81          7/subop/compare     3/mod/direct    2/rm32/EDX    .           .             .           .           .               0/imm32           # compare EDX
+    81          7/subop/compare     3/mod/direct    2/rm32/edx    .           .             .           .           .               0/imm32           # compare edx
     75/jump-if-not-equal  $new-stream:abort/disp8
-    # . EDX = elemsize*length
-    89/copy                         3/mod/direct    2/rm32/EDX    .           .             .           0/r32/EAX   .               .                 # copy EAX to EDX
-    # . EAX += 12
-    05/add-to-EAX  0xc/imm32
+    # . edx = elemsize*length
+    89/copy                         3/mod/direct    2/rm32/edx    .           .             .           0/r32/eax   .               .                 # copy eax to edx
+    # . eax += 12
+    05/add-to-eax  0xc/imm32
     # allocate(ad, n)
     # . . push args
-    50/push-EAX
-    ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           8/disp8         .                 # push *(EBP+8)
+    50/push-eax
+    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
     # . . call
     e8/call  allocate/disp32
     # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-    # EAX->length = elemsize*length
-    89/copy                         1/mod/*+disp8   0/rm32/EAX    .           .             .           2/r32/EDX   8/disp8         .                 # copy EDX to *(EAX+8)
-    # clear-stream(EAX)
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
+    # eax->length = elemsize*length
+    89/copy                         1/mod/*+disp8   0/rm32/eax    .           .             .           2/r32/edx   8/disp8         .                 # copy edx to *(eax+8)
+    # clear-stream(eax)
     # . . push args
-    50/push-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
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 $new-stream:end:
     # . restore registers
-    5a/pop-to-EDX
+    5a/pop-to-edx
     # . epilog
-    89/copy                         3/mod/direct    4/rm32/ESP    .           .             .           5/r32/EBP   .               .                 # copy EBP to ESP
-    5d/pop-to-EBP
+    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
+    5d/pop-to-ebp
     c3/return
 
 $new-stream:abort:
@@ -57,62 +57,62 @@ $new-stream:abort:
     # . . call
     e8/call  _write/disp32
     # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
     # . syscall(exit, 1)
-    bb/copy-to-EBX  1/imm32
-    b8/copy-to-EAX  1/imm32/exit
+    bb/copy-to-ebx  1/imm32
+    b8/copy-to-eax  1/imm32/exit
     cd/syscall  0x80/imm8
     # never gets here
 
 test-new-stream:
     # . prolog
-    55/push-EBP
-    89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
-    # var heap/ECX : (address allocation-descriptor) = {0, 0}
+    55/push-ebp
+    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
+    # var heap/ecx : (address allocation-descriptor) = {0, 0}
     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
+    89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
     # heap = new-segment(512)
     # . . push args
-    51/push-ECX
+    51/push-ecx
     68/push  0x200/imm32
     # . . call
     e8/call  new-segment/disp32
     # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-    # var start/EDX = ad->curr
-    8b/copy                         0/mod/indirect  1/rm32/ECX    .           .             .           2/r32/EDX   .               .                 # copy *ECX to EDX
-    # EAX = new-stream(heap, 3, 2)
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
+    # var start/edx = ad->curr
+    8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           2/r32/edx   .               .                 # copy *ecx to edx
+    # eax = new-stream(heap, 3, 2)
     # . . push args
     68/push  2/imm32
     68/push  3/imm32
-    51/push-ECX
+    51/push-ecx
     # . . call
     e8/call  new-stream/disp32
     # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
-    # check-ints-equal(EAX, EDX, msg)
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
+    # check-ints-equal(eax, edx, msg)
     # . . push args
     68/push  "F - test-new-stream: returns current pointer of allocation descriptor"/imm32
-    52/push-EDX
-    50/push-EAX
+    52/push-edx
+    50/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
-    # check-ints-equal(EAX->length, 6, msg)
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
+    # check-ints-equal(eax->length, 6, msg)
     # . . push args
     68/push  "F - test-new-stream: sets length correctly"/imm32
     68/push  6/imm32
-    ff          6/subop/push        1/mod/*+disp8   0/rm32/EAX    .           .             .           .           .               8/disp8           # push *(EAX+8)
+    ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           .               8/disp8           # push *(eax+8)
     # . . call
     e8/call  check-ints-equal/disp32
     # . . discard args
-    81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0xc/imm32         # add to ESP
+    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
     # the rest is delegated to clear-stream() so we won't bother checking it
     # . epilog
-    89/copy                         3/mod/direct    4/rm32/ESP    .           .             .           5/r32/EBP   .               .                 # copy EBP to ESP
-    5d/pop-to-EBP
+    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
+    5d/pop-to-ebp
     c3/return
 
 # . . vim:nowrap:textwidth=0