RS
Size: a a a
RS
RS
du
ещё можно поспорить, то dw
точно не макрос, и есть везде.LW
LW
RS
RS
LW
LW
s
du 'строка'
в последовательность dw
. Но вот если ты хочешь выбирать кодировку исходной строки, тогда есть набор макросов с тем же именем для разных кодировок.RS
du 'строка'
в последовательность dw
. Но вот если ты хочешь выбирать кодировку исходной строки, тогда есть набор макросов с тем же именем для разных кодировок.macro du [args]
{
common local ..count,..current,..byte,..wide,..match,..step,..eof
..match = 0
..step = 0
virtual at 0
db args
..count = $
end virtual
..current = 0
repeat ..count
if ..current<..count
virtual at 0
db args
load ..byte byte from ..current
if ..byte=0FEh
..eof = 1
..match = 1
..step = 1
..current = ..current+1
load ..byte byte from ..current
..wide = ..byte
..current = ..current+1
load ..byte byte from ..current
..wide = ..wide + (..byte SHL 8)
else if ..byte=0FFh
..eof = 0
..match = 0
..step = 0
else if ..step=1
..wide = ..byte
..current = ..current+1
load ..byte byte from ..current
..wide = ..wide + (..byte SHL 8)
else
..eof = 1
..wide = ..byte
end if
..current = ..current+1
end virtual
if ..eof=1
dw ..wide
end if
end if
end repeat
if ..match<>0
display "Error! The unicode string [",args,"] can't match!",0DH,0AH
end if
}
s
macro du [args]
{
common local ..count,..current,..byte,..wide,..match,..step,..eof
..match = 0
..step = 0
virtual at 0
db args
..count = $
end virtual
..current = 0
repeat ..count
if ..current<..count
virtual at 0
db args
load ..byte byte from ..current
if ..byte=0FEh
..eof = 1
..match = 1
..step = 1
..current = ..current+1
load ..byte byte from ..current
..wide = ..byte
..current = ..current+1
load ..byte byte from ..current
..wide = ..wide + (..byte SHL 8)
else if ..byte=0FFh
..eof = 0
..match = 0
..step = 0
else if ..step=1
..wide = ..byte
..current = ..current+1
load ..byte byte from ..current
..wide = ..wide + (..byte SHL 8)
else
..eof = 1
..wide = ..byte
end if
..current = ..current+1
end virtual
if ..eof=1
dw ..wide
end if
end if
end repeat
if ..match<>0
display "Error! The unicode string [",args,"] can't match!",0DH,0AH
end if
}
du
. Но тебя никто не заставляет подключать encoding/whatever.inc
. Не подключишь — не перекроет, для ASCII оно будет правильно работать, а для русских букв — уже нет.RS
A
a
S
С