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
|
!
! .MACRO RESERVE_STR P1=0 P2
! .SDATA .SUBSTR("ABCDEFG",\P1,\P2)
! .ENDM
!
! RESERVE_STR 2,2
! .SDATA .SUBSTR("ABCDEFG",2,2)
.byte 67,68
! RESERVE_STR ,3
! .SDATA .SUBSTR("ABCDEFG",0,3)
.byte 65,66,67
!
!
! .MACRO FIND_STR P1
! .DATA.W .INSTR("ABCDEFG","\P1", 0)
! .ENDM
!
! FIND_STR CDE
! .DATA.W .INSTR("ABCDEFG","CDE", 0)
.short 2
! FIND_STR H
! .DATA.W .INSTR("ABCDEFG","H", 0)
.short -1
!
! .MACRO RESERVE_LENGTH P1
! .ALIGN 4
! .SRES .LEN("\P1")
! .ENDM
!
! RESERVE_LENGTH ABCDEF
! .ALIGN 4
.align 4
! .SRES .LEN("ABCDEF")
.space 24
! RESERVE_LENGTH ABC
! .ALIGN 4
.align 4
! .SRES .LEN("ABC")
.space 12
!
! .END
|