Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
21
Task/Machine-code/Draco/machine-code-1.draco
Normal file
21
Task/Machine-code/Draco/machine-code-1.draco
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* 8080 machine code in an array */
|
||||
[6] byte add_mc = (
|
||||
0xC1, /* POP B - get return address */
|
||||
0xD1, /* POP D - get second argument */
|
||||
0xE1, /* POP H - get first argument */
|
||||
0x19, /* DAD D - add arguments */
|
||||
0xC5, /* PUSH B - push return address back */
|
||||
0xC9 /* RET - return */
|
||||
);
|
||||
|
||||
proc nonrec main() void:
|
||||
/* Declare a function pointer */
|
||||
type fn = proc(word a, b) word;
|
||||
fn add;
|
||||
|
||||
/* Pretend the array is actually a function */
|
||||
add := pretend(add_mc, fn);
|
||||
|
||||
/* Call the function and print the result */
|
||||
writeln(add(12, 7))
|
||||
corp
|
||||
Loading…
Add table
Add a link
Reference in a new issue