diff --git a/compiler/res/prog8lib/virtual/diskio.p8 b/compiler/res/prog8lib/virtual/diskio.p8 index 618ffb2f5..0266058bb 100644 --- a/compiler/res/prog8lib/virtual/diskio.p8 +++ b/compiler/res/prog8lib/virtual/diskio.p8 @@ -138,8 +138,8 @@ diskio { ; you can call this multiple times to append more data repeat num_bytes { %ir {{ - loadm.w r0,diskio.f_write.bufferpointer - loadi.b r99100,r0 + loadm.w r99000,diskio.f_write.bufferpointer + loadi.b r99100,r99000 syscall 55 (r99100.b): r99100.b storem.b r99100,$ff02 }} diff --git a/intermediate/src/prog8/intermediate/IRInstructions.kt b/intermediate/src/prog8/intermediate/IRInstructions.kt index 541f546bb..5a207737a 100644 --- a/intermediate/src/prog8/intermediate/IRInstructions.kt +++ b/intermediate/src/prog8/intermediate/IRInstructions.kt @@ -11,8 +11,10 @@ Intermediate Representation instructions for the IR Virtual machine. Specs of the virtual machine this will run on: Program to execute is not stored in the system memory, it's just a separate list of instructions. -65536 virtual registers, 16 bits wide, can also be used as 8 bits. r0-r65535 -65536 virtual floating point registers (64 bits double precision) fr0-fr65535 +100K virtual registers, 16 bits wide, can also be used as 8 bits. r0-r99999 + reserved 99000 - 99099 : WORD registers for syscall arguments and response value(s) + reserved 99100 - 99199 : BYTE registers for syscall arguments and response value(s) +100K virtual floating point registers (64 bits double precision) fr0-fr99999 65536 bytes of memory. Thus memory pointers (addresses) are limited to 16 bits. Value stack, max 128 entries of 1 byte each. Status flags: Carry, Zero, Negative. NOTE: status flags are only affected by the CMP instruction or explicit CLC/SEC,