1
0
mirror of https://github.com/KarolS/millfork.git synced 2026-04-20 03:16:45 +00:00

Add nullchar constant, NULLCHAR feature, and vectrex encoding

This commit is contained in:
Karol Stasiak
2019-08-16 00:46:11 +02:00
parent 263647c59c
commit 960d16fa18
10 changed files with 139 additions and 64 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ asm void putstrz(pointer hl) @$5550 extern
void putstrz(pointer str) {
byte index
index = 0
while str[index] != 0 {
while str[index] != nullchar {
putchar(str[index])
index += 1
}
+1 -1
View File
@@ -25,7 +25,7 @@ word strz2word(pointer str) {
errno = err_ok
while true {
char = str[i]
if char == 0 {
if char == nullchar {
if i == 0 {
errno = err_numberformat
}
+3 -3
View File
@@ -1,7 +1,7 @@
byte strzlen(pointer str) {
byte index
index = 0
while str[index] != 0 {
while str[index] != nullchar {
index += 1
}
return index
@@ -17,7 +17,7 @@ sbyte strzcmp(pointer str1, pointer str2) {
if str1[i1] < str2[i2] { return -1 }
return 1
}
if str1[i1] == 0 {
if str1[i1] == nullchar {
return 0
}
i1 += 1
@@ -33,5 +33,5 @@ void strzcopy(pointer dest, pointer src) {
c = src[i]
dest[i] = c
i += 1
} while c != 0
} while c != nullchar
}
+4 -4
View File
@@ -3,7 +3,7 @@
byte strzlen(pointer str) {
pointer end
end = str
while end[0] != 0 {
while end[0] != nullchar {
end += 1
}
return lo(end - str)
@@ -11,8 +11,8 @@ byte strzlen(pointer str) {
sbyte strzcmp(pointer str1, pointer str2) {
while true {
if str1[0] == 0 {
if str2[0] == 0 {
if str1[0] == nullchar {
if str2[0] == nullchar {
return 0
} else {
return -1
@@ -33,5 +33,5 @@ void strzcopy(pointer dest, pointer src) {
dest[0] = c
src += 1
dest += 1
} while c != 0
} while c != nullchar
}