From cd918302cc8b5ff4496c864128a2362265c16036 Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Fri, 10 Feb 2023 15:35:43 +0000 Subject: [PATCH] Removed now useless register init code and changed disas command name --- cpu/Makefile | 4 ++-- cpu/boot_code.asm | 4 +++- cpu/registers.v | 10 ---------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/cpu/Makefile b/cpu/Makefile index 6a2f36f..abdc911 100644 --- a/cpu/Makefile +++ b/cpu/Makefile @@ -30,6 +30,6 @@ boot_code.txt:boot_code.bin boot_code.bin:boot_code.asm as86 -0 $< -b $@ -.PHONY: dumpas -dumpas: boot_code.bin +.PHONY: disas +disas: boot_code.bin objdump -D -b binary -m i8086 boot_code.bin diff --git a/cpu/boot_code.asm b/cpu/boot_code.asm index 87220fa..fa33a62 100644 --- a/cpu/boot_code.asm +++ b/cpu/boot_code.asm @@ -1,4 +1,6 @@ -MOV CX,#0x1234 +MOV AX,#0x0000 +MOV CX,#0x0000 +MOV BX,#0x0000 ADD AX,#0xDEAD ADD CX,#0xBEEF ADD CX,#0x4111 diff --git a/cpu/registers.v b/cpu/registers.v index ae55edb..53f6af3 100644 --- a/cpu/registers.v +++ b/cpu/registers.v @@ -2,16 +2,6 @@ module register_file ( input [2:0]addr1, inout [15:0]data1, input wire read1, in reg [15:0] registers [7:0]; assign data2 = !read2 ? registers[addr2] : 'hz; assign data1 = !read1 ? registers[addr1] : 'hz; -initial begin - registers['b000]=0; - registers['b001]=0; - registers['b010]=0; - registers['b011]=0; - registers['b100]=0; - registers['b101]=0; - registers['b110]=0; - registers['b111]=0; // TODO Don't clear. Remove after we implement the MOV instruction -end always @(negedge write1) begin registers[addr1] = data1; //$display("registers: 0:%04x 1:%04x 2:%04x",registers[0],registers[1],registers[2]);