From owner-freebsd-hackers Mon Feb 26 05:25:37 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id FAA18080 for hackers-outgoing; Mon, 26 Feb 1996 05:25:37 -0800 (PST) Received: from hq.icb.chel.su (icb-rich-gw.icb.chel.su [193.125.10.34]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id FAA17980 for ; Mon, 26 Feb 1996 05:23:39 -0800 (PST) Received: from localhost (babkin@localhost) by hq.icb.chel.su (8.6.5/8.6.5) id SAA10862; Mon, 26 Feb 1996 18:21:16 +0500 From: "Serge A. Babkin" Message-Id: <199602261321.SAA10862@hq.icb.chel.su> Subject: as(1) patch & dis To: bde@zeta.org.au (Bruce Evans) Date: Mon, 26 Feb 1996 18:21:15 +0500 (GMT+0500) Cc: hackers@freebsd.org In-Reply-To: <199512261054.VAA31894@godzilla.zeta.org.au> from "Bruce Evans" at Dec 26, 95 09:54:01 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@freebsd.org Precedence: bulk Hello! I have found a bug in the assembler. It does not understand the following construction: _x: .long 1 _y: .long 2 mov %eax,(_y-_x)(%ebx) ^^^^^^^^ (differences as displacements) I needed this for my experiments with kernel startup time BIOS calls. I have fixed this bug. Commit it please if you find this patch enough good. BTW, for fixing this bug :-) I have written a 386 disassembler. It's alpha quality yet but already useful. I think any people who wants to reengineer some "object-only" BSDi code will find it useful too. So how about to commit it ? Thanks! The patch is: *** 1.1 1996/01/22 12:23:07 --- config/tc-i386.c 1996/02/26 13:09:25 *************** *** 1644,1649 **** --- 1644,1652 ---- RESTORE_END_STRING (displacement_string_end); input_line_pointer = save_input_line_pointer; switch (exp_seg) { + case SEG_DIFFERENCE: + i.types[this_operand] |= Disp32; /* this is an address ==> 32bit */ + break; case SEG_ABSENT: /* missing expr becomes absolute 0 */ as_bad("missing or invalid displacement '%s' taken as 0",