Fixed issue with assembler segfault

This commit is contained in:
neauoire 2021-03-28 10:20:24 -07:00
parent c2a5c8cac2
commit ebdb079cae
4 changed files with 22 additions and 6 deletions

View File

@ -28,7 +28,7 @@ else
fi
echo "Assembling.."
./bin/assembler projects/software/noodle.usm bin/boot.rom
./bin/assembler projects/software/left.usm bin/boot.rom
echo "Running.."
if [ "${2}" = '--cli' ];

View File

@ -2,6 +2,10 @@
%8+ { #0008 ADD2 }
%8* { #0030 SFT2 }
%MOD2 { #03 AND }
;cursor { x 2 y 2 blink 1 }
|0100 ;Console { pad 8 char 1 byte 1 short 2 }
|0110 ;Screen { width 2 height 2 pad 4 y 2 x 2 color 1 }
@ -15,6 +19,15 @@
@FRAME
( update cursor )
#02 ~cursor.blink #01 EQU ADD =Sprite.color
,cursor_icn =Sprite.addr
~cursor.blink MOD2 #00 EQU =cursor.blink
~Keys #00 EQU ^$end JNZ
( enter key )
@ -34,6 +47,8 @@
BRK
@cursor_icn [ ffff ffff ffff ffff ]
@font ( spectrum-zx font )
[
0000 0000 0000 0000 0000 2400 7e3c 0000 0000 2400 3c42 0000 0000 6c7c 7c38 1000

View File

@ -263,11 +263,11 @@ walktoken(char *w)
if(findopcode(w) || scmp(w, "BRK", 4))
return 1;
switch(w[0]) {
case '=': return 4 - (findlabeladdr(w + 1) < 0x0100); /* POK/STR helper (lit addr(1/2) str) */
case '~': return 4 - (findlabeladdr(w + 1) < 0x0100); /* PEK/LDR helper (lit addr(1/2) ldr) */
case ',': return 3; /* lit2 addr-hb addr-lb */
case '.': return 2; /* addr-hb addr-lb */
case '^': return 2; /* Relative jump: lit addr-offset */
case '=': return 4 - (findlabel(w + 1) && findlabeladdr(w + 1) < 0x0100); /* POK/STR helper (lit addr(1/2) str) */
case '~': return 4 - (findlabel(w + 1) && findlabeladdr(w + 1) < 0x0100); /* PEK/LDR helper (lit addr(1/2) ldr) */
case ',': return 3; /* lit2 addr-hb addr-lb */
case '.': return 2; /* addr-hb addr-lb */
case '^': return 2; /* Relative jump: lit addr-offset */
case '#': return (slen(w + 1) == 2 ? 2 : 3);
}
if((m = findmacro(w))) {

View File

@ -436,6 +436,7 @@ datetime_poke(Uxn *u, Uint16 ptr, Uint8 b0, Uint8 b1)
m[ptr + 8] = (t->tm_yday & 0xff00) >> 8;
m[ptr + 9] = t->tm_yday & 0xff;
m[ptr + 10] = t->tm_isdst;
(void)b0;
return b1;
}