; This simple little program puts the number 69 into memory address 2, ; and then it also puts the string "Hello, world!" into memory address 44. ; (Yes, I know that the string is being stored in big-endian.) ; Moving the integer 69 into memory address 2: LOAD r0, @MyFunnyData STR r0, &2 ; Moving the string "Hello, world!" into memory address 44: LOAD r1, #HelloWorldV2 ; You can use either V1 or V2. They do the same thing, ; but with different syntax. :D LOAD r2, 44 ; Destination address. (Used in the CTD instruction.) CTD r1, r2 ; Copy all the data of the string to address 44. (Including NULL byte.) ; Just for showing off, here is an instruction that can be used to get the length ; of the string "Hello, world!" (excluding the NULL byte). TLEN r8, @HelloWorldV2 ; This instruction counts how many bytes until a NULL byte, ; and stores the result in register 8. INC r8 ; Include the NULL byte in the final length. HLT @MyFunnyData: .byte 69 @HelloWorldV1: .ascii "Hello, world!" .byte 0 ; NULL termination. @HelloWorldV2: .asciiz "Hello, world!" ; This is the same as '.ascii' but with NULL termination automatically.