There is a macro in rombios.c called HALT which is supposed to write a
pointer to a message out to a magical panic port 0x400.  However, because
of the way the macro is written it is not working as intended.  Here is
the macro definition:

#define PANIC_PORT 0x400
#define HALT(line) mov dx,PANIC_PORT; mov ax,line; out dx,ax; hlt

This looks great to a C programmer because we assume that ";" is a command
separator.  However to as86, the first semicolon means that every else on
the line is a comment.  So you end up with only the mov dx,0x400!

I tried several modifications already such as 

#define HALT(line) mov dx,PANIC_PORT; \
   mov ax,line; \
   out dx,ax; \
   hlt

but the preprocessor just puts them back on the same line and as86
continues to trash the mov ax, out, and hlt.  We could write a halt
function, but I'm hoping someone knows the right syntax to compile
several instructions on one line in as86 assembly.

Or we can give up on HALT and just use panic.  There are only 11 of them.

Thanks,
Bryce


Reply via email to