Assembler|corewars8086 Engine!

Thread Starter

dimah4x

Joined Jan 9, 2014
9
i need some help with an assembler code that runs in the corewars8086 engine
so basically there are 2 interrupts that can be used once per round so i wanted to know if i can use someone can help me build a code that does the same thing as the interrupt so i can use it more then once
by the way its ASM8086

so these are interrupts 0x86 and 0x87 (hexadecimal)
0x86 takes 256 bits from the di to the es and puts inside them illegal values like 0cccch
normaly to use the interrupt the code will go like this :

Rich (BB code):
push cs
pop es                     ; set es as the code segment (main memory map)


xor di,di                       ; di is our offset, xoring it with himself
                                  ; will set him to zero


mov ax, 0cccch              ; set invalid opcodes in ax.


mov dx, ax                     ; ... and copy it to dx

int 86h                          ; execute interrupt 0x86.
the sorted writing in the memory is AL then AH then DL then DH

about 0x87 it searches for a combination of 4 bytes (for example 01234h) on a 64kb segment
and replaces the value of them with an illegal value like 0cch or with a jump commands (jmp)

for example to run the 0x87:

Rich (BB code):
push cs


pop es                 ; set es as the code segment(main memory map)

xor di,di                        ; di is our offset, xoring it with himself
                                  ; will set him to zero
mov ax, 04187h             ; ax:dx is the byte string to find.

mov dx, 08820h

mov cx, 0cccch             ; cx:bx is the byte string to replace with.

mov bx,cx

int 87h                         ; execute interrupt 0x87.
if any one could help me i would be glad since i really need this
thanks in advance! :)
 
Top