Skip to content

Instantly share code, notes, and snippets.

@ik5
Created September 7, 2010 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ik5/569230 to your computer and use it in GitHub Desktop.
Save ik5/569230 to your computer and use it in GitHub Desktop.
A test in Pascal (FPC) for some low level. I'm looking to know how to translate it into C and _asm
{$IFDEF FPC}{$GOTO ON}{$asmmode att}{$ENDIF}
program asm_code;
label a_label;
label _end;
var i : integer;
begin
writeln('a_label address: ', HexStr(PtrUInt(@a_label), 32));
i := -10;
a_label:
writeln(i:3,' in a_label');
asm
inc i
cmpw $10,i
jle a_label
end;
_end:
writeln('Bye');
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment