From 2c14af364dbe19d330e3a2c36cd913c99fa2b73d Mon Sep 17 00:00:00 2001 From: Zev Averbach Date: Tue, 7 Nov 2023 16:30:22 +0100 Subject: [PATCH] reading notes --- IDEAS.md | 3 +++ STREAM1_NOV_7_HLA.md | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 STREAM1_NOV_7_HLA.md diff --git a/IDEAS.md b/IDEAS.md index 1be6c79..31f2619 100644 --- a/IDEAS.md +++ b/IDEAS.md @@ -2,3 +2,6 @@ - addition, subtraction, mult, div - hex.helpers.fun... - translate between decimal and binary/hex as well + +# work on personal site +- finish "projects" page, for example diff --git a/STREAM1_NOV_7_HLA.md b/STREAM1_NOV_7_HLA.md new file mode 100644 index 0000000..55b7d38 --- /dev/null +++ b/STREAM1_NOV_7_HLA.md @@ -0,0 +1,22 @@ +# HLA Stdlib + +`stdout.put` outputs integers in decimal format +`stdout.put` outputs registers, bytes, words, dwords in hex format +`stdin.get`'s input base is hex for those same 'types', but will expect decimal format if its argument is of an integer type. + +If you want to display a value in decimal format but it's stored in a register, use `stdout.puti32` (or ...i16 etc). + +If you want to use a decimal base when storing an input to a register, byte, word, etc., use `stdin.geti32` etc. + +If you want to use a hex base when storing an input to an integer type, use `stdin.geth32` etc. For output, `stdout.puth32` etc. + +# Sign Extension + +- `cbw()` = "convert byte in AL to word in AX" +- `cwd()` = "convert word in AX to doubleword in DX:AX" +- `cdq()` = "convert doubleword in EAX to quadword in EDX:EAX" +- `cwde()` = "convert word in AX to doubleword in EAX" +- `movsx(source: memory address OR register, dest: register)` = convert byte/word/doubleword in source to word/doubleword/quadword in dest (dest must be larger than source) +- `movzx(source, dest)` works the same as `movesx` for zero extension +- to zero extend values in 8-bit registers, just zero out their complementary high-order register: + - AL -> AH, BL -> BH, etc.