From 6aee362677d74cc036ffc467e0fc4af54ff78e28 Mon Sep 17 00:00:00 2001 From: ergz Date: Thu, 23 Jun 2022 23:32:58 -0700 Subject: [PATCH] start work on 2_3 --- src/2_3.asm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/2_3.asm diff --git a/src/2_3.asm b/src/2_3.asm new file mode 100644 index 0000000..6ba3eeb --- /dev/null +++ b/src/2_3.asm @@ -0,0 +1,36 @@ +; 2-3 + + option casemap:none + +nl = 10 +maxlen = 256 + + .data + +title_str byte "listing 2-3", 0 + +init_prompt byte "enter an integer between 0-127: ", 0 +fmt_str1 byte "the value in hexadecimal: %x", nl, 0 +fmt_str2 byte "invert all the bits: %x", nl, 0 +fmt_str3 byte "add 1 (hexadecimal): %x", nl, 0 +fmt_str4 byte "output as signed int: %d", nl, 0 +fmt_str5 byte "using the 'neg' instruction: %d", nl, 0 + +int_value sqword ? +input byte maxlen dup (?) + + .code + + externdef printf:proc + externdef atoi:proc + externdef readline:proc + + public get_title +get_title PROC + lea rcx, title_str + ret +get_title ENDP + + + +