mirror of
https://github.com/uffejakobsen/acme.git
synced 2024-11-26 15:49:18 +00:00
21 lines
355 B
Plaintext
21 lines
355 B
Plaintext
|
;ACME 0.97
|
||
|
|
||
|
; macro to store a petscii string with msb set in last byte
|
||
|
!macro msbstring @s {
|
||
|
!ct pet {
|
||
|
@l = len(@s)
|
||
|
!if @l < 1 {
|
||
|
!error "String is empty!"
|
||
|
}
|
||
|
!for @i, 0, @l - 1 {
|
||
|
!if $80 & @s[@i] {
|
||
|
!error "String already contains character(s) with MSB set!"
|
||
|
}
|
||
|
}
|
||
|
!for @i, 0, @l - 2 {
|
||
|
!byte @s[@i]
|
||
|
}
|
||
|
!byte $80 | @s[-1]
|
||
|
}
|
||
|
}
|