mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 06:54:04 +09:00
mon: w to accept spaces between bytes
This commit is contained in:
@@ -97,14 +97,20 @@ while (1) {
|
|||||||
let arg = buf[1]
|
let arg = buf[1]
|
||||||
if (arg == undefined)
|
if (arg == undefined)
|
||||||
pE = "No arguments given"
|
pE = "No arguments given"
|
||||||
else if (arg.length % 2 == 1)
|
|
||||||
pE = "Length of byte string is odd number"
|
|
||||||
else {
|
else {
|
||||||
for (let i = 0; i < arg.length; i += 2) {
|
let str = buf.slice(1).join('').trim()
|
||||||
let b = parseInt(arg.charAt(i)+arg.charAt(i+1), 16)
|
|
||||||
putNinc(b)
|
if (str.length % 2 == 1)
|
||||||
|
pE = "Length of byte string is odd number"
|
||||||
|
else if (str.length == 0)
|
||||||
|
pE = "No bytes given"
|
||||||
|
else {
|
||||||
|
for (let i = 0; i < str.length; i += 2) {
|
||||||
|
let b = parseInt(str.charAt(i)+str.charAt(i+1), 16)
|
||||||
|
putNinc(b)
|
||||||
|
}
|
||||||
|
pE = undefined
|
||||||
}
|
}
|
||||||
pE = undefined
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ("R" == cmd) {
|
else if ("R" == cmd) {
|
||||||
|
|||||||
Reference in New Issue
Block a user