diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-11-20 19:37:00 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-11-20 19:43:36 -0800 |
commit | e59a91b73d1abae828e265752d6f4588f6727531 (patch) | |
tree | ce4d725c3f3b729820e50401cc1aaa228d9bbb4f /subx/examples/ex6.subx | |
parent | fa04aebdc2e4ee9bdf14d5c2649756f62b7d2a37 (diff) | |
download | mu-e59a91b73d1abae828e265752d6f4588f6727531.tar.gz |
4757
Let's start highlighting all global variables in Red. Assembly programming has a tendency to over-use them. They're a necessary evil, but we should minimize the number of functions that access them.
Diffstat (limited to 'subx/examples/ex6.subx')
-rw-r--r-- | subx/examples/ex6.subx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/subx/examples/ex6.subx b/subx/examples/ex6.subx index 2b8aa212..b96ee77f 100644 --- a/subx/examples/ex6.subx +++ b/subx/examples/ex6.subx @@ -10,13 +10,13 @@ # 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 - # syscall(write, stdout, x, size) + # syscall(write, stdout, X, size) # fd = 1 (stdout) bb/copy-to-EBX 1/imm32 - # initialize x (location to write result to) - b9/copy-to-ECX x/imm32 + # initialize X (location to write result to) + b9/copy-to-ECX X/imm32 # initialize size - 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 2/r32/EDX size/disp32 . # copy *size to EDX + 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 2/r32/EDX Size/disp32 . # copy *size to EDX # syscall b8/copy-to-EAX 4/imm32/write cd/syscall 0x80/imm8 @@ -26,9 +26,9 @@ cd/syscall 0x80/imm8 == data -size: # size of string +Size: # size of string 0e 00 00 00 # 14 -x: # string to print +X: # string to print 48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21 0a 00 # H e l l o , ␣ w o r l d ! newline null |