A couple of typical routines that mix the two appear below. First, a rather obvious example from our general purpose library:
To add a number to another number:
Intel $8B8508000000. \ mov eax,[ebp+8] \ the number
Intel $8B00. \ mov eax,[eax]
Intel $8B9D0C000000. \ mov ebx,[ebp+12] \ the other number
Intel $0103. \ add [ebx],eax
This routine can be called with statements like:
Add 1 to a count.
Add the running total to the grand total.
Add the offset to the base address.
Secondly, a routine from our compiler that generates the machine code for a routine's prolog:
To transmogrify a fragment (prolog):
Attach $55 to the fragment's code. \ push ebp
Attach $8BEC to the fragment's code. \ mov ebp,esp
Put the current routine's local size divided by 4 into a number.
If the number is not 0, attach $B9 and the number and $6A004975FB to the fragment's code. \ mov ecx,number; loop: push 0; dex ecx; jnz loop
If the current routine's callback flag is set, attach $535657 to the fragment's code. \ push ebx, esi, edi
The above routine is called in our compiler after all the relevant details have been collected from the source code and we're ready to generate executable code.
Relatively few of the 25,000 lines of our Plain English system are of this sort, since it really doesn't take that much machine code to construct a basis for higher-level programming -- so instead of implementing a built-in assembler we simply "assembled" the necessary instructions in our heads and typed them in as the hex literals you see above ("$" marks the start of a hex literal, and "\" marks the start of a comment).
The instructions for the system are available here:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum