Okay, let's do this.
First, look at opcodes for the 8086/8088 or common instructions in the 6502. We're doing 8088 today.
So, let's translate this:
Code: Select all
mov ax, 5Ch
mov dl, ax
mov ch, ax
I'm just gonna skip the possible deadline you MAY hit. First, let's do some "off-code" stuff, and restore any possible changes, to not hit the deadline (there is no opcode for specifically making AX 5C possible directly.)
Let's set BX to 005Ch. We have to use words, and this is the same value anyway!
"0xBB 0x00 0x5C"
And properly set BX to ax doing mov ax, bx.
"0x89 0xD8".
We can't clear BX. That's not a problem. The code never does anything with BX anyway.
Let's do
Code: Select all
mov dl, ax
mov ch, ax
We, cannot move by ourselves "mov dl, ax". Let's do the equivalent: "mov dl, 5Ch". This is available.
"0xB2 0x5C".
That was easy.
Same problem with "mov ch, ax". Let's do the equivalent, which is available, yet again.
"0xB5 0x5C".
The program terminates.
TL;DR: That code in the closest-to-code-possible-way-in-8088 = 0xBB 0x00 0x5C 0x89 0xD8 0xB2 0x5C 0xB5 0x5C.
And if you want to switch to VGA:
0xB0 0x13 0xCD 0x40
which is
Code: Select all
mov ah, 13h
int 10h
Those are some examples. You can simply do "mov ah, ACh" by doing:
0xB0 0xAC.
0xB0 = mov ah
0xAC = , ACh
= mov ah, ACh