Hacker's Edge Game Guide: Programming/Official KERNEL APIs

Official KERNEL APIs
July 27, 2016
Last updated at Aug. 1, 2016

The default in-game KERNEL.SYS has a set of exposed APIs which are very useful and can make creating programs and tools much easier than building everything from scratch. With that said, this API guide is only for the official Kernel and drivers built and provided by Hacker's Edge staff. Players are completely free to replace either drivers or the entire kernel and even bootloader with a creation of their own. Programs targetting the official Kernel may not run on 3rd party Kernels built by other players.

API callParametersResultsDescription
%printY Register contains offset in %dsN/APrints a null-terminated string to the terminal.
%inputY Register contains offset in %dsBuffer in %ds,Y is overwrittenRequests a string from the user.
%strcmp$fa and $fc contains 16-bit address pointer to strings$ff == 0 if strings matchCompares 2 strings.
%memclrY Register is size to clear, A is the byte to fill with, $fa points to memory page to clearN/AClears a page of memory.
%memclrY Register is size to copy, $fa points to source page, $fc points to destination pageN/ACopies a page of memory.
%finitN/ASets up $ff80 vectorYou should call this command if your code uses any of the Kernel File I/O.
%fcountN/AA = File countThis commands returns the count of files.
%fexists$fc points to 16-bit address pointer to filename to check$ff == 0 if file existsChecks to see if a specific file exists on the file system.
%printipY Register points to the offset of IP to print in network stack segmentN/ADisplays a human readable IP address.