Implemented the rest of the unsigned integer operations

This commit is contained in:
cannoli-fruit 2026-07-24 03:12:34 -04:00
commit 1ade055e09
5 changed files with 46 additions and 4 deletions

View file

@ -13,8 +13,7 @@ define r9 9
define r10 10
define r11 11
define r12 12
define r13 13
define r14 14
define r13 13 define r14 14
define r15 15
define r16 16
define r17 17
@ -236,12 +235,24 @@ macro AddR64 dst, src
db src
end macro
macro MulR64 dst, src
db 0x70
db dst
db src
end macro
macro DivR64 dst, src
db 0x72
db dst
db src
end macro
macro ModR64 dst, src
db 0x74
db dst
db src
end macro
macro RSetF reg
db 0x42
db reg

10
tests/mod.asm Normal file
View file

@ -0,0 +1,10 @@
include "fvm.inc"
org 0x4000000000000000
MovI64 r95, UART_TX
MovI64 r2, 16
MovI64 r3, 3
ModR64 r2, r3
MovI64 r4, 48 ; ascii for 0
AddR64 r2, r4
St8 r2, r95

10
tests/mul.asm Normal file
View file

@ -0,0 +1,10 @@
include "fvm.inc"
org 0x4000000000000000
MovI64 r95, UART_TX
MovI64 r2, 2
MovI64 r3, 4
MulR64 r2, r3
MovI64 r4, 48 ; ascii for 0
AddR64 r2, r4
St8 r2, r95