From ed6e2eda8c4dbc0ec7c25bcaf333147f9b8e651a Mon Sep 17 00:00:00 2001 From: Fereydoun Memarzanjany Date: Fri, 19 Jun 2020 00:50:05 +0430 Subject: [PATCH] Add files via upload --- examples/checked_add.asm | 9 +++++++++ examples/memory.asm | 14 ++++++++++++++ examples/rotate.asm | 11 +++++++++++ examples/stack.asm | 15 +++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 examples/checked_add.asm create mode 100644 examples/memory.asm create mode 100644 examples/rotate.asm create mode 100644 examples/stack.asm diff --git a/examples/checked_add.asm b/examples/checked_add.asm new file mode 100644 index 0000000..a148a9b --- /dev/null +++ b/examples/checked_add.asm @@ -0,0 +1,9 @@ +; Assemble with "nasm -O0 -f bin checked_add.asm" + +cpu 8086 + + +mov ax, 5000 +mov cx, -900 + +add ax, cx \ No newline at end of file diff --git a/examples/memory.asm b/examples/memory.asm new file mode 100644 index 0000000..a458c60 --- /dev/null +++ b/examples/memory.asm @@ -0,0 +1,14 @@ +; Assemble with "nasm -O0 -f bin memory.asm" + +cpu 8086 + +mov cx, 1024 +push cx +pop ds +mov di, 55 +mov bp, 5 + +mov [ds:di+bp+404], word 8 + +mov di, 464 +mov ax, [di] \ No newline at end of file diff --git a/examples/rotate.asm b/examples/rotate.asm new file mode 100644 index 0000000..d084aa8 --- /dev/null +++ b/examples/rotate.asm @@ -0,0 +1,11 @@ +; Assemble with "nasm -O0 -f bin rotate.asm" + +cpu 8086 + + +stc +mov cl, 00011100b +rcl cl, 1 ; CL = 00111001b, CF = 0 + +mov al, 250 +rol al, 1 ; CL = 500, OF = 0 \ No newline at end of file diff --git a/examples/stack.asm b/examples/stack.asm new file mode 100644 index 0000000..d79f1fb --- /dev/null +++ b/examples/stack.asm @@ -0,0 +1,15 @@ +; Assemble with "nasm -O0 -f bin stack.asm" + +cpu 8086 + + +mov ax, 100h +mov ss, ax +mov sp, 100h + +mov bx, 500 +push bx + +mov bp, sp + +mov dx, [bp]