Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Some more patches for GCC on NetBSD/VAX coming soon...



On 2016-04-01 21:14, Mouse wrote:
	cmp #42
	beq label
	lda #1
	.byte $2C   ; opcode for a 3-byte instruction that doesn't do much,
		    ; usually the BIT abs instruction that only changes
		    ; condition codes
label:	lda #2	    ; a 2-byte instruction

Ooo.  A tricky way of doing a skip.  I hadn't seen that before.
Nice.

Yes, a clever hack, indeed.

However, on, for example a VAX, this is pretty hard to do, as the
instruction length is not encoded into the opcode.

No...but you might be able to do something similar.  Consider

	.byte	X
	instr	operand, ...

where the opcode for "instr" is an operand specifier, and "instr" takes
one operand fewer than the instruction X is opcode for.  For example,

e1:	.byte	0xd0
e2:	.byte	0x53
	.byte	0x50

If entered at e1, this is "movl r3,r0"; if entered at e2, it's
"tstf r0".  In this case this isn't all that useful, but the basic idea
should be clear.

Yes. But the problem is that the opcode at e2 will be interpreted as an operand for e1. And as an operand it might imply that it needs up to 8 bytes more or so... Which will totally break the concept.

	Johnny



Home | Main Index | Thread Index | Old Index