summary refs log tree commit diff
path: root/meadow2018.s
blob: dbcd513b78a41a17c857484ec1cb82407e143566 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
        B start


verse	DEFW	4
menmow  DEFB 	"went to mow\n",0
mowdow  DEFB    "Went to mow a meadow\n",0
men     DEFB    "men",0
man     DEFB    "man",0
comma   DEFB    ",",0
nl      DEFB    "\n",0
space   DEFB    " ",0
and_dog DEFB    "and his dog, Spot",0

        
        ALIGN
;4 men went to mow\n
start   MOV R1, #0
main    ADR R0, verse
        SWI 3
        ADR R0, space
        SWI 3
        ADR R0, men
        SWI 3
        ADR R0, menmow

;Went to mow a meadow\n
        ADR R0, mowdow
        SWI 3

;4 men, X men,
        


        ADR R0, mowdow
        SWI 3

        ADR R0, verse
        SUBS R0, R0, R1 ; SUBS
        ADD R1, R1, #1 ;increase the substract value
        SWI 4
        
        BHI #0 print_plural
        BEQ #0 singular

        SWI 2  


singular  


        B main

plural

    B main