Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Assembler|corewars8086 Engine! (https://www.warriorforum.com/programming/888888-assembler-corewars8086-engine.html)

Dimah4x 9th January 2014 12:02 AM

Assembler|corewars8086 Engine!
 
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 :

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:

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! :)

Worrier9001 9th January 2014 01:52 AM

Re: Assembler|corewars8086 Engine!
 
Assembly code? Somehow used for internet marketing?

shahriyar 9th January 2014 04:19 AM

Re: Assembler|corewars8086 Engine!
 
Quote:

Originally Posted by Worrier9001 (Post 8851479)
Assembly code? Somehow used for internet marketing?

Nope, not related to IM, but this is programming forum, so someone might be able to help :)

Dimah4x 9th January 2014 12:16 PM

Re: Assembler|corewars8086 Engine!
 
if you wish i could upload the engine so you could play with it


All times are GMT -6. The time now is 10:32 AM.