If you want to write a string, you have to use branch instructions.
Our LMC support 5 registers and various addressing modes.
For example in Our LMC:
Input String: 'example'
7 characters
Program: Using register and addressing modes
LD X #0 ; Load 0 to X register.
LD C #7 ; Load 7 to C register.
LOOP: IN {device} ; keyboard input. a character's ASCII code
into A register.
ST A @65 ; Store A register's value to (65+X)
address in memory.
SUB C #1 ; C = C - 1
JP LOOP ; If last expression's results is
positive, it jump to LOOP: section
Instruction:
LD: Load
ST: Store
IN: Input from device
SUB: Subtract
JP: Conditional Jump, 'P' is positive condition.
Daeyoung Heo.
On 1월25일, 오전6시22분, Sharmeen Ibrahim <
sharmeen...@gmail.com>
wrote: