The following examples can be entered and executed with the DCP monitor
starting at address $2000.
32-bit counter
Adr Opc Mnemonic --------------------------------------------------------------- 2000 2550 MOVE R5, $A0 ; clear topmost 16 bits 2002 0654 MOVE R6, R5 ; clear bottommost 16 bits 2004 A600 ADD R6, #1 2006 C603 SZ R6 ; Skip on overflow 2008 F005 BRA $2004 200A 076C MHL R7, R6 ; Test if R6=$0000 200C 0766 OR R7, R6 200E C70B SNZ R7 2010 A500 ADD R5, #1 ; yes->increment R5 2012 F00F BRA $2004
Text output
Adr Opc Mnemonic --------------------------------------------------------------- ; Clear screen 2000 D501 0200 LWI R5, #$0200 ; Begin of display buffer 2004 8606 LBI R6, #$06 ; High byte of end address 2006 8740 LBI R7, #' ' ; Blank (Hex $40) 2008 7750 MOVB (R5)+, R7 200A C567 SBSH R5, R6 200C F005 BRA $2008 ; Call subroutine 200E 0203 INC2 R2, R0 ; R2:=$2012 2010 D021 MOVE R0, (R2)+ ; Jump to $2100 2012 2100 DW $2100 2014 0000 HALT ; Write text (End token $FF) 2100 D501 0400 LWI R5, #$0400 ; Begin on line 9 2104 D601 3000 LWI R6, #$3000 ; Address of text 2108 6760 MOVB R7, (R6)+ 210A C70C SNS R7 210C 0024 MOVE R0, R2 ; Return from subroutine 210E 7750 MOVB (R5)+, R7 2110 F009 BRA $2108 3000 E388 8540 DB "The quick brown fox jumps over the lazy dog.", $FF 98A4 8983 9240 8299 96A6 9540 8696 A740 91A4 9497 A240 96A5 8599 40A3 8885 4093 81A9 A840 8496 874B FF