Header Banner
WonderHowTo Logo
WonderHowTo
0x10c World
wonderhowto.mark.png
Gadget Hacks Next Reality Food Hacks Null Byte The Secret Yumiverse Invisiverse Macgyverisms Mind Hacks Mad Science Lock Picking Driverless

Reading Keyboard Input in 0x10c's DCPU-16 Assembly

The as of yet undocumented DAT op code can also be used to read keyboard input by simply referencing dat 0. Here's the code from Notch's pastebin:

; Reading characters from the keyboard

; by Markus Persson

#macro nextkey(target) {

 push(i)

 set i,[keypointer]

 add i,0x9000

 set target,[i]

 ife target,0

jmp end

 set [i],0

 add [keypointer], 1

 and [keypointer], 0xf

:end

 pop(i)

}

:keypointer

dat 0

Apple's iOS 26 and iPadOS 26 updates are packed with new features, and you can try them before almost everyone else. First, check Gadget Hacks' list of supported iPhone and iPad models, then follow the step-by-step guide to install the iOS/iPadOS 26 beta — no paid developer account required.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!