-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab1.asm
57 lines (40 loc) · 768 Bytes
/
lab1.asm
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
56
57
LIST p=18f452
INCLUDE <P18F452.INC>
CBLOCK 0x480
MapName:8
ENDC
EXTERN MapIndex
filter CODE
Mapname
movlw 0x4D ; M
movwf 0x480
movlw 0x61 ; a
movwf 0x481
movlw 0x70 ; p
movwf 0x482
movlw 0x4E ; N
movwf 0x483
movlw 0x61 ; a
movwf 0x484
movlw 0x6D ; m
movwf 0x485
movlw 0x65 ; e
movwf 0x486
movlw 0x00 ; Null
movwf 0x487
getMapChar
movlw 0x07
cpfsgt MapIndex,0
goto sendMapChar
goto invalidIndex
sendMapChar
lfsr FSR0, 0x480
movf MapIndex,W
movf PLUSW0,W
return
invalidIndex
movlw 0xFF
return
GLOBAL Mapname
GLOBAL getMapChar
END