Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rfw/ex86
base: master
...
head fork: rfw/ex86
compare: somestuff
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 7 additions and 2 deletions.
  1. +3 −0  ex86/include/context.h
  2. +4 −2 ex86/src/isa/8086.c
View
3  ex86/include/context.h
@@ -144,6 +144,9 @@ struct ex86_config;
# error "REGISTER_SIZE not specified or invalid"
#endif
+#define EX86_REGISTER_8_HI_GET(SRC) (int8_t)(*(SRC) >> 8)
+#define EX86_REGISTER_8_LO_GET(src) (int8_t)(*(SRC))
+
/** Convert an immediate value to 16 bits. */
#define EX86_IMMEDIATE_8(VALUE) (int8_t)(VALUE)
View
6 ex86/src/isa/8086.c
@@ -11,12 +11,14 @@ EX86_INSTRUCTION(nop) {
}
/** add */
+// add [pointer], 10
EX86_INSTRUCTION(add8_m_i) {
- EX86_REGISTER_8_SET(dest.r, EX86_MEMORY_8_GET(dest.p) + EX86_IMMEDIATE_8(src1.i));
+ EX86_MEMORY_8_SET(dest.r, EX86_MEMORY_8_GET(dest.p) + EX86_IMMEDIATE_8(src1.i));
}
+// add al, al
EX86_INSTRUCTION(add8_r_r) {
- EX86_REGISTER_8_SET(dest.r, EX86_REGISTER_8_GET(dest.r) + EX86_REGISTER_8_GET(src.r));
+ EX86_REGISTER_8_LO_SET(dest.r, EX86_REGISTER_8_LO_GET(dest.r) + EX86_REGISTER_8_LO_GET(src.r));
}
/** mov8 memory, immediate */

No commit comments for this range

Something went wrong with that request. Please try again.