Add README, reverse function signature.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4330659..5b875f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,7 @@
 # Add library and test executable.
 file(GLOB SectionSources sections/*.c)
 file(GLOB EDKSources edk/*.c)
-add_library(CPERParseLibrary STATIC cper-parse.c cper-utils.c ${SectionSources} ${EDKSources})
+add_library(CPERParseLibrary STATIC cper-parse.c ir-parse.c cper-utils.c ${SectionSources} ${EDKSources})
 add_executable(CPERParseTest testing/cper-test.c)
 
 # Link library.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ebebb1c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,14 @@
+# CPER JSON Representation & Conversion Library
+This repository specifies a structure for representing UEFI CPER records (as described in UEFI Specification Appendix N) in a human-readable JSON format, in addition to a library which can readily convert back and forth between the standard CPER binary format and the specified structured JSON.
+
+## Building
+This project uses CMake (>=3.10). To build, simply run:
+```
+cmake .
+make
+```
+A static library file for the parsing library will be written to `lib/`, and test executables will be written to `bin/`.
+
+## Specification
+The specification for this project can be found in `specification/`.
+Specification for the CPER binary format can be found in [UEFI Specification Appendix N](https://uefi.org/sites/default/files/resources/UEFI_Spec_2_9_2021_03_18.pdf) (2021/03/18).
\ No newline at end of file
diff --git a/cper-parse.c b/cper-parse.c
index fa2d796..4af39d8 100644
--- a/cper-parse.c
+++ b/cper-parse.c
@@ -34,15 +34,8 @@
 
 //Reads a CPER log file at the given file location, and returns an intermediate
 //JSON representation of this CPER record.
-json_object* cper_to_ir(const char* filename) 
+json_object* cper_to_ir(FILE* cper_file) 
 {
-    //Get a handle for the log file.
-    FILE* cper_file = fopen(filename, "r");
-    if (cper_file == NULL) {
-        printf("Could not open CPER record, file handle returned null.");
-        return NULL;
-    }
-
     //Ensure this is really a CPER log.
     EFI_COMMON_ERROR_RECORD_HEADER header;
     fseek(cper_file, 0, SEEK_SET);
@@ -58,16 +51,6 @@
         return NULL;
     }
 
-    // //Print struct contents (debug).
-    // fpos_t file_pos;
-    // fgetpos(cper_file, &file_pos);
-    // printf("Stream is at position %d.\n", file_pos);
-    // printf("SignatureStart: %s\n", (char*)&header.SignatureStart);
-    // printf("Revision: %u\n", header.Revision);
-    // printf("SectionCount: %u\n", header.SectionCount);
-    // printf("Severity: %d\n", header.ErrorSeverity);
-    // printf("RecordLength: %d\n", header.RecordLength);
-
     //Create the header JSON object from the read bytes.
     json_object* header_ir = cper_header_to_ir(&header);
 
@@ -95,7 +78,6 @@
     json_object_object_add(parent, "sectionDescriptors", section_descriptors_ir);
     json_object_object_add(parent, "sections", sections_ir);
 
-    //...
     return parent;
 }
 
diff --git a/cper-parse.h b/cper-parse.h
index a49c455..84ea0d8 100644
--- a/cper-parse.h
+++ b/cper-parse.h
@@ -9,6 +9,7 @@
 #define CPER_HEADER_FLAG_TYPES_KEYS (int []){1, 2, 3}
 #define CPER_HEADER_FLAG_TYPES_VALUES (const char*[]){"HW_ERROR_FLAGS_RECOVERED", "HW_ERROR_FLAGS_PREVERR", "HW_ERROR_FLAGS_SIMULATED"}
 
-json_object* cper_to_ir(const char* filename);
+json_object* cper_to_ir(FILE* cper_file);
+void ir_to_cper(json_object* ir, FILE* out);
 
 #endif
\ No newline at end of file
diff --git a/ir-parse.c b/ir-parse.c
new file mode 100644
index 0000000..fa2a326
--- /dev/null
+++ b/ir-parse.c
@@ -0,0 +1,15 @@
+/**
+ * Describes functions for parsing JSON IR CPER data into binary CPER format.
+ * 
+ * Author: Lawrence.Tang@arm.com
+ **/
+
+#include <stdio.h>
+#include "json.h"
+#include "cper-parse.h"
+
+//Converts the given JSON IR CPER representation into CPER binary format, piped to the provided file stream.
+void ir_to_cper(json_object* ir, FILE* out)
+{
+    //...
+}
\ No newline at end of file
diff --git a/json-parse.c b/json-parse.c
deleted file mode 100644
index f9ccad5..0000000
--- a/json-parse.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * Describes functions for parsing JSON CPER data into an intermediate format.
- * 
- * Author: Lawrence.Tang@arm.com
- **/
-
-void json_to_ir(void) 
-{
-
-}
\ No newline at end of file
diff --git a/sections/cper-section-ia32x64.c b/sections/cper-section-ia32x64.c
index a9531d0..a53604f 100644
--- a/sections/cper-section-ia32x64.c
+++ b/sections/cper-section-ia32x64.c
@@ -295,8 +295,8 @@
     json_object_object_add(ia32_registers, "cr2", json_object_new_int(registers->Cr2));
     json_object_object_add(ia32_registers, "cr3", json_object_new_int(registers->Cr3));
     json_object_object_add(ia32_registers, "cr4", json_object_new_int(registers->Cr4));
-    json_object_object_add(ia32_registers, "gdtr", json_object_new_uint64((registers->Gdtr[0] << 16) + registers->Gdtr[1]));
-    json_object_object_add(ia32_registers, "idtr", json_object_new_uint64((registers->Idtr[0] << 16) + registers->Idtr[1]));
+    json_object_object_add(ia32_registers, "gdtr", json_object_new_uint64(registers->Gdtr[0] + ((UINT64)registers->Gdtr[1] << 32)));
+    json_object_object_add(ia32_registers, "idtr", json_object_new_uint64(registers->Idtr[0] + ((UINT64)registers->Idtr[1] << 32)));
     json_object_object_add(ia32_registers, "ldtr", json_object_new_int(registers->Ldtr));
     json_object_object_add(ia32_registers, "tr", json_object_new_int(registers->Tr));
 
diff --git a/testing/cper-test.c b/testing/cper-test.c
index 6f6534d..99a85c1 100644
--- a/testing/cper-test.c
+++ b/testing/cper-test.c
@@ -3,6 +3,16 @@
 #include "json.h"
 
 int main(int argc, char* argv[]) {
-    json_object* ir = cper_to_ir(argv[1]);
+
+    //Get a handle for the log file.
+    FILE* cper_file = fopen(argv[1], "r");
+    if (cper_file == NULL) {
+        printf("Could not open CPER record, file handle returned null.");
+        return -1;
+    }
+
+    json_object* ir = cper_to_ir(cper_file);
+    fclose(cper_file);
+
     printf("\n%s\n", json_object_to_json_string(ir));
 }
\ No newline at end of file