Created
September 7, 2010 22:10
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{$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