; showme.txt ; (c)1996/97 Markus Hahn ; This program shows some basic ; functionalities of the ; instructions available in AsmSim. ; You can start every part by ; setting the PC to the right ; address (just click on the ; entry in the memory window). ; You should clear the memory ; first before compiling these ; lines! ; example #1: very simple program 0: STOP ; example #2: NOP does nothing and ; a value can't be executed 5: NOP 6: 123 ; example #3: aritmetic demo 10: move #12, a 11: move a, b 12: add a, b 13: sub #33, a 14: jo 16 ; this stop will never be reached 15: stop 16: move #555, f 17: mul b, f 18: move #3, g 19: div g, f ; create a "division by zero" execption 20: sub a, a 21: div a, b ; example #4: pointer and jump demo ; fill a memory array with numbers ; from 22 to 33 (step by 3) 30: move #40, f 31: move #22, a 32: move a, [f] 33: inc f 34: add #3, a 35: cmp #33, a 36: jb 32 37: stop ; example #5: stack demo 50: move #666, a 51: push a 52: sub a, a 53: pop a 54: call 60 ; simulate a call to the same ; subroutine at address 60 55: move #59, [s] 56: dec s 57: move #55667788, a 58: jmp 60 59: stop ; the subroutine 60: sub a, a 61: ret