YASMIN CPU simulator instruction set, RISC-based but what does #h mean?

358 Views Asked by At

I'm working through a set of problems related to the YASMIN CPU/OS simulator with a RISC-like instruction set. (Editor's note, possibly this one or another version of it). I just cant seem to find the answer to the following:

  1. Add the following code and run:
STB #h41, 16
LDB 16, R03
ADD #1, R03
STB R03, 17

What is the significance of h in h41 above?

There seems to be no information anywhere to reference. I have tried pairing different numbers with h to distinguish a pattern but to no avail. See my attempt below.

CPU simulator attempt

2

There are 2 best solutions below

0
youngturk On

#h41 means literal value hex 41. h prefix simply means the following number is a hex number. As simple as that.

0
abdo Salm On

refer to their tutorial (Investigating Programming Model 2) , where they gave an example on page 5 where they said :

MSF

PSH #h60 -> puts the number hex 60 on top of the stack

CAL $Label2

HLT

that means that h is indication that this number in HEX format and # means that it's a immediate value, so in the example you provided :

STB #h41, 16

#h41 is a HEX number which is equivalent to 65 in decimal number systems.