REM Program to show some pretty stripes on the screen by storing bytes REM into the screen memory with the STR instruction : MODE28:REM Any 256-colour mode will do OFF ON ERROR REPORT:PRINT" at line ";ERL:END : DIM code 512 FOR pass=0 TO 2 STEP 2 P%=code:[OPT pass : ADR R0,variables ADR R1,screen_base SWI "OS_ReadVduVariables" .start_display_loop LDR R0,screen_base LDR R1,screen_length LDR R2,pattern_length LDR R3,pattern_start .display_loop STRB R3,[R0],#1 ADD R3,R3,#&F0 ; Play with this to change the patterns SUBS R2,R2,#1 LDREQ R2,pattern_length LDREQ R3,pattern_start SUBS R1,R1,#1 BNE display_loop : ; ; There are 256 SWIs defined, starting at &100 to perform every VDU ; command in BASIC. Hence SWI &100 + 31 = VDU31 which positions the ; text cursor, here at (0,0) ; SWI &100 + 31 SWI &100 + 0 SWI &100 + 0 LDR R0,pattern_length ; Pattern length in R0 ADR R1,string_buffer ; Pointer to string buffer in R1 MOV R2,#4 ; Length of buffer in R2 SWI "OS_ConvertCardinal1" ; See StrongHelp / PRMs SWI "OS_Write0" ; String printing, from last month : .wait_for_key MOV R0,#121 MOV R1,#0 SWI "OS_Byte" ; OS_Byte 121,0 waits for a key CMP R1,#255 ; (key number returned in R1) BEQ wait_for_key ; Do nothing until a key is pressed : LDR R0,pattern_length CMP R1,#23 ; Key code for - SUBEQ R0,R0,#1 ; (subtract from pattern length) CMP R1,#93 ; Key code for + ADDEQ R0,R0,#1 ; (add to pattern length) CMP R0,#1 MOVLT R0,#1 ; Keep pattern length > 0 CMP R0,#256 MOVGT R0,#256 ; Keep pattern length <= 256 STR R0,pattern_length CMP R1,#112 ; Key code for Escape MOVEQ PC,R14 ; Return if Escape has been pressed B start_display_loop : .pattern_length EQUD 10 .pattern_start EQUD RND(&7FFFFFFF) .variables EQUD 149:EQUD 7:EQUD -1 ; .screen_base EQUD 0 .screen_length EQUD 0 .string_buffer EQUD 0 ; Four bytes for string ]:NEXT : CALL code END