WillemDeGroef/drama

Quirks in the DRAMA-assembly language

Opened this issue · 0 comments

MV-GH commented

As there is no formal specification of the DRAMA – assembly language. Its not clear if these following quirks are problems of the DRAMA-Simulator or were intended as.

Quirks

  • Allows RESGR with negative numbers (acts as positive), no arguments (does not reserve any memory space)
STP
RESGR | Defaults to 0 and does not reserve any space
RESGR -99 | Acts as 99
... 
  • Allows numbers to prefixed with a plus sign, except when a sign is already used once
hia.w R0, +1 | valid
hia.w R0, -1 | valid
hia R0, +1(R9) | valid
hia R0, -1(R9) | valid
hia.w R0, 1+s | valid
hia.w R0, +1+s | not valid, this is inconsistent either no plus prefix is allowed or it should always be
hia.w r0, -1+s | not valid, should be
HIA.w R0, S-1 | valid
STP
S: RESGR
  • The DramaSimulator doesn't check the dot in the mode, thus it can by any character (except space, pipeline, ...)
SPRxD 44
hiaLd R8, R9
SPR😀D 42| Yes this actually works
  • Allows labels to defined as keywords, thus allowing labels to shadow keywords
HIA : HIA R0, R9
HIA.a R1, HIA
HIA.a: HIA R1, HIA
BIG R1, R9 | Stores R1 at the labeled R9 memory address
HIA R9, R1 | Stores R1 in the register R9
STP
R9: RESGR 99

Here R9 is depending on context either the label or the register. Further allowing this increases difficulty in parsing