BLUE
kissa.bsky.social
@kissa.bsky.social
Tomfoolery, nincompoopery, programming
37 followers374 following39 posts
kissa.bsky.social

What if we made a social network where instead of liking, blocking and muting, you would “hush” and “boost” posts? Hushing would decrease visibility to your followers. Boosting would increase it. Who’s with me?

1
kissa.bsky.social

People in Bluesky vs. people in Place Previously Known As Twitter

Tweet by @heydonworks that sparked some controversy in 2019:

What do you like to do when you're not coding?
Vue-based developer: I am fond of cooking, getting stuck into a good graphic novel and—
React-based developer: WEIGHTS. BROING DOWN. MORE WEIGHTS. TRUMP. WEIGHTS. GUNS. THE FREE MARKET.
0
kissa.bsky.social

“Can you explain this gap in your resume?” Yes, child; that was when I carried you

0
kissa.bsky.social

Good two hours reserved for today, let's continue with immediate instructions. Since we have augmented mode too, there's quite a bunch of these. Instructions that logically take only 1 argument don't make sense, such as INC/DEC, and some potential ones like NEG, NOT, CLR. Except for MOV.

Immediate instructions with 16-bit operand (32-47), plus augmented ones (48-63)

(Details omitted due to space constraints)

addi op1, op2, imm16 ; op1 <- op2 + imm16   00100000
subi
muli
divi
modi
andi
ori
xori
shli
shri
add1i
sub1i
movi

addai op1, imm16     ; op1 <- op2 + imm16   00110000
subai
mulai
divai
modai
andai
orai
xorai
shlai
shrai
incai
decai
nopai
1
kissa.bsky.social

Day 3 and can't decide whether to take a nap or get a coffee. Good 2 hours to go and some code needs written. Maybe should expand this poor opcode list today

export const opcodes: { [key: number]: string } = {
	0b00000000: "add", // add <dst> <src1> <src2> - dst <- src1 + src2
	0b00000001: "sub", // sub <dst> <src1> <src2> - dst <- src1 - src2

	0b11110000: "hlt", // hlt <?> <?> <?>         - halt program execution
	0b11110001: "hcf", // hcf <?> <?> <?>         - halt and catch fire
}
1
kissa.bsky.social

Day 2 of virtual machine hacking, think I’ll do byte addressing now

Autumn
1
kissa.bsky.social

Operands are now simply 8 bits and denote memory addresses 0x00 to 0xff. I have a slightly more complex design in mind but let's get some syntax defined first. This also details how to address lower and higher parts of registers:

Syntax

[M] means the word at memory address M.

[M].b means the byte at memory address M. When read, it is sign-extended
to a word.

<reg> is equivalent to [addressof <reg>], where <reg> is one of registers
(a, b, c, d, x, y, i, j, p, q, sp, pc), and addressof <reg> is the memory
address of the register according to the table below.

<reg>.hi is equivalent to [address of <reg>].b
<reg>.lo is equivalent to [address of <reg> + 1].b

Table of registers and their addresses:

a:  0x0    a.hi:  0x0    a.lo:  0x1
b:  0x2    b.hi:  0x2    b.lo:  0x3
c:  0x4    c.hi:  0x4    c.lo:  0x5
d:  0x6    d.hi:  0x6    d.lo:  0x7
x:  0x8    x.hi:  0x8    x.lo:  0x9
y:  0xa    y.hi:  0xa    y.lo:  0xb
i:  0xc    i.hi:  0xc    i.lo:  0xd
j:  0xe    j.hi:  0xe    j.lo:  0xf
p:  0x10   p.hi:  0x10   p.lo:  0x11
q:  0x12   q.hi:  0x12   q.lo:  0x13
sp: 0x14   sp.hi: 0x14   sp.lo: 0x15
pc: 0x16   pc.hi: 0x16   pc.lo: 0x17

Finally:

<regi> is one of x, y, i, j
<rega> is one of p, q, sp, pc
1
kissa.bsky.social

A nice, crisp autumn’s day. A good day to write a virtual machine and an assembler for it.

2
kissa.bsky.social
@kissa.bsky.social
Tomfoolery, nincompoopery, programming
37 followers374 following39 posts