CODEGEN.SLC is a simple parser that accepts an expression from input and writes 80x86 compatible assembly code to output. In this case, CODEGEN.SLC has been compiled to CODEGEN.COM and is being run under a DOS emulator, with your expression "stuffed" into the input.
executing "codegen" via DOSCMD and stuffing data "(a * b) - 5" to STDIN...
> (a * b) - 5
; (a * b) - 5
mov ax,a
push ax
mov ax,b
mov bx,ax
pop ax
mul bx
push ax
mov ax,5
mov bx,ax
pop ax
sub ax,bx
>
;
Bye!
|
Notes:
Lines starting with ">" are the stuffed input. Lines starting with ";" are comments in the output.
If this code was assembled and executed, the result would be in AX.
Yes, this is really the output of a DOS executable running on a FreeBSD (unix) web server!
Return to SLC homepage
|