Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44b1127

Browse files
committed
Implemented DEC
1 parent6403a82 commit44b1127

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎main.go‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,20 @@ func (c *CPU) Run() {
365365
// bump past that
366366
c.ip+=1
367367

368+
case0x26:
369+
debugPrintf("DEC\n")
370+
371+
// register
372+
c.ip+=1
373+
reg:=c.mem[c.ip]
374+
375+
ifc.regs[reg].t!="int" {
376+
fmt.Printf("BUG: Attempting to deccrement a non-integer register\n")
377+
os.Exit(3)
378+
}
379+
c.regs[reg].i-=1
380+
// bump past that
381+
c.ip+=1
368382
case0x30:
369383
debugPrintf("STORE_STRING\n")
370384

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp