HFF-Git / VCPU-32

This is a vintage design CPU with 32-bits. See the document in the VCPU-32-Documentation folder for a more detailed description.
GNU General Public License v3.0
0 stars 0 forks source link

Inkonsistent Opmodes #1

Closed wesch closed 5 months ago

wesch commented 5 months ago

The description of opmodes (Section Operand Encoding) and the fomat description at ADD, SUB .... are inconsistent.

ADD[.] GR[r>], val ; opMode 0 ADD[.] GR[r], GR[b] ; opMode 2 ADD[(W|H|B)][.] GR[r], GR[a] ( GR[b] ) ; opMode 4 .. 6 ADD[(W|H|B)][.] GR[r], ofs ( GR[b] ) ; opMode 8 .. 15, 16 .. 23, 24 .. 31 ADD[(W|H|B)][.] GR[r], ofs ( SRn, GR[b] ) ; opMode 8 .. 15, 16 .. 23, 24 .. 31

HFF-Git commented 5 months ago

They look OK to me. One line was missing though. "ADD r1, r2" and "ADD r1, r1, r3" map both to mode 2. The "ADD r1, r2" is mapped by the assembler to "ADD r1, r1, r2". Remember the CPU-24 discussion on this. opMode 1 is only used by the assembler for some pseudo ops.

HFF-Git commented 5 months ago

Closing the issue.... hope this is the right GIT way :-)

wesch commented 5 months ago

Still the question, how to detect the various modes of seg in the assemblerAm 18.03.2024 um 19:00 schrieb Helmut Fieres @.***>: Closing the issue.... hope this is the right GIT way :-)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

HFF-Git commented 5 months ago

Hallo Wolfgang,

Du kodierst aus der Syntax die Werte. Nehmen wir die ADD instruction:

ADD[.] r, val ; opMode 0 ADD[.] r, b ; opMode 2 ADD[.] r, a, b ; opMode 2 ADD[(W|H|B)][.] r, a (b) ; opMode 4 .. 6 ADD[(W|H|B)][.] r, a (seg, b) ; opMode 4 .. 6 ADD[(W|H|B)][.] r, ofs (b) ; opMode 8 .. 15, 16 .. 23, 24 .. 31 ADD[(W|H|B)][.] r, ofs (seg, b) ; opMode 8 .. 15, 16 .. 23, 24 .. 31

Wenn du im Assmbler auf die „(" stösst ist es ein operand mode 4..31.

Das erste Argument hat drei Möglichkeiten:

1.) - Eine null: „seg“ Feld ist null. Wir erwarten dann ein Komma und dann ein GR8 bis 15. ( index register ). „opMode“ Feld ist das Index register mapped zu 8 .. 15, 16 .. 23, 24.. 31 abhängig von „W“, „h“, oder „B“.

2.) - Ein SR register 1 bis 3. „seg“ Feld ist 1 bis 3, Wir erwarten dann ein Komma und dann ein GR8 bis 15. ( index register ). „opMode“ Feld ist das Index register mapped zu 8 .. 15, 16 .. 23, 24.. 31 abhängig von „W“, „h“, oder „B“.

3.) - Ein GR register: „seg“ Feld ist 0, Wir erwarten dann ein Komma und dann ein GR8 bis 15. ( index register ). „opMode“ Feld ist das Index register mapped zu 8 .. 15, 16 .. 23, 24.. 31 abhängig von „W“, „h“, oder „B“.

1.) und 3.) sind eigentlich identisch. 1.) kann man schreiben, sieht aber umständlich aus. Deshalb wird wohl 3.) das typische Format sein. Aber beide sollten gültig sein.

Beispiele:

ADD r1, 500. : seg = 0, opMode = 0, val= 500

ADD r1, r2. : seg = 0, opMode = 2, r = 1, a = 1, b = 2

ADD r1, r2, r3. : seg = 0, opMode = 2, r = 1, a = 2, b = 3

ADDH r1, 100(r10). : seg = 0, opMode = 18, r = 1, ofs = 100

ADD r3, r4(r11). : seg = 0, opMode = 11, r = 3, a = 4, b = 11

ADD r6, r4( s2, r11 ) : seg = 2, opMode = 4, r = 6, a = 4, b = 11

ADDB r2, -20( s1, r9 ) : seg = 1, opMode = 25, r = 2, ofs = -20

ADDH r4, 30(R9). : seg = 0, opMode = 17, r = 4, ofs = 30

Ohne Gewähr :-)

Viele Grüsse, Helmut

Am 18.03.2024 um 19:12 schrieb WolfgangE @.***>:

Still the question, how to detect the various modes of seg in the assemblerAm 18.03.2024 um 19:00 schrieb Helmut Fieres @.***>: Closing the issue.... hope this is the right GIT way :-)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***> — Reply to this email directly, view it on GitHub https://github.com/HFF-Git/VCPU-32/issues/1#issuecomment-2004613536, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP7SZJF47YPSMSIIOTCZA3DYY4VAHAVCNFSM6AAAAABE37T442VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUGYYTGNJTGY. You are receiving this because you modified the open/close state.