I am trying to learn DCPU.
;Set b to 1
SET B,1 ;00001 (1)
SHL B,1 ;00010 (2)
SHL B,1 ;00100 (4)
SHL B,1 ;01000 (8)
SHL B,1 ;10000 (16)
All I am doing is shifting to the left one so shouldn't it simply double itself each shift. In my code you can see i have the last shift turning the registry B into 16 but when ran B ends up as 10 why is that.
You're getting the correct answer, you're just viewing it in hexadecimal.
Numbers starting with
0xare the standard way of signifying a hexadecimal number; so the number0x0010is is really the number 1016 ("one-zero in base sixteen"), which, in decimal, is the number sixteen.