Hello world
Program
TITLE Example 1: Hello
SUBTITLE Program file
USE "mov1.i"
USE "mov1defs.i"
USE "ex1_hello_m.d"
ORG(#0000)
llit #1234,8#00
halt
END
; Set TAB to 8:
; ex:set ts=8 noet:
Memory
TITLE Example 1: Hello
SUBTITLE Memory file
USE "mov1.i"
ORG(#0100)
END
; Set TAB to 8:
; ex:set ts=8 noet:
Display
Compiling: ex1_hello_m.a
Compiling: ex1_hello_p.a
Program Loading: ex1_hello_p.o
Memory Loading: ex1_hello_m.o
Booting....
_PC__:_PD_ __S _D Q M VZCS _00_ _01_ _02_ _03_ _04_ _05_ _06_ _07_ _10_ _11_ _12_ _13_ _14_ _15_ _16_ _17_
00000:44BA L12 72 0 0 0000 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
00001:4D00 L34 00 0 0 0000 1234 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
Using memory variables
Program
TITLE Example 2: Using memory variables
SUBTITLE Program file
USE "mov1.i"
USE "ex2_using_memory_m.d"
ORG(#0000)
jmp START
ORG(#1000)
START: llit (var1>>>4),MU+MA ; Point MDB block on first variable
mov (var1>>>1)&3+MDB,8#00 ; Move variable 1 to register R00
mov (var2>>>1)&3+MDB,8#01 ; Move variable 2 to register R01
mov (var3>>>1)&3+MDB,8#02 ; Move variable 3 to register R02
mov (var4>>>1)&3+MDB,8#03 ; Move variable 4 to register R03
halt
END
; Set TAB to 8:
; ex:set ts=8 noet:
Memory
TITLE Example 2: Using memory variables
SUBTITLE Memory file
USE "mov1.i"
ORG(#0100)
var1: H #DEAD
var2: H #BEAF
var3: H #0015
var4: H #F00D
END
; Set TAB to 8:
; ex:set ts=8 noet:
Display
Compiling: ex2_using_memory_m.a no errors
Compiling: ex2_using_memory_p.a no errors
Program Loading: ex2_using_memory_p.o
Memory Loading: ex2_using_memory_m.o
Booting....
_PC__:_PD_ __S _D Q M VZCS _00_ _01_ _02_ _03_ _04_ _05_ _06_ _07_ _10_ _11_ _12_ _13_ _14_ _15_ _16_ _17_
00000:443A L10 72 0 0 0000 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
00001:403F L00 77 0 0 0000 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
04096:403A L00 72 0 0 0000 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
04097:4829 L20 51 0 0 0000 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
04098:0800 40 00 0 0 0000 DEAD ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
04099:0841 41 01 0 0 0000 DEAD BEAF ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
04100:0882 42 02 0 0 0000 DEAD BEAF 0015 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
04101:08C3 43 03 0 0 0000 DEAD BEAF 0015 F00D ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
Program
TITLE Example 3: Block copy
SUBTITLE Program file
USE "mov1.i"
USE "mov1defs.i"
USE "ex3_block_copy_m.d"
ORG(#0000)
jmp START
ORG(#1000)
START: llit 3,8#14 ; Loop counter
llit (var1>>>1),8#10 ; Source pointer
clear 8#12 ; Destination pointer
loop: mvi 8#10,MU+MA ; MA = SrcPtr++
mov MU+MD,8#11 ; Copy MD to R11
mvi 8#12,MU+MA ; MA = SrcPtr++
mov 8#11,MU+MD ; Copy R11 to MD
dec 8#14 ; dec counter
cjpl loop
halt
END
; Set TAB to 8:
; ex:set ts=8 noet:
Memory
TITLE Example 2: Block copy
SUBTITLE Memory file
USE "mov1.i"
ORG(#0100)
var1: H #DEAD
var2: H #BEAF
var3: H #0015
var4: H #F00D
END
; Set TAB to 8:
; ex:set ts=8 noet:
Display
Compiling: ex3_block_copy_m.a no errors
Compiling: ex3_block_copy_p.a no errors
Program Loading: ex3_block_copy_p.o
Memory Loading: ex3_block_copy_m.o
Booting....
_PC__:_PD_ __S _D M QS VZCS ZCS _MA_ _00_ _01_ _02_ _03_ _04_ _05_ _06_ _07_ _10_ _11_ _12_ _13_ _14_ _15_ _16_ _17_
00000:443A L10 72 0 00 0000 000 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
00001:403F L00 77 0 00 0000 000 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
04096:403A L00 72 0 00 0000 000 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
04097:40CC L03 14 0 00 0000 000 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 0003 ---- ---- ----
04098:407A L01 72 0 00 0000 000 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 0003 ---- ---- ----
04099:4008 L00 10 0 00 0000 000 ---- ---- ---- ---- ---- ---- ---- ---- ---- 0100 ---- ---- ---- 0003 ---- ---- ----
04100:028A 12 12 0 00 0000 100 ---- ---- ---- ---- ---- ---- ---- ---- ---- 0100 ---- 0000 ---- 0003 ---- ---- ----
04101:3229 10 51 3 00 0000 000 0100 ---- ---- ---- ---- ---- ---- ---- ---- 0101 ---- 0000 ---- 0003 ---- ---- ----
04102:0A89 52 11 0 00 0000 000 0100 ---- ---- ---- ---- ---- ---- ---- ---- 0101 DEAD 0000 ---- 0003 ---- ---- ----
04103:32A9 12 51 3 00 0000 100 0000 ---- ---- ---- ---- ---- ---- ---- ---- 0101 DEAD 0001 ---- 0003 ---- ---- ----
04104:026A 11 52 0 00 0000 001 0000 DEAD ---- ---- ---- ---- ---- ---- ---- 0101 DEAD 0001 ---- 0003 ---- ---- ----
04105:232F 14 57 2 00 0000 000 0000 DEAD ---- ---- ---- ---- ---- ---- ---- 0101 DEAD 0001 ---- 0002 ---- ---- ----
04106:C17C L05 74 0 10 0000 000 0000 DEAD ---- ---- ---- ---- ---- ---- ---- 0101 DEAD 0001 ---- 0002 ---- ---- ----
04101:3229 10 51 3 00 0000 000 0101 DEAD ---- ---- ---- ---- ---- ---- ---- 0102 DEAD 0001 ---- 0002 ---- ---- ----
04102:0A89 52 11 0 00 0000 000 0101 DEAD ---- ---- ---- ---- ---- ---- ---- 0102 BEAF 0001 ---- 0002 ---- ---- ----
04103:32A9 12 51 3 00 0000 000 0001 DEAD ---- ---- ---- ---- ---- ---- ---- 0102 BEAF 0002 ---- 0002 ---- ---- ----
04104:026A 11 52 0 00 0000 001 0001 DEAD BEAF ---- ---- ---- ---- ---- ---- 0102 BEAF 0002 ---- 0002 ---- ---- ----
04105:232F 14 57 2 00 0000 000 0001 DEAD BEAF ---- ---- ---- ---- ---- ---- 0102 BEAF 0002 ---- 0001 ---- ---- ----
04106:C17C L05 74 0 10 0000 000 0001 DEAD BEAF ---- ---- ---- ---- ---- ---- 0102 BEAF 0002 ---- 0001 ---- ---- ----
04101:3229 10 51 3 00 0000 000 0102 DEAD BEAF ---- ---- ---- ---- ---- ---- 0103 BEAF 0002 ---- 0001 ---- ---- ----
04102:0A89 52 11 0 00 0000 000 0102 DEAD BEAF ---- ---- ---- ---- ---- ---- 0103 0015 0002 ---- 0001 ---- ---- ----
04103:32A9 12 51 3 00 0000 000 0002 DEAD BEAF ---- ---- ---- ---- ---- ---- 0103 0015 0003 ---- 0001 ---- ---- ----
04104:026A 11 52 0 00 0000 000 0002 DEAD BEAF 0015 ---- ---- ---- ---- ---- 0103 0015 0003 ---- 0001 ---- ---- ----
04105:232F 14 57 2 00 0000 000 0002 DEAD BEAF 0015 ---- ---- ---- ---- ---- 0103 0015 0003 ---- 0000 ---- ---- ----
04106:C17C L05 74 0 10 0000 000 0002 DEAD BEAF 0015 ---- ---- ---- ---- ---- 0103 0015 0003 ---- 0000 ---- ---- ----
04101:3229 10 51 3 00 0000 000 0103 DEAD BEAF 0015 ---- ---- ---- ---- ---- 0104 0015 0003 ---- 0000 ---- ---- ----
04102:0A89 52 11 0 00 0000 000 0103 DEAD BEAF 0015 ---- ---- ---- ---- ---- 0104 F00D 0003 ---- 0000 ---- ---- ----
04103:32A9 12 51 3 00 0000 000 0003 DEAD BEAF 0015 ---- ---- ---- ---- ---- 0104 F00D 0004 ---- 0000 ---- ---- ----
04104:026A 11 52 0 00 0000 001 0003 DEAD BEAF 0015 F00D ---- ---- ---- ---- 0104 F00D 0004 ---- 0000 ---- ---- ----
04105:232F 14 57 2 00 0000 100 0003 DEAD BEAF 0015 F00D ---- ---- ---- ---- 0104 F00D 0004 ---- FFFF ---- ---- ----
04106:C17C L05 74 0 11 0000 100 0003 DEAD BEAF 0015 F00D ---- ---- ---- ---- 0104 F00D 0004 ---- FFFF ---- ---- ----