refactored registers
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,7 +3,5 @@ Example of graphical application
|
||||
*/
|
||||
|
||||
.main:
|
||||
|
||||
jif
|
||||
jel
|
||||
//TODO: write code here
|
||||
exit
|
||||
|
||||
Reference in New Issue
Block a user