refactored registers

This commit is contained in:
2025-04-18 02:46:46 +05:00
parent dd8c65ef79
commit ba72dae68f
18 changed files with 359 additions and 282 deletions

View File

@@ -11,19 +11,19 @@ jz @false cx
.true:
const8 true.msg "true\n"
movc cx @true.msg
movc dx #true.msg
movc rbx @true.msg
movc ecx #true.msg
jmp @print
.false
const8 false.msg "false\n"
movc cx @false.msg
movc dx #false.msg
movc rbx @false.msg
movc ecx #false.msg
jmp @print
.print:
movc ax 1
movc bx 1
movc al 1
movc ah 1
sys
jmp @end

View File

@@ -6,9 +6,9 @@ Example of self-repeating code section
.loop
const8 datum "ITERATION!!! "
movc ax 1
movc bx 1
movc cx @datum
movc dx #datum
movc al 1
movc ah 1
movc rbx @datum
movc ecx #datum
sys
jmp @loop

View File

@@ -4,13 +4,13 @@
.data:
// named array of 8-bit values
const8 msg "Hello, World"
const8 msg "Hello, World!\n"
.main:
movc ax 1; // sys_write
movc bx 1; // stdout
movc cx @msg; // address of msg data
movc dx #msg; // size of msg data
movc al 1; // sys_write
movc ah 1; // stdout
movc rbx @msg; // address of msg data
movc ecx #msg; // size of msg data
sys
movc ax 0
exit

View File

@@ -3,7 +3,5 @@ Example of graphical application
*/
.main:
jif
jel
//TODO: write code here
exit