explain this project with current file contents.
/loveVM/main.lua:
local vm = (require "vm")
local registers = vm.hardware.registers
local stack = vm.hardware.stack

local function toPaddedString(unsignedNumber)
    local str = ""
    while unsignedNumber ~= 0 do
        str = str..tostring(unsignedNumber%10)
        unsignedNumber = math.floor(unsignedNumber/10)
    end
    str = str..("0"):rep(5-#str)
    return str:reverse()
end

local function toBinaryString(unsignedNumber)
    local str = ""
    while unsignedNumber ~= 0 do
        str = str..tostring(unsignedNumber%2)
        unsignedNumber = math.floor(unsignedNumber/2)
    end
    str = str..("0"):rep(16-#str)
    return str:reverse()
end

local function toHexString(unsignedNumber)
    local hex = "0123456789ABCDEF"
    local str = ""
    while unsignedNumber ~= 0 do
        str = str..hex:sub(unsignedNumber%16+1, unsignedNumber%16+1)
        unsignedNumber = math.floor(unsignedNumber/16)
    end
    str = str..("0"):rep(4-#str)
    return str
end

local function printRegisters()
    love.graphics.print("AX:"..toBinaryString(registers.AX.getUnsigned()), 0, 0)
    love.graphics.print("BX:"..toBinaryString(registers.BX.getUnsigned()), 0, 20)
    love.graphics.print("CX:"..toBinaryString(registers.CX.getUnsigned()), 0, 40)
    love.graphics.print("DX:"..toBinaryString(registers.DX.getUnsigned()), 0, 60)
    love.graphics.print("SP:"..toPaddedString(registers.SP.getUnsigned()), 0, 80)
    love.graphics.print("IP:"..toPaddedString(registers.IP.getUnsigned()), 0, 100)
end

local function printStack()
    for i = 0, 15 do
        local color = {1, 1, 1}
        if registers.SP.getUnsigned() == i then color = {1, 1, 0} end
        local str = toPaddedString(stack:get(i)).." | "..toBinaryString(stack:get(i)).." | "..toHexString(stack:get(i))
        love.graphics.printf({color, str}, 0, i*20, love.graphics.getFont():getWidth(str)*2, "right")
    end
end

function love.draw()
    printRegisters()
    printStack()
end

/loveVM/vm/init.lua:
-- this init.lua file is a part of WM (Wai (Weird Assembly Implementation) Machine) module.

local vm = {hardware = require("vm.hardware")}
return vm
/loveVM/vm/hardware.lua:
local newRegister = require "vm.newRegister"
local stack = require "vm.stack"
local registers = {}


local Aregisters = newRegister()

registers.AX = Aregisters.X
registers.AH = Aregisters.H
registers.AL = Aregisters.L


local Bregisters = newRegister()

registers.BX = Bregisters.X
registers.BH = Bregisters.H
registers.BL = Bregisters.L


local Cregisters = newRegister()

registers.CX = Cregisters.X
registers.CH = Cregisters.H
registers.CL = Cregisters.L


local Dregisters = newRegister()

registers.DX = Dregisters.X
registers.DH = Dregisters.H
registers.DL = Dregisters.L

local StackPointer = newRegister()

registers.SP = StackPointer.X
StackPointer.H = nil
registers.SPL = StackPointer.L

local InstructionPointer = newRegister()

InstructionPointer.X = nil
InstructionPointer.H = nil
registers.IP = InstructionPointer.L

local hardware = {registers = registers, stack = stack}
return hardware

/loveVM/vm/newRegister.lua:
local ffi = require "ffi"

local function newRegister()
    local registerData = love.data.newByteData(2)
    local registers = {}
    registers.X = {}
    registers.H = {}
    registers.L = {}
    local pointers = {}
    local ptr = registerData:getFFIPointer()

    pointers.U16 = ffi.cast("uint16_t*", ptr)
    pointers.I16 = ffi.cast("int16_t*", ptr)
    pointers.U8 = ffi.cast("uint8_t*", ptr)
    pointers.I8 = ffi.cast("int8_t*", ptr)

    
    -- I AM NOT SURE WHY, BUT IF WE DON'T
    -- REGENERATE POINTERS THEN SOME OTHER PART
    -- OF THE MEMORY WILL BE READ/SET, PLEASE HELP
    local function genFFIPointer()
        ptr = registerData:getFFIPointer()
        pointers.U16 = ffi.cast("uint16_t*", ptr)
        pointers.I16 = ffi.cast("int16_t*", ptr)
        pointers.U8 = ffi.cast("uint8_t*", ptr)
        pointers.I8 = ffi.cast("int8_t*", ptr)
    end

    registers.X.getUnsigned = function()
        genFFIPointer()
        return pointers.U16[0]
    end

    registers.X.getSigned = function()
        genFFIPointer()
        return pointers.I16[0]
    end

    registers.H.getUnsigned = function()
        genFFIPointer()
        return pointers.U8[1]
    end

    registers.H.getSigned = function()
        genFFIPointer()
        return pointers.I8[1]
    end

    registers.L.getUnsigned = function()
        genFFIPointer()
        return pointers.U8[0]
    end

    registers.L.getSigned = function()
        genFFIPointer()
        return pointers.I8[0]
    end

    --
    -- Setters
    --

    registers.X.setUnsigned = function(value)
        genFFIPointer()
        pointers.U16[0] = value
    end

    registers.X.setSigned = function(value)
        genFFIPointer()
        pointers.I16[0] = value
    end

    registers.H.setUnsigned = function(value)
        genFFIPointer()
        pointers.U8[1] = value
    end

    registers.H.setSigned = function(value)
        genFFIPointer()
        pointers.I8[1] = value
    end

    registers.L.setUnsigned = function(value)
        genFFIPointer()
        pointers.U8[0] = value
    end

    registers.L.setSigned = function(value)
        genFFIPointer()
        pointers.I8[0] = value
    end

    return registers
end

return newRegister

/loveVM/vm/stack.lua:
local ffi = require "ffi"
local stackData = love.data.newByteData(32)
local stackPtr = stackData:getFFIPointer()
local stackU16Ptr = ffi.cast("uint16_t*", stackPtr)
local stack = {}

---@param size integer
function stack:new(size)
    stackData:release()
    stackData = love.data.newByteData(size)
    --- not sure if needed
    --[[
    ffi.C.free(ffi.gc(stackPtr))
    ffi.C.free(ffi.gc(stackU16Ptr))
    ---]]
    stackPtr = stackData:getFFIPointer()
    stackU16Ptr = ffi.cast("uint16_t*", stackPtr)
end

---@param value integer
---@param index integer
function stack:set(value, index)
    stackPtr = stackData:getFFIPointer()
    stackU16Ptr = ffi.cast("uint16_t*", stackPtr)
    stackU16Ptr[index] = value
end

---@param index integer
function stack:get(index)
    stackPtr = stackData:getFFIPointer()
    stackU16Ptr = ffi.cast("uint16_t*", stackPtr)
    return stackU16Ptr[index]
end

return stack