Works only with the latest MASM version, or with JWasm:
include \masm32\MasmBasic\MasmBasic.inc ; download (http://masm32.com/board/index.php?topic=94.0)
Init
mov ecx, 66666
@@:
Print Str$(ecx), " "
loopnew @B
Exit
end start
Discovered ??
:icon_eek:
1) is this a MasmBasic thing ?
2) isn't ECX destroyed in the Print call ?
3) what Van said - lol
:lol: ml 6.15 has no problem with it either (as it shouldn't)
but - what opcode is generated ?
it's probably an alias for one of the well-known LOOPxx instructions
Quote from: dedndave on August 07, 2015, 08:47:40 PMit's probably an alias for one of the well-known LOOPxx instructions
Congrats, you are very close :t
LOOPNEW is "loop non-equal word sized". It loops as long as the zero flag is not set and cx>0.
;)
P.S.:
> 1) is this a MasmBasic thing ?
No, works with ML 6.14
> 2) isn't ECX destroyed in the Print call ?
Not in MasmBasic
> 3) what Van said - lol
I just discovered it :biggrin:
ins (LOOP, loop, OpCls( I8, NONE, NONE ), 0, 0, no_RM, 0xE2, 0x00, P_86, 0)
ins (LOOPE, loope, OpCls( I8, NONE, NONE ), 0, 0, no_RM, 0xE1, 0x00, P_86, 0)
ins (LOOPZ, loopz, OpCls( I8, NONE, NONE ), 0, 0, no_RM, 0xE1, 0x00, P_86, 0)
ins (LOOPNE, loopne, OpCls( I8, NONE, NONE ), 0, 0, no_RM, 0xE0, 0x00, P_86, 0)
ins (LOOPNZ, loopnz, OpCls( I8, NONE, NONE ), 0, 0, no_RM, 0xE0, 0x00, P_86, 0)
ins (LOOPD, loopd, OpCls( I8, NONE, NONE ), F_32A, 0, no_RM, 0xE2, 0x00, P_386, 0)
ins (LOOPED, looped, OpCls( I8, NONE, NONE ), F_32A, 0, no_RM, 0xE1, 0x00, P_386, 0)
ins (LOOPZD, loopzd, OpCls( I8, NONE, NONE ), F_32A, 0, no_RM, 0xE1, 0x00, P_386, 0)
ins (LOOPNED,loopned, OpCls( I8, NONE, NONE ), F_32A, 0, no_RM, 0xE0, 0x00, P_386, 0)
ins (LOOPNZD,loopnzd, OpCls( I8, NONE, NONE ), F_32A, 0, no_RM, 0xE0, 0x00, P_386, 0)
insx(LOOPW, loopw, OpCls( I8, NONE, NONE ), F_16A, 0, no_RM, 0xE2, 0x00, P_86, 0, RWF_IA32)
insx(LOOPEW, loopew, OpCls( I8, NONE, NONE ), F_16A, 0, no_RM, 0xE1, 0x00, P_86, 0, RWF_IA32)
insx(LOOPZW, loopzw, OpCls( I8, NONE, NONE ), F_16A, 0, no_RM, 0xE1, 0x00, P_86, 0, RWF_IA32)
insx(LOOPNEW,loopnew, OpCls( I8, NONE, NONE ), F_16A, 0, no_RM, 0xE0, 0x00, P_86, 0, RWF_IA32)
insx(LOOPNZW,loopnzw, OpCls( I8, NONE, NONE ), F_16A, 0, no_RM, 0xE0, 0x00, P_86, 0, RWF_IA32)