Write an interpreter for simplified 33 33 is a simple esolang I created. You may have seen me use it in a few questions. You're not going to be writing a full interpreter. The interpreter you will be writing is for a simplified version of 33.

This simplified 33 has two numeric registers: the accumulator and the counter. The accumulator holds all the post-arithmetic values, the counter is where numbers in the program come from. Both registers are initialized to 0.

0-9 | Appends the digit to the counter
a   | Adds the counter to the accumulator
m   | Subtracts the counter from the accumulator
x   | Multiplies the accumulator by the counter
d   | Divides the accumulator by the counter
r   | Divides the accumulator by the counter, but stores the remainder in the accumulator
z   | Sets the counter to 0
c   | Swaps the accumulator and counter
-----
p   | Outputs the current value of the accumulator as an ASCII character
o   | Outputs the current value of the accumulator as a formatted decimal number
i   | Outputs a newline character (0x0a)
-----
P   | Stores the ASCII value of the next character read in the accumulator
O   | Stores the next integer read into the accumulator
-----
n   | Skips the next instruction if the accumulator is not 0
N   | Skips the next instruction if the accumulator is 0
g   | Skips the next instruction if the accumulator is less than or equal to 0
G   | Skips the next instruction if the accumulator is greater than 0
h   | Skips the next instruction if the accumulator is greater than or equal to 0
H   | Skips the next instruction if the accumulator is less than 0


Test cases

Program / Input -&gt; Output
2o          -&gt; 0
25co        -&gt; 25
1a0aoi      -&gt; 11 (trailing newline)
Oo / 42     -&gt; 42
Op / 42     -&gt; *
1cNoo       -&gt; 11
no          -&gt; 0
Ogo / 2     -&gt; 2
Ogoi / -4   -&gt; (newline)
50a         -&gt; (no output)
On12co / 12 -&gt; 2


Clarifications


The input to your interpreter will be a valid simplified 33 program.
The input may be given in any acceptable format.
The output may be given in any acceptable format.
When dividing, truncate any decimal places.
A trailing newline is acceptable, but it must be consistent; as in, if there's an i at the end of the program, it should have two trailing newlines.
The accumulator and counter must be able to hold at least a signed byte (-128 to 127)
You may assume that the p instruction will never be given when the accumulator has an invalid ASCII character in it.
You may assume the O instruction will never be given unless there is a valid integer string (such as 3, -54, +23) left in the input.
JavaScript (Node.js), 264 bytes



S=&gt;I=&gt;[...S].map(s=&gt;K?K=0:1/s?C=+(C+s):eval("A*=C;[A,C]=[C,A];K=!A;;K=A;K=A&gt;0;A%=C;K=A&lt;=0;A=A/C|0;I=I.replace(/-?\\d+/,n=&gt;(A=+n,''));K=A&gt;=0;O+=A;K=A&lt;0;A+=C;C=0;;[A]=B(I[0]),I=I.slice(1);O+=`\n`;O+=B([A]);A-=C".split`;`[B(s)[0]*73%378%22]),A=C=K=0,O='',B=Buffer)&amp;&amp;O


Try it online!

Saved ~20 bytes, thanks to Arnauld's magic integer modulus.