From 10a34f7302bd88cf74a4d17bc35bbd7068bb873c Mon Sep 17 00:00:00 2001 From: Natalie Agus Date: Thu, 18 Apr 2024 17:38:16 +0800 Subject: [PATCH] style: format asm --- docs/ProblemSet/i_betadiagnostics.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/ProblemSet/i_betadiagnostics.md b/docs/ProblemSet/i_betadiagnostics.md index b3bce52..b72c78f 100644 --- a/docs/ProblemSet/i_betadiagnostics.md +++ b/docs/ProblemSet/i_betadiagnostics.md @@ -56,14 +56,14 @@ As always, we can detect this particular fault by running a simple test program Assume that all register values were `0` at the beginning of each program execution. **Program 1**: (executed for two CLK cycles) -```cpp +```nasm .= 0 BEQ(R0, .+4, R31) ADDC(R0, 1, R0) ``` **Program 2**: (executed for three CLK cycles) -```cpp +```nasm .=0 CMPEQ(R0, R0, R0) BNE(R0, .-4, R31) @@ -71,7 +71,7 @@ ADDC(R0, 1, R0) ``` **Program 3**: (executed for four CLK cycles) -```cpp +```nasm .=0 LD(R0, 0, R0) MULC(R0, 1, R0) @@ -80,21 +80,21 @@ CMPEQ(R0, R31, R2) ``` **Program 4**: (executed for two CLK cycles) -```cpp +```nasm .=0 ST(R0, x, R31) x: LONG(12) ``` **Program 5**: (executed for two CLK cycles) -```cpp +```nasm .=0 JMP(R1) ADDC(R0, 1, R1) ``` **Program 6**: (executed for two CLK cycles) -```cpp +```nasm .=0 LDR(R31, .+8, R0) ADDC(R0, 1, R1) @@ -253,7 +253,7 @@ When Alice was walking back to her hostel this morning, she dropped her Beta CPU She quickly wrote a diagnostic program that hopefully can detect all these faults at once. Her program is as follows, starting from address 0. -```cpp +```nasm ADDC(R31, 16, R0) | 0 ADD(R31, R0, R0) | 4 LD(R31, 16, R1) | 8